Problem

Source: RMM Shortlist 2023 C2

Tags: grid, colouring, paths, right angle, combinatorics, RMM Shortlist



For positive integers $m,n \geq 2$, let $S_{m,n} = \{(i,j): i \in \{1,2,\ldots,m\}, j\in \{1,2,\ldots,n\}\}$ be a grid of $mn$ lattice points on the coordinate plane. Determine all pairs $(m,n)$ for which there exists a simple polygon $P$ with vertices in $S_{m,n}$ such that all points in $S_{m,n}$ are on the boundary of $P$, all interior angles of $P$ are either $90^{\circ}$ or $270^{\circ}$ and all side lengths of $P$ are $1$ or $3$.