This is the first problem of USAMTS $1998$ Round $1$
Several pairs of positive integers $(m ,n )$ satisfy the condition $19m + 90 + 8n = 1998$. Of these, $(100, 1 )$ is the pair with the smallest value for $n$. Find the pair with the smallest value for $m$.
Users on AOPS solved it with different approaches here. This is @RedFireTruck's answer:
$$(100-8\lfloor\frac{100}8\rfloor,1+19\lfloor\frac{100}8\rfloor)=(4,229)$$
I don't understand why this approach works. It seems they used the fact that $(100,1)$ is a pair with smallest $n$ then subtracted $8\lfloor\frac{100}8\rfloor$ from the first number and added $19\lfloor\frac{100}8\rfloor$ to second one to get the result. Can you please explain how it works?
Consider the Diophantine equation $ax+by=c$.
If $\gcd(a,b)=1$ and if one of the solution is $(x_0,y_0)$, then the general solution is given by $(x_0+bk,y_0-ak)$
Proof