For this question here are the formulas,
Let T be the number of 10's
Let F be the number 5's
Let us find the 10's first by this formula.
5(124 - T) + 10T = 840
620-5T + 10T = 840
then
5T = 220
5 5
T=44
Now let's find the F using this formula.
5F + 10T = 840
Sustitute T
5F + 10(44) = 840
5F = 400
5 5
F = 80
to Check
F + T = 124
80 + 44 = 124