Problem

Source: 2020 Thailand Mathematical Olympiad P5

Tags: combinatorics



You have an $n\times n$ grid and want to remove all edges of the grid by the sequence of the following moves. In each move, you can select a cell and remove exactly three edges surrounding that cell; in particular, that cell must have at least three remaining edges for the operation to be valid. For which positive integers $n$ is this possible?