## Task A-2.5.

In a coordinate system, all integer points $(x, y)$ are marked where $1 \leqslant x \leqslant$ 200 and $1 \leqslant y \leqslant 100$, a total of 20000 points. How many line segments of length $\sqrt{5}$ have their endpoints at the marked points?
## First solution.

The length $\sqrt{5}$ is the diagonal of exactly one rectangle $2 \times 1$ or $1 \times 2$ with vertices on that grid of points.

A $2 \times 1$ rectangle (horizontal) can be placed in any of the 99 rows at 198 positions.

A $1 \times 2$ rectangle (vertical) can be placed in any of the 199 columns at 98 positions.

The total number of their diagonals (i.e., the desired lengths of $\sqrt{5}$) is

$$
2(99 \cdot 198 + 199 \cdot 98) = 78208
$$