Sam and Dan shares some money in the ratio 5:2. Dan received sh 30 less than Sam. How much money did Dan get?

D = S -30

5D = 2S

S = 5D/2

D = 5D/2 -30

2D = 5D -60
-3D = -60 D= 20 S = 50