Pack boxes with different size inside a large box

1.6k Views Asked by At

Suppose there are 3 sizes of boxes:

  • 10cm x 10cm x 10cm
  • 20cm x 20cm x 20cm
  • 10cm x 15cm x 4cm

and I have boxes of dimensions 20 x a, 10 x c and 30 x b. How many boxes of 200 x 200 x 100cm do I need to pack them all?

1

There are 1 best solutions below

4
On

$1$ box will be far more than enough! To see this, let's pack even more boxes, let's say a nice even:

$100$ of type $a$: $10*10*10$

$50$ of type $b$: $20*20*20$

$100$ of type $c$: $10*15*4$

Now, the $100$ boxes of type $a$ can be packed in a square of $10$ by $10$ of such boxes, giving you a layer of $100*100*10$

The $50$ boxes of type $b$ can be packed by putting them into two $5x5$ squares, thus giving $2$ layers of $100*100*20$, for a total of $100*100*40$

Finally, the $100$ boxed of type $$c are all smaller in every dimension than those of type $b$, so let's just pack 100 more boxes of type b: if we can do that, we can certainly pack $100$ boxes of type $c$.

Well, if we pack $100$ more boxes of type $b$ the same was as the earlier $50$ boxes, then it would take us an additional $100*100*80$ of space.

So, stack all these layers, and you get $100*100*130$, which easily fits into a single $100*100*200$ box. (indeed, a $100*100*100$ box will be just fine, giving that the boxes of type $c$ can be packed with a height of $4$ instead of $20$, so they would only take up $100*100*16$, for a total of $100*100*66$)

Plenty of space!!