H1. The positive integers $m$ and $n$ satisfy the equation $20 m+18 n=2018$. How many possible values of $m$ are there?
Solution 1
Let $M$ and $N$ be a solution to the given equation, so $20 M+18 N=2018$. For any integer $k$, the pair $m=(M-9 k)$ and $n=(N+10 k)$ is also a solution, since
$$
20(M-9 k)+18(N+10 k)=20 M-180 k+18 N+180 k=2018 .
$$

It is easy to verify (and not too difficult to spot) that $m=100, n=1$ is a solution. This quickly leads us to the following twelve solutions, which are all of the form $m=100-9 k, n=1+10 k$ for $k=0,1,2, \ldots, 11$ :
We will now show that any solution to the given equation must be of the form $m=100-9 k, n=1+10 k$.
Let $(M, N)$ be a pair of integers for which $20 M+18 N=2018$.
Since $20 \times 100+18 \times 1=2018$, we can subtract to give
$$
20(100-M)+18(1-N)=0 \text {. }
$$

Then
$$
10(100-M)=9(N-1) .
$$

Since 10 and 9 have no common factor greater than $1,(100-M)$ must be a multiple of 9 , so we can write $100-M=9 k$ for some integer $k$. This leads to $M=100-9 k$.
Then we have, from $(*), 90 k=9(N-1)$, which leads to $N=1+10 k$.
So we have now shown that any pair of integers $(M, N)$ which are a solution to the equation must be of the form $(100-9 k, 1+10 k)$ for some integer $k$.
For $100-9 k$ to be positive we need $k \leqslant 11$ and for $1+10 k$ to be positive we need $k \geqslant 0$, so the twelve solutions listed above are the only twelve.

Solution 2
If $20 m+18 n=2018$ then
$$
\begin{aligned}
10 m+9 n & =1009 \\
10 m & =1009-9 n \\
10 m & =1010-(9 n+1) \\
m & =101-\frac{9 n+1}{10} .
\end{aligned}
$$

Since $m$ is an integer, $9 n+1$ must be a multiple of 10 , which means that $9 n$ must be one less than a multiple of 10 . For this to be true, the final digit of $9 n$ must be 9 , which happens exactly when the final digit of $n$ is 1 .
Every value of $n$ with final digit 1 will produce a corresponding value of $m$. No other value of $n$ is possible (and hence no other possible values of $m$ possible either).
So now we just need to count the number of positive values of $n$ with final digit 1 which also give a positive value of $m$.
Since $m$ is positive, $\frac{9 n+1}{10}$ can be at most 100 , with equality when $n=111$.
Hence $0<n \leqslant 111$. There are 12 values of $n$ in this range which have final digit 1 , and so there are 12 possible values of $m$.
[Note that we have not found any of the solutions to the given equation; we did not need to do this in order to answer the question.]