<s>[INST] Square and rectangle The following figure shows an infinite checkered mesh, made up of $1$ cm squares, with the vertices of the highlighted squares.
Note that a square and rectangle with vertices in the mesh are highlighted. The square has exactly $5 $ mesh points inside and the rectangle has exactly $2$ mesh points inside.

a) Present a rectangle with vertices in the mesh that has exactly $2019$ mesh points in its
inside.
b) Show that there are two squares with vertices in the mesh and with non-parallel sides, so that there are
exactly $100$ mesh points inside each one.
c) Show that there is a square with vertices in the mesh and that it has exactly $84$ mesh points in its
inside.
Attemp: a. The rectangle with vertices $(0,0), (2020,0), (0, 2), (2020, 2)$ will work.
b. Let $2$ vertices be $(0,0), (ad, bd)$ where $\gcd(a,b) = 1$ WLOG. There are $4(d+1)-4 = 4d$ boundary points and the area is $d^2(a^2+b^2).$ By Pick's formula, $d^2(a^2+b^2) = 100 + 2d - 1 = 99+2d,$ so $d|99$ by taking $\mod d.$ Letting $99 = dk,$ we get $d(a^2+b^2) = k+2,$ so $d| (99/d + 2) \Rightarrow d = 1, 11.$ If $d=1,$ then $a^2+b^2=101$ which has solutions $(\pm 10, \pm 1)$ and permutations. If $d = 11,$ then $a^2+b^2 = 1,$ which has solutions $(\pm 1, 0)$ and permutations. This gives $2$ unique squares.
c. Same principle, but now $d^2(a^2+b^2) = 2d+83,$ so $d|(83/d + 2),$ so $d=1,$ which gives $a^2+b^2=85,$ with solutions $(\pm 9, \pm 2), (\pm 7, \pm 6)$ for a total of $2$ squares up to reflection and rotation.
b) Using Pick's formula should be easy but I don't know how to use it
How can I do this?
 [/INST] For part b, the square with vertices at $(1,0)$, $(0,10)$, $(10,11)$, and $(11,1)$ and its mirror image (across the line $y=x$) does the trick: each contains the $100$ points $(i,j)$ with $1\le i,j\le10$.
</s>