Šárka and Terezka received a box of chocolates, containing 35 chocolate candies. Each day, each of the girls ate at least one candy, and no candy was divided into parts. On the first day, Terezka ate $\frac{2}{5}$ of what Šárka ate on the same day. On the second day, Šárka ate $\frac{3}{4}$ of what Terezka ate on the same day. By the end of the second day, the box was empty.

How many candies did Terezka eat in total, given that the difference between the number of candies eaten by Terezka and the number of candies eaten by Šárka was the smallest possible?

(L. Hozová)
On the first day, Terezka ate $\frac{2}{5}$ of what Sárka ate. The number of candies Sárka ate that day must therefore be divisible by 5. On the second day, Sárka ate $\frac{3}{4}$ of what Terezka ate. The number of candies Terezka ate that day must therefore be divisible by 4. The number of candies eaten by the girls on each day is given in the following table, where $x$ and $y$ denote unknown natural numbers:

|  | 1st day | 2nd day |
| :---: | :---: | :---: |
| Sárka | $5 x$ | $3 y$ |
| Terezka | $2 x$ | $4 y$ |

In total, 35 candies were eaten over the two days, so

$$
7 x+7 y=35 \text { or } \quad x+y=5 \text {. }
$$

The difference between the number of candies eaten by Terezka and the number of candies eaten by Sárka is

$$
(2 x+4 y)-(5 x+3 y)=y-3 x .
$$

If we express $y=5-x$ from (1) and substitute it into (2), we get the difference $5-4 x$. This difference is the smallest possible when $x=1$. From this, it follows that $y=4$ and that Terezka ate a total of $2 \cdot 1+4 \cdot 4=18$ candies.

Note. The pairs of natural numbers $(x, y)$ that satisfy equation (1) are four:

$$
(1,4), \quad(2,3), \quad(3,2), \quad(4,1) .
$$

By substituting each of these pairs into the initial table, we get specific values, from which we can choose the one with the smallest difference between the number of candies eaten by Terezka and Sárka. This solution corresponds to the first pair mentioned:

|  | 1st day | 2nd day | total |
| :---: | :---: | :---: | :---: |
| Sárka | 5 | 12 | 17 |
| Terezka | 2 | 16 | 18 |

Alternative solution. Since the total number of candies was 35, which is an odd number, the smallest possible difference between the candies eaten by Sárka and Terezka could be 1. In such a case, either Sárka ate 18 candies and Terezka 17, or vice versa. Using the same notation as at the beginning of the previous solution, the first possibility would lead to the system of equations

$$
\begin{aligned}
& 5 x+3 y=18 \\
& 2 x+4 y=17
\end{aligned}
$$

After simplification, we get the solution $x=\frac{3}{2}$ and $y=\frac{7}{2}$, which is not valid because it is not an integer solution. The second mentioned possibility would lead to the system of equations

$$
\begin{aligned}
& 5 x+3 y=17 \\
& 2 x+4 y=18,
\end{aligned}
$$

which, after simplification, gives the solution $x=1$ and $y=4$. Terezka ate a total of 18 candies.

Evaluation. 2 points for the relationships between the candies eaten on each day (e.g., as in the initial table); 2 points for setting up the equations; 2 points for solving and the quality of the commentary.