equations:
1x + 5y = 300
x + y = 124
solve:
1x + 5y = 300
subtract 1x
5y = -1x + 300
divide the right side by 5
y = -1/5x + 60
solve:
x + y = 124
subtract x
y = -x + 124
so:
-x +124 = -1/5x + 60
add 1/5x to both sides to cancel it out on the right side
-4/5x + 124 = 60
subtract 124 from both sides to cancel it out on the left side
-4/5x = -64
divide -4/5 by -64
x = 80
then:
substitute 80 for x in one of the equations to get y = 44
in conclusion:
there were 80 $1 bills and 44 $5 bills