Lobanov M. S.

Around a round rotating table, on which there are 8 white and 7 black cups, 15 gnomes are sitting. They have put on 8 white and 7 black caps. Each gnome takes a cup whose color matches the color of their cap and places it in front of them, after which the table is rotated randomly. What is the maximum number of matches between the color of the cup and the cap that can be guaranteed after the table is rotated (the gnomes choose how to sit, but they do not know how the table will be rotated)?
Let's consider an arbitrary arrangement of cups and write down their colors in a row. Below this row, we will also write down all its different cyclic shifts — a total of 14. We will count how many color matches there will be in the same position in the original arrangement and in the arrangements obtained by shifts. For black cups, the color matches will be exactly in 6 shifts, and for white cups — in 7 shifts. Therefore, the total number of color matches for 14 shifts will be \(7 \cdot 6 + 8 \cdot 7 = 98\). This means there exists a shift in which there will be no more than \(98/14 = 7\) matches with the original arrangement.

Consider such an arrangement of cups: ббббчбчббччбччч. By direct verification, one can confirm that all its cyclic shifts have exactly 7 matches with it.

## Answer