Let and be positive integers. A kindergarten teacher uses square tiles, arranged into an rectangular region. On each tile stands a baby, each facing one of the sides of the square. When the teacher claps once, all babies simultaneously advance one tile in the direction they are facing, and then all babies turn 90 degrees clockwise in place. If a baby crawls out of the rectangular region, that baby cries loudly. If two babies advance onto the same tile, they collide and then cry loudly together.
It is known that the teacher can appropriately arrange the initial facing direction of each baby so that no matter how many times the teacher claps, no baby cries.
Find all possible values of and .
, 2023
Solution
The answer is all even and . Clearly all cases of can be tiled using copies of the following baby array:
Now we prove that the condition of the problem can be satisfied only when both and are even. Let us number the columns in order as 1, 2, ..., , and the rows in order as 1, 2, ..., , and denote the tile in column , row as . Let us consider all the "odd" cells where both and are odd, and all the "even" cells where both and are even. Notice that regardless of the initial facing directions of the babies, after the teacher claps twice, all babies originally on odd cells will appear on even cells, all babies originally on even cells will appear on odd cells, and no baby originally on a cell that is neither odd nor even will appear on an odd or even cell. This means the number of odd cells and even cells must be equal (otherwise there will certainly be babies colliding). However, when and are not both even, the number of odd cells and even cells must be different. Therefore, the condition of the problem can be satisfied only when both and are even.