## Problem 3.

Consider a network formed by 49 points, which are the vertices of 36 squares of side length 1 into which a square of side length 6 is decomposed.

We say that a square with vertices on the network points is good if its sides and diagonals do not lie on the sides of the network squares.

a) Find the number of good squares that can be formed with the network points.

b) Show that there exist two disjoint and non-congruent good squares such that the smallest distance between their points is $\frac{\sqrt{5}}{5}$.
Solution. a) We say that a square is normal if its vertices are on the grid points and its sides lie on the lines of the grid parallel to the sides of the $6 \times 6$ square, or on the sides of the $6 \times 6$ square. Any good square has its vertices on the sides of a normal square, whose side length can be equal to $3, 4, 5$ or 6. Let a normal square have side length $x \in \{3, 4, 5, 6\}$. The side of a good square inscribed in this has a length of the form $\sqrt{a^{2}+b^{2}}$, where $a, b \in \{1, 2, \ldots, x-1\}, a \neq b$, such that $a+b=x$.

Indeed, if $a=0$, or $b=x$, then the sides of the good square are on the sides of the grid squares, and if $a=b$, then the sides of the good square are parallel to the diagonals of the large square, so its diagonals are on the support lines of the grid, which is false. ..................................... 1p

If $a, b \in \{1, 2, \ldots, x-1\}$, with $a \neq b$ and $a+b=x$, each normal square of side length $x$ contains exactly two good squares generated by the pair $(a, b)$, having a side length of $\sqrt{a^{2}+b^{2}}$

![](https://cdn.mathpix.com/cropped/2024_06_07_358793f0e2c2b567ccf8g-5.jpg?height=439&width=439&top_left_y=1556&top_left_x=1250)
and whose vertices are on its sides, as shown in the adjacent figure. ............................. 1p

For $x=3=1+2$, in each normal square of side length 3, there are exactly two good squares generated by $(a, b) \in \{(1,2),(2,1)\}$. From this, in each horizontal strip of the form $6 \times 3$, there are $2 \cdot 4=8$ good squares of side length $\sqrt{5}$. Since there are 4 horizontal strips of width 3, in total there are $8 \cdot 4=32$ good squares of side length $\sqrt{5}$.

Similarly, it can be shown that there are:

- 18 good squares of side length $\sqrt{10}$, generated by $(a, b) \in \{(1,3),(3,1)\}$,
- 8 good squares of side length $\sqrt{17}$, generated by $(a, b) \in \{(1,4),(4,1)\}$,
- 2 good squares of side length $\sqrt{26}$, generated by $(a, b) \in \{(1,5),(5,1)\}$,
- 8 good squares of side length $\sqrt{13}$, generated by $(a, b) \in \{(2,3),(3,2)\}$
- 2 good squares of side length $\sqrt{20}$, generated by $(a, b) \in \{(2,4),(4,2)\}$.

The total number of all good squares is: $32+18+8+4+2+4+2=70$.

b) We choose the good squares $A B C D$ and $M N P Q$ as shown in the adjacent figure, with $A B = \sqrt{5}$ and $M N = \sqrt{10}$, such that $A, D, M$ and $N$ are on the sides of the large square.

Let the line $d$ pass through $Q$ and be parallel to $B C$. Since $M N P Q$ is included in the half-plane $[d M$, it follows that the sought distance is the distance from $Q$ to $A B C D$. We choose points $R$ and $F$ such that $Q$ is the midpoint of segment $B R$, triangle $B F Q$ is right-angled at $B$, with $B F=2$, and $F$ and $M$ are on opposite sides of line $d$.

![](https://cdn.mathpix.com/cropped/2024_06_07_358793f0e2c2b567ccf8g-6.jpg?height=675&width=697&top_left_y=535&top_left_x=1039)

Since triangles $B Q F$ and $R C B$ are congruent, it follows that lines $B C$ and $F Q$ are perpendicular, and the sought distance is equal to the length of segment $Q E$, where $Q$ is the intersection point of lines $B C$ and $F Q$. By the leg theorem, it follows that $E Q = \frac{\sqrt{5}}{5}$

Observations. 1) If $a, b \in \{1, 2, \ldots, x-1\}$, with $a+b=x$, in each horizontal strip of the form $6 \times (a+b)$ there are $2 \cdot (7-(a+b))$ good squares of side length $\sqrt{a^{2}+b^{2}}$. Since there are $7-(a+b)$ horizontal strips of width $a+b$, in total there are $2 \cdot (7-a-b)^2$ good squares of side length $\sqrt{a^{2}+b^{2}}$, generated by pairs $(a, b)$ and $(b, a)$.