5. In the village of Sosnovka, there are 240 residents, some of whom are acquainted with each other, while others are not. It is known that any five residents can be seated at a round table such that each of them is acquainted with both of their neighbors. What is the minimum number of pairs of acquaintances that can exist in Sosnovka?
Answer: 28440.

Solution. Suppose that some resident (let's call him Petya) is not acquainted with at least three other residents. Choose the following five people: Petya, the three residents he is not acquainted with, and one more arbitrary person. They cannot be seated around a round table in the required manner, since next to Petya there will inevitably be a person he is not acquainted with. Therefore, each resident of the village cannot have more than two unfamiliar people. Hence, each is acquainted with at least 237 residents, and the total number of pairs of acquaintances is no less than $\frac{240 \cdot 237}{2}=28440$.

Now, let's show that the number of pairs of acquaintances can be exactly 28440. Seat all residents around a large round table and introduce everyone except those sitting next to each other. Verify that this construction satisfies the problem's condition. Since each resident is not acquainted with exactly two others, he is acquainted with exactly 237 people, and the total number of pairs of acquaintances is $\frac{240 \cdot 237}{2}=28440$. Now, take any five residents and seat them in the required manner. Remove all others from the large round table and denote the remaining in cyclic order as $A, B, C, D, E$. Then the seating arrangement $A, C, E, B, D$ will work. Indeed, any two new neighbors did not sit next to each other at the large round table and therefore know each other.

![](https://cdn.mathpix.com/cropped/2024_05_06_66368caef28b3de8e403g-12.jpg?height=308&width=326&top_left_y=1471&top_left_x=928)