## Task 4 - 330624

In a box, there are balls; each of them has one of the colors blue, yellow, red. There are at least 3 but at most 7 balls of each color. The total number of balls in the box is a prime number.

The number of red balls is divisible by the number of yellow balls. If one yellow and two red balls are taken out, the total number of balls in the box is divisible by 5, and the number of red balls in the box is again divisible by the number of yellow balls in the box.

How many balls were there initially of each color in the box?
For the quantities $b, g, r$ of blue, yellow, and red balls, respectively, it holds that $9 \leq b+g+r \leq 21$, since each of the three numbers $b, g, r$ is at least 3 and at most 7. Since $b+g+r$ is a prime number, it can only be one of the numbers 11, 13, 17, 19.

After removing one yellow and two red balls, the remaining total is one of the numbers 8, 10, 14, 16. Of these, only 10 is divisible by 5; thus, $b+g+r$ must have been 13.

All possible ways to decompose 13 into three summands, each at least 3 and at most 7, are

$$
\begin{array}{lllll}
3+3+7, & 4+3+6, & 5+3+5, & 6+3+4, & 7+3+3 \\
3+4+6, & 4+4+5, & 5+4+4, & 6+4+3 & \\
3+5+5, & 4+5+4, & 5+5+3 & & \\
3+6+4, & 4+6+3 & & \\
3+7+3 & & &
\end{array}
$$

Only in the blue decompositions is the third summand divisible by the second. If one decreases the second summand by 1 and the third by 2 in these decompositions, the result is

$$
3+4+3, \quad 4+2+4, \quad 5+3+2, \quad 7+2+1
$$

Only in the blue-marked decomposition (resulting from the decomposition $4+3+6$) is the third summand divisible by the second.

Thus, there were initially 4 blue, 3 yellow, and 6 red balls in the box.

Solutions of the II. Round 1993 adopted from [5]

### 3.34.3 III. Round 1993, Class 6