Solution Notes:
See the notes for the gold-level bookshelf problem.