Problem 9.7. In front of a sweet-tooth lie five boxes of candies: the first box contains 11 candies, the second - 22 candies, the third - 33 candies, the fourth - 44 candies, the fifth - 55 candies. In one move, the sweet-tooth can take four candies from one box and distribute them, one candy to each of the remaining four boxes.

At any point, the sweet-tooth can take the candies from any box and leave. What is the maximum number of candies he can take?
Answer: 159.

Solution. Consider the number of candies in the boxes. Initially, these are 5 natural numbers that give different remainders when divided by 5. We will prove that as long as the sweet-tooth does not take candies from any box, these 5 numbers will always give different remainders when divided by 5. For this, it is sufficient to understand that the difference between any two of these 5 numbers is never divisible by 5.

Suppose at some point, there were $x$ and $y$ candies in two of the boxes, and the difference $x - y$ is not divisible by 5. After the sweet-tooth rearranges the candies, this difference will take one of the following values:

$$
(x+1)-(y+1)=x-y, \quad(x-4)-(y+1)=x-y-5, \quad(x+1)-(y-4)=x-y+5
$$

Clearly, none of these values are divisible by 5.

Suppose the sweet-tooth at some point takes all the candies from one of the boxes. Let's look at the remaining four boxes: the total number of candies in them is no less than the sum of the remainders when the corresponding numbers are divided by 5. Thus, there are at least $0+1+2+3=6$ candies left in them. Accordingly, the sweet-tooth has taken no more than $11+22+33+44+55-6=159$ candies.

Now let's provide an example of how the sweet-tooth can take exactly 159 candies. Suppose he moves 4 candies from the first four boxes to the fifth box, as long as possible (i.e., as long as there are at least 4 candies in one of these boxes). This process will eventually end, since with each such move, the total number of candies in the first four boxes decreases by exactly 1 (the number of candies in one box decreases by 4, and in the other three, it increases by 1).

At the moment when this process ends, there will be from 0 to 3 candies in each of the first four boxes. But we have proven earlier that the number of candies in these four boxes must give different remainders when divided by 5. Therefore, in one box there are 0 candies, in another 1, in the third 2, and in the fourth 3 candies. This means that the remaining 159 candies are in the fifth box, which the sweet-tooth will take.