Tokarev S.i.

The participants of the test olympiad were offered $n$ questions. The jury determines the difficulty of each question: a positive integer number of points awarded to participants for a correct answer to the question. For an incorrect answer, 0 points are awarded, and all points earned by a participant are summed. When all participants had submitted their answer sheets, it turned out that the jury could determine the difficulty of the questions in such a way that the places among the participants could be distributed in any predetermined manner. For what maximum number of participants could this have been

#
Let's prove that such a distribution of points can exist with $n$ participants. The example is obvious - let the $k$-th participant answer only the $k$-th question. Then, by assigning the cost of questions $a_{1}, a_{2}, \ldots, a_{n}$, where $\left\{a_{1}, a_{2}, \ldots, a_{n}\right\} = \{1,2, \ldots, n\}$, the jury will place the $k$-th participant in position $n+1-a_{k}$.

Suppose there are $n+1$ participants. Imagine that we have cloned each participant, so we have an unlimited number of participants of each of the $n+1$ types (all participants within a type answer questions in the same way). We will prove that it is possible to form two teams from them, different in composition (at least for one type, the number of participants of this type in the first team is not equal to the number of participants of this type in the second team), but having the same results (that is, on each question, the same number of people in the first team answered as in the second team).

Indeed, let's write a system of linear equations, where the $i$-th equation states that the difference in the number of participants in the first and second teams who answered the $i$-th question is zero; here $x_{j}$ is the number of participants of the $j$-th type (in the first team if $x_{j}$ turns out to be positive, in the second if negative). The coefficients - zeros and ones - are determined by whether a participant of the $j$-th type answered the $i$-th question. This is a system of $n$ homogeneous equations with $n+1$ unknowns. As is known, it has a non-zero solution, and since all coefficients are rational, there exists a rational non-zero solution. Since the equations are homogeneous, the solution can be multiplied by a constant. Multiply so that all $x_{j}$ values become integers. The required teams are found. In this case, participants of each type are present in no more than one team.

Suppose there are no fewer participants in the first team than in the second. Then it is impossible to assign points to questions in such a way that the positions of all participants in the first team are higher than the positions of participants in the second team, because the sum of the points of the participants in the first team is always equal to the sum of the points of the participants in the second team.

## Answer

With $n$ participants.