5. In a class, there are $n$ boys and $n$ girls ($n \geqslant 3$). They sat around a round table such that no two boys and no two girls sit next to each other. The teacher has $2 n$ cards, on which the numbers $1,2,3, \ldots, 2 n$ are written, each one appearing once. He distributed one card to each student such that the number on any girl's card is greater than the number on any boy's card. Then, each girl wrote down on a piece of paper the sum of the numbers on three cards: her own and those of the boys sitting next to her. For which $n$ could all the $n$ numbers obtained be equal?
Answer: for odd $n$

Solution. According to the problem, the boys received cards with numbers from 1 to $n$, and the girls received cards with numbers from $n+1$ to $2 n$. Suppose that all the girls ended up with the number $m$ written on their sheets. Then the sum of all the numbers on the sheets is $m n$, which can also be obtained as follows: we need to add all the numbers that the girls have and add to them twice the sum of all the numbers that the boys have.

Therefore,

$$
m n=2 \sum_{j=1}^{n} j+\sum_{j=n+1}^{2 n} j=\sum_{j=1}^{2 n} j+\sum_{j=1}^{n} j=\frac{1}{2} 2 n(2 n+1)+\frac{1}{2} n(n+1)=n(2 n+1)+n \cdot \frac{n+1}{2}
$$

Thus, $m=2 n+1+\frac{n+1}{2}$ and $n-$ is odd. Let $n=2 k-1$, then $m=5 k-1$. For an example, we need to sequentially distribute the cards to the boys from 1 to $2 k-1$, skipping one. If we now look at the sum of the numbers on the cards of the boys adjacent to each girl, we will get all the sums from $k+1$ to $3 k-1$ exactly once. Next, we need to supplement them with numbers from $2 k$ to $4 k-2$ (by distributing the corresponding cards to the girls) so that all the sums become equal to $5 k-1$. An example of card distribution for $n=9$ and $k=5$ is shown in the figure.

![](https://cdn.mathpix.com/cropped/2024_05_06_e0197926f6acc0f95da5g-05.jpg?height=483&width=489&top_left_y=2283&top_left_x=792)

## GRADES 10-11. SECOND VARIANT