Assume there are one hundred pence in the pound (£). First-class stamps cost 60p (£0.60) and second-class stamps cost 50p (£0.50) each.
What combination(s) of stamps can you get for exactly £50, leaving no change?
We encode the problem as follows, with $x$ as the number of first class stamps, and $y$ second class stamps.
$$ 60x + 50y = 5000 $$
The $\gcd(60,50)=10$ divides 5000, which tells us the equation has integer solutions.
By inspection, a solution is $x_0=0, y_0=100$. A general solution is
$$ x = 5t, \quad y = 100 - 6t $$
for any integer $t$.
However, we require $x$ and $y$ to be non-negative, so
$$ 5t \geq 0 $$
$$ 100 - 6t \geq 0$$
That is
$$ 0 \leq t \leq \frac{50}{3}t $$
Non-negative integer values for $x$ and $y$ are generated by $t$ ranging from 0 to 16.
| t | x=5t | y=100-6t | 60x+50y |
| 0 | 0 | 100 | 5000 |
| 1 | 5 | 94 | 5000 |
| 2 | 10 | 88 | 5000 |
| 3 | 15 | 82 | 5000 |
| 4 | 20 | 76 | 5000 |
| 5 | 25 | 70 | 5000 |
| 6 | 30 | 64 | 5000 |
| 7 | 35 | 58 | 5000 |
| 8 | 40 | 52 | 5000 |
| 9 | 45 | 46 | 5000 |
| 10 | 50 | 40 | 5000 |
| 11 | 55 | 34 | 5000 |
| 12 | 60 | 28 | 5000 |
| 13 | 65 | 22 | 5000 |
| 14 | 70 | 16 | 5000 |
| 15 | 75 | 10 | 5000 |
| 16 | 80 | 4 | 5000 |