Assume there are one hundred pence in the pound (£). Using just 5p (£0.05) and 10p (£0.10) pieces, how many of each do you need in order to pay a parking meter charge of £3.10.
We encode the problem as followed with $f$ being the number of 5p coins and $t$ the 10p coins
$$ 5f + 10t = 310 $$
The $gcd(5,10)=5$ divides 310, so the equation has integer solutions.
In fact, by inspection we can see 310 is a multiple of 10, so 31 10p coins is a solution.
Let's find other solutions. We already have one solution $f_0 = 0, t_0 = 31$. The general solution is
$$ f = 0 + \frac{10}{5}n = 2n, \quad t = 31 - \frac{5}{5}n = 31-n$$
for any integer $n$.
So need $f$ and $t$ to be non-negative, which gives us the following inequalities
$$ 2n \ge 0 $$
$$ 31 - n \ge 0$$
That is
$$ 0 \leq n \leq 31 $$
This creates 32 different solutions.
| n | f=2n | t=31-n | 5f+10t |
| 0 | 0 | 31 | 310 |
| 1 | 2 | 30 | 310 |
| 2 | 4 | 29 | 310 |
| 3 | 6 | 28 | 310 |
| 4 | 8 | 27 | 310 |
| 5 | 10 | 26 | 310 |
| 6 | 12 | 25 | 310 |
| 7 | 14 | 24 | 310 |
| 8 | 16 | 23 | 310 |
| 9 | 18 | 22 | 310 |
| 10 | 20 | 21 | 310 |
| 11 | 22 | 20 | 310 |
| 12 | 24 | 19 | 310 |
| 13 | 26 | 18 | 310 |
| 14 | 28 | 17 | 310 |
| 15 | 30 | 16 | 310 |
| 16 | 32 | 15 | 310 |
| 17 | 34 | 14 | 310 |
| 18 | 36 | 13 | 310 |
| 19 | 38 | 12 | 310 |
| 20 | 40 | 11 | 310 |
| 21 | 42 | 10 | 310 |
| 22 | 44 | 9 | 310 |
| 23 | 46 | 8 | 310 |
| 24 | 48 | 7 | 310 |
| 25 | 50 | 6 | 310 |
| 26 | 52 | 5 | 310 |
| 27 | 54 | 4 | 310 |
| 28 | 56 | 3 | 310 |
| 29 | 58 | 2 | 310 |
| 30 | 60 | 1 | 310 |
| 31 | 62 | 0 | 310 |