MathDB
Problems
Contests
International Contests
IberoAmerican
2022 Iberoamerican
4
4
Part of
2022 Iberoamerican
Problems
(1)
Process combo again
Source: Iberoamerican 2022, Day 2, P1
9/29/2022
Let
n
>
2
n> 2
n
>
2
be a positive integer. Given is a horizontal row of
n
n
n
cells where each cell is painted blue or red. We say that a block is a sequence of consecutive boxes of the same color. Arepito the crab is initially standing at the leftmost cell. On each turn, he counts the number
m
m
m
of cells belonging to the largest block containing the square he is on, and does one of the following:If the square he is on is blue and there are at least
m
m
m
squares to the right of him, Arepito moves
m
m
m
squares to the right;If the square he is in is red and there are at least
m
m
m
squares to the left of him, Arepito moves
m
m
m
cells to the left; In any other case, he stays on the same square and does not move any further. For each
n
n
n
, determine the smallest integer
k
k
k
for which there is an initial coloring of the row with
k
k
k
blue cells, for which Arepito will reach the rightmost cell.
combinatorics