Try this
The function predicts that you can get 30 cartons into the box (I would need a box and a set of cartons to convince myself). It works by finding the maximum number in a single cuboid and then repeats the exercise to find the maximum for the cuboid portions of the space that is left.
With the largest face as the horizontal base, have a 6 layers of 3 cartons with 60 aligned with 9, and 22 aligned with 40. This leaves a cuboid space of width 60, depth 18 and height 30. This is filled with a single layer of 12 cartons with the square face horizontal.
Bookmarks