Problem

Source: Mathematical Danube Competition 2017, Juniors P2

Tags: combinatorics, romania



Let $n\geq 3$ be a positive integer. Consider an $n\times n$ square. In each cell of the square, one of the numbers from the set $M=\{1,2,\ldots,2n-1\}$ is to be written. One such filling is called good if, for every index $1\leq i\leq n,$ row no. $i$ and column no. $i,$ together, contain all the elements of $M$. Prove that there exists $n\geq 3$ for which a good filling exists. Prove that for $n=2017$ there is no good filling of the $n\times n$ square.