Tokarev S.I.

In a class of 30 students, each has the same number of friends among their classmates. What is the maximum possible number of students who study better than the majority of their friends? (For any two students in the class, it can be said who studies better; if $A$ studies better than $B$, and $B$ studies better than $C$, then $A$ studies better than $C$.)
Students who perform better than most of their friends are called good. Let $n$ be the number of good students, and $k$ be the number of friends each student has. We will prove that $n \leq 25$. For this, we will consider two cases.

1) $k \geq 8$. Then the five worst students in the class are not good.
2) $k \leq 7$. The best student in the class is the best in $k$ pairs of friends, and any other good student is the best in at least ${ }^{k+1 / 2}$ pairs. Therefore, good students are the best in at least $\left.k+(n-1)\right)^{k+1} / 2$ pairs. This number cannot exceed the number of all pairs of friends in the class, which is $15 k$. Hence, $2 k+(n-1)(k+1) \leq 30 k$, which means $n-1 \leq 28 \cdot k / k+1=28-28 / k+1 \leq 28-28 / 8=24.5$. Therefore, in this case, $n \leq 25$.

We will show that $n$ can equal 25. Number the students from 1 to 30 in the order of decreasing performance and arrange the numbers in a $6 \times 5$ table as shown in the figure.

| $c$ | 2 | 3 | 4 | 5 |
| :---: | :---: | :---: | :---: | :---: |
| 1 | 2 | 8 | 9 | 10 |
| 6 | 7 | 8 | 9 |  |
| 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 |

A pair of students is a pair of friends if their numbers are arranged in one of three ways: a) in adjacent rows and in different columns; b) in the same column and one of the numbers is in the bottom row; c) in the top row. In this case, as can be easily verified, all the required conditions are met.

## Answer

25 students.