5. 109 apples are distributed into bags. In some bags, there are $x$ apples, and in others, there are 3 apples. Find all possible values of $x$ if the total number of bags is 20 (there should be no empty bags).
Solution. If there were 3 apples in each package, there would be a total of 60 apples, but in fact, there were 49 more apples. This means that the "extra" apples need to be evenly distributed among some of the packages. Since $49=7 \cdot 7=49 \cdot 1$ and there are 20 packages in total, either 7 packages contain 7 "extra" apples each, or one package contains 49 "extra" apples. In the first case, $x=10$, in the second case, $x=52$.

Answer: 10 or 52.