A rectangle of width w and height h is decomposed into nine squares of side lengths 1, 4, 7, 8, 9, 10, 14, 15, and 18 units. What are w and h?

Bonus points, once you know w and h, if you can fit the squares back together to make the rectangle.

## Solution

The area of the rectangle will be

$wh = 1^2 + 4^2 + 7^2 + 8^2 + 9^2 + 10^2 + 14^2 + 15^2 + 18^2 = 1056.$

Now 1056 factors into 33 x 32. This suggests that $w$ and $h$ are 33 and 32. In fact, if we check, and note that the rectangle must be at least 18 units wide to accommodate the largest square, no other factorization of 1056 will work.

The squares fit together as the figure below shows.