Given an integer $n$ and relatively prime positive integers $a$ and $b$, show that exactly one of $n$ and $ab-a-b-n$ is expressible in the form $ax+by$ for some non-negative integers $x$ and $y$. Also show that $ab-a-b$ is the largest integer that cannot be expressed in such a form.
I tried this approach for the second problem.
$$ab -a -b = a \cdot (b-1) + b \cdot -1$$
We find that it can be expressed in the form $ax_0 + by_0$ but $y_0$ is negative so this isn't true. Now they can also be expressed in the form
$$ab -a -b = a \cdot (b-1) + b \cdot -1 + ab - ab = a\cdot -1 + b \cdot (-1 + a)$$
So in any case, one of $x_0$ or $y_0$ remains negative and hence it cannot be expressed in such a form.
Now I feel that I can use the proof of the second problem to prove the first problem.
You see, if $n = ax_0 + by_0$ then if $ab - a -b-n$ can be expressed in such a form then $ab-a-b$ can also be. But we have now proved that $ab-a-b$ cannot be expressed thus $ab -a -b-n$ can not be expressed in such a form. This is the proof if $n = ax_0 + by_0$. What if $n \neq ax_0 + by_0$?
How do I proceed with this proof? Is my proof of the second problem correct?