11.5. In the castle, there are 25 identical square rooms, forming a $5 \times 5$ square. In these rooms, 25 people—liars and knights (liars always lie, knights always tell the truth)—settled, one person per room. Each of these 25 people said: “At least one of the neighboring rooms to mine is occupied by a liar.” What is the maximum number of knights that could be among these 25 people? Rooms are considered neighboring if they share a wall.
Answer: 18 knights.

Solution: Note that each knight must have at least one neighbor who is a liar. We will show that there must be at least 7 liars (thus showing that there are no more than 18 knights).

First, consider dividing the rooms into 6 groups (2 rooms, marked in gray, do not belong to any group). In each group, there must be at least one liar (otherwise, one of the knights in the group will not have any liar neighbors). Therefore, there are at least 6 liars. We will prove that there cannot be exactly 6 liars. Assume the contrary. Then each of the marked groups will have exactly one liar. This means that the "gray rooms" must definitely be occupied by knights.

![](https://cdn.mathpix.com/cropped/2024_05_06_88151748b6d1e7030743g-3.jpg?height=274&width=277&top_left_y=1342&top_left_x=1027)

If we make a similar division but rotated by $90^{\circ}$, we will find that there must be knights in two more rooms. These 4 rooms are marked in gray on the diagram. This means that a liar must live in the central room.

![](https://cdn.mathpix.com/cropped/2024_05_06_88151748b6d1e7030743g-3.jpg?height=254&width=274&top_left_y=1843&top_left_x=1028)

Since each of the 6 groups in the division must have exactly 1 liar, the rooms marked in gray on the diagram must be occupied by knights.

![](https://cdn.mathpix.com/cropped/2024_05_06_88151748b6d1e7030743g-3.jpg?height=257&width=271&top_left_y=2282&top_left_x=1027)

By rotating the diagram by $90^{\circ}$, we find that knights must live in the rooms marked in gray on the diagram.

![](https://cdn.mathpix.com/cropped/2024_05_06_88151748b6d1e7030743g-4.jpg?height=269&width=272&top_left_y=231&top_left_x=1029)

But then, in each group of 3 "corner rooms," there must be at least 2 liars. In total, there will be at least 9 liars. This is a contradiction. Therefore, there must be at least 7 liars.

The diagram below shows how 18 knights and 7 liars could be accommodated.

| $\mathrm{P}$ | $\mathrm{P}$ | L | $\mathrm{P}$ | $\mathrm{P}$ |
| :---: | :---: | :---: | :---: | :---: |
| L | $\mathrm{P}$ | $\mathrm{P}$ | $\mathrm{P}$ | L |
| $\mathrm{P}$ | $\mathrm{P}$ | L | $\mathrm{P}$ | $\mathrm{P}$ |
| L | $\mathrm{P}$ | $\mathrm{P}$ | $\mathrm{P}$ | L |
| $\mathrm{P}$ | $\mathrm{P}$ | L | $\mathrm{P}$ | $\mathrm{P}$ |

Comment: A correct answer without justification - 0 points. An example of 7 liars and 18 knights - 2 points. Proving that there are no more than 18 knights - 5 points.

Note: In the example, liars should not be neighbors.