I am trying to find a formula for the height (or width) of the smaller rectangles in the following problem along with the number of rows they require: A given number $N$ rectangles (all of which are of the same size) must fit into another larger rectangle. The smaller rectangles must be in rows that are as even as possible.
Known constants:
- $N$ - number of smaller rectangles;
- $R$ - width to height ratio of the smaller rectangles,
- $R$ is always less than $1$ i.e. width is always less than height;
- $H$ - height of the larger rectangle;
- $W$ - width of the larger rectangle,
- $W$ is always more than H.
Required unknown variables:
- $w$ - width of the smaller rectangles;
- $r$ - number of rows of the smaller rectangles with the smaller rectangles being distributed as evenly as possible between the rows.