Problem

Source: Serbia JBMO TST 2022 P4

Tags: combinatorics



Initially in every cell of a $5\times 5$ board is the number $0$. In one move you may take any cell of this board and add $1$ to it and all of its adjacent cells (two cells are adjacent if they share an edge). After a finite number of moves, number $n$ is written in all cells. Find all possible values of $n$.