2022 OIM Problems/Problem 4
Problem
Let be a positive integer. There is a horizontal row of cells such that each cell is colored red or blue. A block is a contiguous sequence of similarly colored cells. Arepito the crab is initially on the leftmost cell of the row. In each turn, he counts the number of cells of the longest block containing the cell he is currently on and performs one of the following actions:
- If he is on a blue cell and there are at least cells to his right, Arepito moves cells to the right;
- If he is on a red cell and there are at least cells to his left, Arepito moves cells to the left;
- Otherwise he stays on the cell he is currently on and does not move anymore.
For each , determine the smallest integer for which there is an initial coloring of the row with blue cells for which Arepito can reach the rightmost cell of the row.
Solution
This problem needs a solution. If you have a solution for it, please help us out by adding it.