MathLabs

Problem 5

Turbo the snail is in the top row of a grid with 2024 rows and 2023 columns and wants to get to the bottom row. However, there are 2022 hidden monsters, one in every row except the first and last, with no two monsters in the same column. Turbo makes a series of attempts to go from the first row to the last row. On each attempt, he chooses to start on any cell in the first row, then repeatedly moves to an orthogonal neighbor. (He is allowed to return to a previously visited cell.) If Turbo reaches a cell with a monster, his attempt ends and he is transported back to the first row to start a new attempt. The monsters do not move between attempts, and Turbo remembers whether or not each cell he has visited contains a monster. If he reaches any cell in the last row, his attempt ends and Turbo wins. Find the smallest integer nn such that Turbo has a strategy which guarantees being able to reach the bottom row in at most nn attempts, regardless of how the monsters are placed.
Step 3 of 5: Case where M1 is not on the edge
In plain words

When the first monster is interior, a staircase can move toward the nearest edge while keeping a safe shoulder above every possible second monster. Once the second monster is known, Turbo crosses its row to the already safe column of the first monster.

M1 interior  ⟹  a staircase reaches the safe column of M1M_1 \text{ interior} \implies \text{a staircase reaches the safe column of }M_1
Detailed analysis

Let the grid have rows 1,…,s1,\ldots,s and columns 1,…,s−11,\ldots,s-1, with s=2024s=2024, and suppose M1=(2,j)M_1=(2,j) with 1<j<s−11<j<s-1. If j=2j=2, use the reflected right staircase; otherwise use the left staircase below. Enter row 2 at column j−1j-1, move west to column j−2j-2, go down to row 3, move west one column, go down again, and continue; in row rr the first cell is (r,j−r+1)(r,j-r+1), and the next move is west before descending. This reaches (j,1)(j,1). If a downward entry into (r,d)(r,d) is M2M_2, then the cell (r−1,d+1)(r-1,d+1) immediately above-right of it was already visited safely. On attempt 3, reproduce the safe prefix, enter row rr through (r,d+1)(r,d+1), and move horizontally in row rr to column jj. If instead M2M_2 is met on a westward move, the cell immediately east of it in the same row is already safe, and the same horizontal detour works. Every other cell of row rr is safe because M2M_2 is the unique monster in that row; column jj is safe below row 2 because it already contains M1M_1 and no column has two monsters. Thus Turbo descends column jj to the last row. If the staircase reaches (j,1)(j,1) without a hit, sweep east across row jj to column jj and descend; any monster met during that sweep is M2M_2 and can be bypassed along the same row, while a monster in column jj is impossible.