10.3. Vasya has $n$ candies of several types, where $n \geqslant 145$. It is known that if any group of at least 145 candies is chosen from these $n$ candies (in particular, the group can consist of all $n$ candies), then there exists a type of candy such that the chosen group contains exactly 10 candies of this type. Find the largest possible value of $n$.

(A. Antropov)
Answer: 160.

Solution: Estimation. We will prove that $n>160$ "does not work". Let us have a set of $n$ candies. We will call a flavor critical if there are exactly 10 candies of this flavor (among all the given $n$ candies). Let us have $k$ critical flavors, then the total number of candies is not less than $10k: n \geqslant 10k$. Remove one candy of each critical flavor and organize a group from the remaining $n-k$ candies. For this group, there is no flavor represented by exactly 10 candies. Moreover, $n-k \geqslant n-\frac{n}{10}=\frac{9 n}{10}>\frac{9 \cdot 160}{10}=144$. Thus, the considered group contains at least 145 candies, so the condition of the problem is not satisfied.

Example. Now let us provide an example of a situation where Vasya can have 160 candies. Suppose he has exactly 10 candies of each of 16 flavors. Let a group be chosen for which there is no flavor represented by exactly 10 candies. Then this group does not include at least one candy of each flavor (in other words, no flavor is taken completely), i.e., the group contains no more than $16 \cdot 9=144$ candies, so the condition of the problem is satisfied.

Remark 1. The estimate $n \leqslant 160$ can also be proven in a slightly different way. Suppose that some $n=145+m$ "works", i.e., there exists a set $K_{0}$ of $n$ candies that satisfies the condition of the problem. Then in the set $K_{0}$ there are exactly 10 candies of some flavor $A_{0}$. Remove the candy $a_{0}$ of flavor $A_{0}$ and consider the group $K_{1}$ of the remaining $n-1$ candies. In the group $K_{1}$ there are exactly 10 candies of some flavor $A_{1}$, which is different from $A_{0}$, since $K_{1}$ has exactly 9 candies of flavor $A_{0}$. Remove from $K_{1}$ the candy $a_{1}$ of flavor $A_{1}$ and consider the group $K_{2}$ of the remaining $n-2$ candies, in which we will find 10 candies of a new flavor $A_{3}$, and so on, continue to remove one candy at a time and consider the groups of remaining candies. Thus, we will reach the group $K_{m}$, consisting of $\left|K_{m}\right|=145$ candies. According to our algorithm, $K_{0}$ contains 10 candies of flavors $A_{0}, \ldots, A_{m}$, so $\left|K_{0}\right| \geqslant 10(m+1)$. We have $145+m \geqslant 10(m+1)$, from which $m \leqslant 15$ and $n \leqslant 160$.

Remark 2. The example for $n=160$ is unique.

Comment. Points for the estimate and example are summed. There is only a correct answer without justifications - 0 points.

There is a correct example for $n=160$ and justification that the condition of the problem is satisfied for this example - 3 points (in the case where a correct example is provided but the justification is missing, 1 point is deducted, i.e., 2 points are given instead of 3).

There is a correct and complete proof of the estimate $n \leqslant 160-$ 4 points (if there are gaps in the proof of the estimate, points may be reduced to 3 or 2 points).