Problem

Source: Brazilian Mathematical Olympiad 2023, Level 3, Problem 5 / Level 2, Problem 6

Tags: game, combinatorics, board



Let $m$ be a positive integer with $m \leq 2024$. Ana and Banana play a game alternately on a $1\times2024$ board, with squares initially painted white. Ana starts the game. Each move by Ana consists of choosing any $k \leq m$ white squares on the board and painting them all green. Each Banana play consists of choosing any sequence of consecutive green squares and painting them all white. What is the smallest value of $m$ for which Ana can guarantee that, after one of her moves, the entire board will be painted green?