For the school birthday party, Ana, Pedro, Miriam, and Fábio brought a total of 90 sweets. Their teacher observed that

- if Ana had brought two more sweets;
- if Pedro had brought two fewer sweets;
- if Miriam had brought twice as many and
- if Fábio had brought half as many,

the four friends would have all brought the same number of sweets. How many sweets did each of the friends bring?
Representing the number of sweets each of the four friends brought by the initial of their name, we have

$$
\left\{\begin{array}{l}
A+P+M+F=90 \\
A+2=P-2=2 M=\frac{1}{2} F
\end{array}\right.
$$

It follows from the second equation that $P=A+4, M=\frac{1}{2}(A+2)$, and $F=2(A+2)$. Substituting these values into the first equation, we get

$$
90=A+(A+4)+\frac{1}{2}(A+2)+2(A+2)=\frac{1}{2} 9 A+9=9\left(\frac{1}{2} A+1\right)
$$

so that $\frac{1}{2} A+1=10$, or $A=18$. Thus,

$$
P=18+4=22, \quad M=\frac{18+2}{2}=10 \quad \text { and } \quad F=2(18+2)=40
$$