
Problem 8.1. The graph of a linear function is parallel to the graph of $y=\frac{5}{4} x+\frac{95}{4}$, passing through $M(-1 ;-25)$, and intersects the coordinate axes $O x$ and $O y$ in $A$ and $B$ correspondingly.

(a) Find the coordinates of $A$ and $B$.

(b) Consider the unity grid in the plane. Find the number of squares containing points of $A B$ (in their interiors).


Solution: (a) The graph of a linear function is parallel to the graph of $y=\frac{5}{4} x+\frac{95}{4}$ when the linear function is of the form $y=$ $\frac{5}{4} x+b$. From the condition that $M$ belongs to its graph we determine $-25=-\frac{5}{4}+b$, whence $b=-\frac{95}{4}$. The coordiantes of $A$ and $B$ are respectively the solutions of the systems

$$
\left\lvert\, \begin{array}{l|l}
y=\frac{5}{4} x-\frac{95}{4} \quad \text { and } \quad \left\lvert\, \begin{array}{l}
y=\frac{5}{4} x-\frac{95}{4} \\
y=0
\end{array}\right. \\
x=0
\end{array}\right.
$$

whence we get $A(19 ; 0)$ and $B\left(0 ;-\frac{95}{4}\right)$.

(b) The coordinates of the points on $A B$ satisfy the conditions

$$
\left\lvert\, \begin{aligned}
& y=\frac{5}{4} x-\frac{95}{4} \\
& 0 \leq x \leq 19
\end{aligned}\right.
$$

Find the number of points with integer coordinates lying on the segment $A B$, i.e., the number of integer solutions of (1). It follows from $y=\frac{5}{4} x-\frac{95}{4}$ that $y=x-23+\frac{x-3}{4}$ and if $x$ and $y$ are integer, then $\frac{x-3}{4}=t$ is integer. Conversely, if $t$ is integer, then $x=4 t+3$ and $y=5 t-20$ are integer. Since $0 \leq x \leq 19$, we find $0 \leq 4 t+3 \leq 19$, i. e., $-\frac{3}{4} \leq t \leq 4$. This observation implies that the points with integer coordinates lying on $A B$ satisfy the conditions $x=4 t+3, y=5 t-20$ for $t=0,1,2,3,4$. Therefore there are 5 such points.

Further: the segment $A B$ exits a square and enters another one only when it intersects a line of the grid. The number of such intersections is $23+18=41$. But when $A B$ passes through a knot (i. e., through a point with integer coordinates), the passage from a square to another one involves crossing two lines. This happens 4 times (not counting $A$ ). Therefore the required number is $41-4+1=38$.
