Think in cases of the starting point and other squares.
The number of starting point is
And then, a square
From the above, let
We can calculate naively or using formulas for sum which are mentioned at the problem 6.
Think in cases of the starting point and other squares.
The number of starting point is
And then, a square
From the above, let
We can calculate naively or using formulas for sum which are mentioned at the problem 6.