Mikulás puts the candies into the stockings, 35 into each. In the end, 7 candies are left. How many would be left if he put only 15 into each package?
Solution. The question is what remainder $35 x + 7$ (where $x$ is the number of barrels used for the first time) can give when divided by 15. Since 30 is divisible by 15, $30 x$ is also divisible by it, so it is enough to examine what remainder $5 x + 7$ can give when divided by 15. Since $5 \cdot 3 = 15$, it is reasonable to distinguish three cases based on the remainder of $x$ when divided by 3.

I. Case: $x$ is divisible by 3. In this case, $5 x$ is divisible by $5 \cdot 3 = 15$, so the remainder of $5 x + 7$ when divided by 15 is 7.

II. Case: $x$ gives a remainder of 1 when divided by 3: $x = 3 m + 1$. Then

$$
5 x = 5(3 m + 1) = 15 m + 5
$$

so the remainder of $5 x + 7$ when divided by 15 is $5 + 7 = 12$.

III. Case: $x$ gives a remainder of 2 when divided by 3: $x = 3 m + 2$. Then the remainder of $5 x$ when divided by 15 is $5 \cdot 2 = 10$, and thus the remainder of $5 x + 7$ is $10 + 7 - 15 = 2$.

If Santa Claus only put 15 candies in a barrel, then 2, 7, or 12 candies would remain.

Note. The wording of the problem was not entirely precise, leading to some misinterpretations: some thought that the same number of barrels must be used in both the 35-grouping and the 15-grouping, resulting in the (trivial) expression $20 a + 7$ (which earned 0 points). Many of the good solvers also noted the ambiguity, and some solved the problem in both variations.

![](https://cdn.mathpix.com/cropped/2024_05_02_0dc7a0ed8a4b43a5a7bag-1.jpg?height=236&width=415&top_left_y=869&top_left_x=844)