22) Gabriele has ten cubes, of three sizes: some have a side of $3 \mathrm{~cm}$, others have a side of $4 \mathrm{~cm}$, and still others have a side of $5 \mathrm{~cm}$ (he has at least one of each type). The sum of the volumes of the ten cubes is $577 \mathrm{~cm}^{3}$. How many cubes have a side of $3 \mathrm{~cm}$?
(A) 2,
(B) 3
(C) 4,
(D) 5, (E) 6.
22. The answer is $(\mathbf{D})$.

Let $A, B$, and $C$ be the number of cubes with side lengths of $3 \mathrm{~cm}, 4 \mathrm{~cm}$, and $5 \mathrm{~cm}$, respectively. $A, B$, and $C$ are strictly positive integers that satisfy two relations:

$$
A+B+C=10, \quad 27 A+64 B+125 C=577 .
$$

The second equation is obtained by requiring that the sum of the volumes of the cubes be $577 \mathrm{~cm}^{3}$. From the first equation, we get $A=10-(B+C)$, and substituting this equality into the second equation yields:

$$
270-27 B-27 C+64 B+125 C=577 \Rightarrow 37 B+98 C=307 .
$$

From the last equality, it follows that $C$ cannot be greater than 2. Indeed, if $C \geq 3$, $B$ would have to be strictly less than 1, which is impossible. Therefore, the possible values of $C$ are 1 and 2. For $C=1$, we have $B=\frac{209}{37}$, which is not an integer, so the value $C=1$ is not acceptable. For $C=2$, we have $B=\frac{111}{37}=3$. Thus, it must necessarily be $C=2$, $B=3$, and consequently $A=5$.

[Problem proposed by R. Morandin.]