Question 134685
While the picture would be helpful, one can easily imagine how it would look!
Let's first look at the given example of 39 squares in a 6 by 4 jagged rectangle.
First, each individual square would be tilted at an angle of 45 degrees, so that one of its corners would be in the upper-most position.
Now, lay 6 such squares side by side so that each square touches a adjacent square at a corner.
Now, beneath that row of 6 squares, place 5 squares so that they fit in the triangular spaces between two adjcent squares of the first row of squares.
Continue this arrangement until you have 4 rows of squares in 6 columns.
The pattern is then is 1 row of 6 squares, then 1 row of 5 squares, then 1 row of 6 squares, in an alternating fashion.
You can see that the total number of squares is the sum of 4 rows of 6 squares plus 3 rows of 5 squares, or 4*6+3*5 = 24+15 = 39 squares.
Now, applying the same reasoning to the larger jagged rectangle, you can see that there would be alternating rows of 9 squares and 8 squares.
There would be 7 rows of 9 squares plus 6 rows of 8 squares for a total of 7*9 + 6*8 = 63 + 48 = 111 squares.
I suppose one could generalise this for a jagged rectangle of m by n squares.
Total number of squares = m*n+(m-1)(n-1) = 2mn-m-n+1