In a $3 \times 3$ chessboard, we placed two light and two dark knights in the corners as shown in the figure. How many moves and in what way can the two light knights swap places with the two dark ones? How many moves are required to achieve that the same-colored pieces are located at the ends of one diagonal? (Only one piece can be on a square at a time; the knights move as usual: two steps in one direction, then one step in a perpendicular direction.)

![](https://cdn.mathpix.com/cropped/2024_05_02_c942b519175306544824g-1.jpg?height=409&width=396&top_left_y=354&top_left_x=859)
Let's call two squares "adjacent" if a knight can jump from one to the other. Observing the diagram, we can see that every square has exactly two neighbors, except for the center, which has none. Thus, we cannot reach the center square at all, and it is not of interest to us from now on. Rearrange the other eight squares so that the "adjacent" ones are indeed adjacent. This can be achieved, for example, by leaving the corner squares in place and reflecting the ones between them across the center of the board.

What does a move consist of now? It consists of moving one piece to an adjacent square, provided that it is empty. Since the pieces cannot overtake each other on the circular path available to them, the cyclic order of the pieces cannot change. This means that if we mark the knight in the upper left and the knight in the lower right with a 1, and the other two with a 2, before the start, then after each move, the white 1 knight will be followed by the white 2 knight, the black 1 knight, and finally the black 2 knight, in the direction of the clock. Based on this, we can immediately answer the second part of the problem: it is not possible to reach a position where the pieces of the same color are at the opposite ends of a diagonal, because in that case, the cyclic order of the pieces would be different.

Returning to the first part of the problem, it is easily determined that 16 moves are sufficient to achieve the desired swap. Let the pieces move one by one in the direction of the clock, and repeat this three times. But wouldn't fewer moves be sufficient? No, because since the cyclic order of the pieces does not change, the dark pieces can only swap places with the light ones if the ones swap with the ones and the twos with the twos. For this, each piece must take at least 4 moves.