30000 = 500.t + 100.r,
or dividing through by 100:
300 = 5.t + r.
But the total number of adds is to be 220, so:
220 = t + r.
So you now have a pair of simultaneous linear equations to solve.
Subtract the second from the first to get:
300 - 220 = (5.t + r) - (t + r),
80 = 4.t,
or t=20, so r=200.