We are told that:
(swapped amount - 5.02) = 3 x original amount
If we call the original amount x.yy, and convert to pence to give 100x + y. The swapped amount is therefore 100y + x. Giving:
(100y + x) - 502 = 3 x (100x + y)
100y + x - 502 = 300x + 3y
97y - 502 = 299x
y = 299x + 502
This is an equation that can be solved in a number of ways, the easiest being trial and error.
Since both x and y have to be whole numbers, we quickly find that x=10 gives y=36. QED.