3. In the coordinate plane $x O y$, an integer coordinate grid is drawn. The segment ( $p$ ) in this plane is defined by

$$
(p) \quad 7 x-3 y-5=0, \quad 0 \leq x \leq 100
$$

Determine the number of squares of this grid that contain points of the segment ( p).
Solution. First, let's determine the number of nodes through which the given segment passes. For this purpose, we need to find the integer solutions of the equation
$7 x-3 y-5=0$ under the condition $0 \leq x \leq 100$. All solutions of the given equation are given by

$$
x=5+3 t, y=10+7 t, t \in \mathbb{Z}
$$

For $0 \leq x \leq 100$ to hold, we need $-1 \leq t \leq 31$. Therefore, the segment $(p)$ passes through 33 nodes of the coordinate grid.

When viewed from left to right, at each intersection with a line of the coordinate grid, the segment (p) "enters" a new square. Only when it "passes through" a node does it intersect two lines, but "enters" only one new square. Therefore, the number of desired squares is equal to the number of intersections of the segment with the grid lines, minus the number of nodes it passes through, i.e., $100+234-33=301$.

![](https://cdn.mathpix.com/cropped/2024_06_05_c4dfe22659f2deeaf961g-05.jpg?height=528&width=391&top_left_y=356&top_left_x=1088)