Points $P(r, s)$ and $Q(t, u)$ are on the parabola with equation $y=x^{2}-\frac{1}{5} m x+\frac{1}{5} n$ so that $P Q=13$ and the slope of $P Q$ is $\frac{12}{5}$. For how many pairs $(m, n)$ of positive integers with $n \leq 1000$ is $r+s+t+u=27$ ?
(A) 28
(B) 26
(C) 27
(D) 29
(E) 25
We first examine the conditions on the length and slope of $P Q$, then simplify the condition that $r+s+t+u=27$, then finally incorporate the fact that points $P$ and $Q$ lie on the given parabola.

Since the slope of $P Q$ is positive, then one of the points is "up and to the right" from the other. Without loss of generality, we assume that $Q$ is "up and to the right" from $P$.

Thus, $u>s$ and $t>r$.

Since the slope of $P Q$ equals $\frac{12}{5}$, then $\frac{u-s}{t-r}=\frac{12}{5}$, which means that $u-s=12 k$ and $t-r=5 k$ for some real number $k>0$.

Since $P Q=13$, then $(u-s)^{2}+(t-r)^{2}=13^{2}$ or $(12 k)^{2}+(5 k)^{2}=169$.

Thus, $144 k^{2}+25 k^{2}=169$ and so $169 k^{2}=169$ or $k^{2}=1$, which gives $k=1($ since $k>0)$.

Thus, $u-s=12$ (or $u=s+12$ ) and $t-r=5$ (or $t=r+5$ ).

Thus, $P$ has coordinates $(r, s)$ and $Q$ has coordinates $(r+5, s+12)$.

(This eliminates two of the variables from the problem.)

We eventually need to use the condition that $r+s+t+u=27$.

Since $t=r+5$ and $u=s+12$, this is equivalent to $r+s+r+5+s+12=27$ or $2 r+2 s=10$, which is equivalent to $r+s=5$.

We will use this simplified condition shortly.

Since both $P(r, s)$ and $Q(r+5, s+12)$ are on the parabola with equation $y=x^{2}-\frac{1}{5} m x+\frac{1}{5} n$, we obtain the following two equations:

$$
\begin{aligned}
s & =r^{2}-\frac{1}{5} m r+\frac{1}{5} n \\
s+12 & =(r+5)^{2}-\frac{1}{5} m(r+5)+\frac{1}{5} n
\end{aligned}
$$

Here, $m$ and $n$ are treated as known constants and $r$ and $s$ are variables for which we solve. We want to determine the number of pairs $(m, n)$ of positive integers with $n \leq 1000$ for which a solution $(r, s)$ to this equation satisfies $r+s=5$.

We solve this system of equations for $r$ and $s$.

Expanding the second equation, we obtain

$$
s+12=r^{2}+10 r+25-\frac{1}{5} m r-m+\frac{1}{5} n
$$

Subtracting the first equation, we obtain $12=10 r+25-m$ and so $r=\frac{1}{10}(m-13)$. Substituting into the first equation, we obtain

$$
\begin{aligned}
s & =\left(\frac{1}{10}(m-13)\right)^{2}-\frac{1}{5} m\left(\frac{1}{10}(m-13)\right)+\frac{1}{5} n \\
& =\frac{1}{100}\left(m^{2}-26 m+169\right)-\frac{1}{50}\left(m^{2}-13 m\right)+\frac{1}{5} n \\
& =\frac{1}{100}\left(m^{2}-26 m+169-2\left(m^{2}-13 m\right)+20 n\right) \\
& =\frac{1}{100}\left(-m^{2}+169+20 n\right)
\end{aligned}
$$

Note that each pair $(m, n)$ gives a unique solution $(r, s)$.

We now need to determine the number of pairs $(m, n)$ of positive integers with $n \leq 1000$ that produce $r=\frac{1}{10}(m-13)$ and $s=\frac{1}{100}\left(-m^{2}+169+20 n\right)$ satisfying the equation $r+s=5$.

Substituting, we obtain

$$
\begin{aligned}
r+s & =5 \\
\frac{1}{10}(m-13)+\frac{1}{100}\left(-m^{2}+169+20 n\right) & =5 \\
10 m-130-m^{2}+169+20 n & =500 \\
20 n & =m^{2}-10 m+461 \\
20 n & =(m-5)^{2}+436 \quad \text { (completing the square) }
\end{aligned}
$$

So we are left to determine the number of pairs $(m, n)$ of positive integers with $n \leq 1000$ that satisfy the equation $20 n=(m-5)^{2}+436$.

Since $20 n$ and 436 are both even integers, then $(m-5)^{2}$ is an even integer, which means that $m-5$ is an even integer and thus $m$ is odd. (If $m-5$ were odd, then $(m-5)^{2}$ would also be odd.)

Therefore, we let $m=2 M-1$ for some positive integer $M$.

Substituting, we obtain $20 n=(2 M-6)^{2}+436$ or $20 n=4(M-3)^{2}+436$, which is equivalent to $5 n=(M-3)^{2}+109$.

Therefore, we need to determine the number of pairs $(M, n)$ of positive integers with $n \leq 1000$ that satisfy the equation $5 n=(M-3)^{2}+109$.

This is the same as determining the number of positive integer values of $M$ for which the right side is a multiple of 5 that is at most 5000 , because each such value of $M$ will give a corresponding positive integer value for $n$ that is at most 1000 .

When $M=1$, the right side equals 113 , which is not a multiple of 5 .

When $M=2$, the right side equals 110 , which is a multiple of 5 . (This gives $n=22$.)

When $M \geq 3$, we consider the units (ones) digits of $M-3,(M-3)^{2}$ and $(M-3)^{2}+109$ :

| $M-3$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $(M-3)^{2}$ | 0 | 1 | 4 | 9 | 6 | 5 | 6 | 9 | 4 | 1 |
| $(M-3)^{2}+109$ | 9 | 0 | 3 | 8 | 5 | 4 | 5 | 8 | 3 | 0 |

Therefore, any positive integer $M$ for which $M-3$ ends in a 1, 4, 6 , or 9 produces a right side divisible by 5 . This is because in each of these cases the expression $(M-3)^{2}+109$ has a units digit of 0 or 5 and hence is divisible by 5 .

For $(M-3)^{2}+109 \leq 5000$, we need $(M-3)^{2} \leq 4891$.

Since $\sqrt{4891} \approx 69.94$ and $M-3$ is a positive integer, then $M-3 \leq 69$.

Therefore, the values of $M$ with the desired property are $M=2$ and every positive integer $M$ with $0 \leq M-3 \leq 69$ for which $M-3$ has a units digit of $1,4,6$, or 9 .

There are 28 positive integers $M$ in the second list (four each with $M-3$ between 0 and 9,10 and 19, 20 and 29, 30 and 39,40 and 49, 50 and 59, and 60 and 69). Thus, there are 29 such integers $M$ overall.

Finally, this means that there are 29 pairs $(m, n)$ which have the desired property.

ANSWER: (D)