I'm trying to figure out how many boxes fit in a specific area without over-estimating. The problem is the width of the space isn't a whole number multiple of the width of the boxes, the depth isn't either, nor the height.
I could estimate by just divide the width of the area by the width of the box, and multiply that by the hight of the area divided by the hight of the box, but as you can imagine I might end up with more boxes than I can fit in the area. (mainly because all the "extra space" adds up to being several boxes in volume).
Is there an algebraic way of getting around this? I know I could use the floor and ceiling function and write a computer program to figure it out, but this feels like this should be solvable using algebra alone. Thanks

If the smaller boxes must all have the orientation shown, the count is $$ \left\lfloor\frac{w_s}{w_b}\right\rfloor \left\lfloor\frac{h_s}{h_b}\right\rfloor \left\lfloor\frac{d_s}{d_b}\right\rfloor $$