62 (985). In a chess tournament, more than 9 but fewer than 25 grandmasters and masters participated. At the end of the tournament, it turned out that each participant scored half of their points against grandmasters. How many people participated in the tournament? How many of them were masters?
Solution. Let $n$ be the number of chess players in the tournament, of which $m$ are grandmasters, and thus $n-m$ are masters. Therefore, all participants played $\frac{n(n-1)}{2}$ games and scored $\frac{n(n-1)}{2}$ points (both games and points). Among them, the grandmasters played $\frac{m(m-1)}{2}$ games (and scored the same number of points) against each other, while the masters played $\frac{(n-m)(n-m-1)}{2}$ games and scored $\frac{(n-m)(n-m-1)}{2}$ points among themselves.

Since each participant scored half of their points against the grandmasters, the grandmasters also scored half of their points against each other, meaning the grandmasters scored a total of $m(m-1)$ points.

Since the masters scored half of their points against the grandmasters, they also scored half of their points against each other, meaning they scored a total of $2 \cdot \frac{(n-m)(n-m-1)}{2} = (n-m)(n-m-1)$ points. The total number of points scored by all participants is $m(m-1) + (n-m)(n-m-1)$, or $\frac{n(n-1)}{2}$. We have the equation

$$
m(m-1) + (n-m)(n-m-1) = \frac{n(n-1)}{2}
$$

After simplification, we get:

$$
n^{2} - 4 n m + 4 m^{2} = n
$$

which simplifies to $(n-2 m)^{2} = n$, meaning $n$ is a perfect square. Since $9 < n < 25$, we have $n = 16$. Solving the equation $(16-2 m)^{2} = 16$, we get $m_{1} = 6, m_{2} = 10$. Therefore, 16 people participated in the tournament, among whom there were 6 or 10 grandmasters.