HeyHere is the work.
The best way to approach this problem seems to start with a few small rectangles 2×3, 2×5, 3×5,
etc. Tabulate the results and next try to generalize. There are going to be exceptional cases, like
2×4, 3×6, 4×6. These would need a special treatment and further generalization.
How can we count the crossed squares in that (simple) case? The upper left square is always
crossed. This is 1. Next, on its way to the next square the diagonal crosses one of the (internal)
grid lines. In fact, this happens every time we move f...