SOLUTION. In the case of eight towers, let's number them in the direction of the clock hands by numbers 1,2,…,8. One of the possible solutions to the first part of the problem is that the black knights will occupy all the towers with even numbers at the beginning (one of them will have two knights and the remaining three will have one knight each) and similarly, the red knights will occupy the towers with odd numbers. After each hour, the situation will only change in that the knights from the towers with even numbers will occupy the towers with odd numbers and vice versa. Thus, all the towers will always be guarded.
The case with seven towers is a bit more challenging. We have only five knights of each color, so at least two towers will not be occupied by black knights and at least two towers will not be occupied by red knights. From the perspective of the black knights, the two towers not occupied by red knights (let's call them white) will move two positions counterclockwise every hour. The numbers 7 and 2 are coprime, so from this perspective, each white tower will return to its original position only after seven hours. Within five hours, the two white towers will occupy at least six different positions (each will occupy five different positions, but it cannot be the same five for both, as that would mean the towers would return to their original position on the sixth move 2 ), and thus at some hour, at least one will end up in at least one of the two positions not occupied by black knights.
## GUIDING PROBLEMS:
N1. On the circular fortification of the castle, there are four towers. Two black and two red knights will be distributed among them and start guarding. After each hour, all black knights will move to the neighboring tower in the direction of the clock hands, and all red knights will move to the neighboring tower in the opposite direction. Distribute the knights so that each tower is guarded during every hour. [It is enough to distribute the knights so that there are no knights of the same color in neighboring towers.]
N2. On the circular fortification of the castle, there are three towers. Two black and two red knights will be distributed among them and start guarding. After each hour, all black knights will move to the neighboring tower in the direction of the clock hands, and all red knights will move to the neighboring tower in the opposite direction. Can you distribute the knights so that each tower is guarded during every hour? [No. At the beginning of the guard, choose one tower X that is not guarded by black knights and one tower Y that is not guarded by red knights. Similarly, the unguarded towers in the following hours can be determined by moving Y and X in the direction, respectively, opposite to the direction of the clock hands. Every three hours, X=Y will hold.]
D1. a) Mařenka will distribute different numbers of candies from one to eight into the vertices of a regular octagon. Then Petr can choose which three piles of candies to give to Mařenka, and he will keep the rest. The only condition is that these three piles lie at the vertices of an isosceles triangle. Mařenka wants to distribute the candies so that she gets as many as possible, no matter which trio of vertices Petr chooses. How many will Mařenka definitely get?
b) Solve the same problem for a regular nonagon, into whose vertices Mařenka will distribute 1 to 9 candies. (Among isosceles triangles, we also include equilateral triangles.) [66-C-I-6]
D2. We assign one of the numbers 1 or -1 to each vertex of a regular 66-gon. To each segment connecting two of its vertices (side or diagonal), we then write the product of the numbers at its endpoints and sum all the numbers for the individual segments. Determine the smallest possible and the smallest non-negative value of such a sum. [66-B-I-1]
2 The course of moves of one tower can also be illustrated by arrows between the vertices of a drawn heptagon; this makes it evident both the statement about the period of 7 hours of the entire movement and the statement about the difference of five consecutive positions of two towers with different initial positions.
[^0]: 1 The option (ab+cd)(ab−cd)=222 can be immediately ruled out by observing that both parentheses have the same parity (the difference between them is an even number), and therefore their product cannot be the even number 222, which is not divisible by four.