1
$\begingroup$

Given the dimensions of two rectangles, i need to know how many smaller rectangles can fit the bigger one. It should account for mixed orientations meaning that the smaller rectangle can both be landscape and portrait when fit inside the bigger rectangle.

Example image

Is there a math equation for this?

Thanks!

  • 0
    If I knew, I would have posted an answer. But someone else has...2012-01-17

1 Answers 1

3

I don't think there's any "formula" for this and as far as I remember the problem is conjectured to be NP-hard, but not proven to be. For a heuristic that finds very good solutions (conjectured by the authors to be optimal), see this.

  • 0
    what about finding how many could fit in x and how many could fit in y then we have how many could fit totally by multiplying the results2015-05-12