6.1. On the coordinate plane, an isosceles right triangle with vertices at points with integer coordinates is depicted. It is known that there are exactly 2019 points with integer coordinates on the sides of the triangle (including the vertices). What is the smallest possible length of the hypotenuse of the triangle under these conditions? Provide the length of the hypotenuse, rounded to the nearest integer.
Answer: 952.

Solution. The smallest length of the hypotenuse corresponds to the case where the distance between the points is the smallest, which is only possible when the legs follow the grid lines (for a rotated triangle, the distance between the points will be no less than $\sqrt{2}$). Then each leg has a length of 673, and the hypotenuse is $673 \sqrt{2} \approx 952$.