Alex and Betty play a game with a row of consecutive cells. At the start of the game, the name of Alex is written in the st, rd, ..., st cells from the left and the name of Betty is written in the nd, th, ..., nd cells from the left. Starting from Alex, two players do the following operation in turn.
Choose two cells with his or her own name which are not adjacent such that all cells between the two have the opponent's name. Then replace opponent's names with his or her own names for all cells between the chosen two.
The game ends when one player is not able to do the operation. Determine the largest positive integer satisfying the following condition.
No matter how Betty does the operations, Alex can play such that there are or more cells with Alex's name at the end of the game.
, 2022
Solution
At the start of the game, there are pairs of two adjacent cells with different names and the number of such pairs is reduced by two per one operation. If there are three or more pairs of two adjacent cells with different names then a player can do the operation hence the number of such pairs is one at the end of the game. Therefore the total number of operations done by two players is .
When Alex does the operation, there are three or more pairs of two adjacent cells with different names. Let be the leftmost one among all such pairs and let be the second one from the left. Assume lies to the left of and lies to the left of then and have the name of Alex and all cells between and have the name of Betty. Therefore by doing the operation to and , Alex can increase the number of consecutive cells with Alex's name beginning from the leftmost cell by two. When there are consecutive cells with Alex's name beginning from the leftmost cell, they are not replaced by Betty's operation hence the number of such cells is not reduced by Betty's operation. Alex does the operation times thus satisfies the condition. On the other hand, Betty can similarly make or more consecutive cells with Betty's name beginning from the rightmost cell hence we have . Therefore the answer is .