Problem 3. Ivan and Maria went on a trip. Ivan brought candies, and Maria brought plums. Ivan gave half of her candies to Maria, and Maria gave half of her plums to Ivan. Then, Ivan ate 5 plums, after which she had three times as many candies as plums left, and Maria ate 20 candies, after which she had twice as few plums as candies left. How many candies did Ivan bring and how many plums did Maria bring on the trip?
Solution. Let $b$ be the number of candies Ivan has, and $s$ be the number of plums Maria has. After Ivan gives half of her candies to Maria, and Maria gives half of her plums to Ivan, each of them has $\frac{b}{2}$ candies and $\frac{s}{2}$ plums. From the fact that when Ivan takes 5 plums, she is left with three times as many candies as plums, we get $\frac{b}{2}=3\left(\frac{s}{2}-5\right)$. From the fact that when Maria takes 20 candies, she is left with twice as few plums as candies, we get $\frac{b}{2}-20=2 \cdot \frac{s}{2}$, i.e., $\frac{b}{2}=20+s$. According to this, $20+s=3\left(\frac{s}{2}-5\right)$, from which we find $s=70$. Finally, $\frac{b}{2}=20+70$, i.e., $b=180$. Therefore, Ivan brought 180 candies, and Maria brought 70 plums on the trip.