Peter had $985 and Simon had $505. After they shared the cost of a gift for a friend equally, Simon had half the amount of money Peter had. How much did each of them pay for the gift?

amount of share for each ---- x

Peter is left with 985-x
Simon is left with 505-x

505-x = (1/2)(985-x)
1010 - 2x = 985 - x
-x = -25
x = 25

So each of them paid $25