5. Several people played a round-robin table tennis tournament. At the end of the tournament, it turned out that for any four participants, there would be two who scored the same number of points in the games between these four participants. What is the maximum number of tennis players that could have participated in this tournament? In table tennis, there are no ties; one point is awarded for a win, and zero points for a loss.

(from materials of international olympiads)
Answer: 7 tennis players.

Solution. Let $n \geqslant 8$ be the number of tennis players in the tournament. Then the total number of matches played is $\frac{1}{2} n(n-1)$, and thus the total number of victories is also $\frac{1}{2} n(n-1)$. Therefore, there must be a participant who has won at least $\frac{n-1}{2}$ matches. Hence, some participant must have won at least 4 matches.

Let's call this participant Andrei. Consider those he has defeated. Let these be Borya, Vasya, Grisha, and Dima. In the matches among them, 6 matches were played, so at least one of them must have won at least two matches.

Let's assume, for definiteness, that this is Borya, and he won against Vasya and Grisha. Then consider the quartet of players Andrei, Borya, Vasya, and Grisha. Andrei won all his matches among these four players, so he scored three points, Borya won exactly two matches, so he scored two points, the winner of the match between Vasya and Grisha scored one point, and the loser scored no points.

Therefore, they scored different numbers of points in their matches against each other, which means that such a quartet does not satisfy the condition of the problem. Hence, there are no more than seven players.

Let's provide an example of a tournament with seven participants. A victory is denoted by a plus, and a loss by a minus.

|  | + | + | + | - | - | - |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| - |  | + | - | + | + | - |
| - | - |  | + | + | - | + |
| - | + | - |  | - | + | + |
| + | - | - | + |  | + | - |
| + | - | + | - | - |  | + |
| + | + | - | - | + | - |  |