Problem 1105 · Medium

Filling Bookcase Shelves

Arrange books in order onto shelves of fixed width so that the total height of the shelves is as small as possible. A table records the best height for each prefix of books.

Open the interactive visualisation