Problem

Source: Iran 2nd round 2022 P3

Tags: combinatorics, table



Take a $n \times n$ chess page.Determine the $n$ such that we can put the numbers $1,2,3, \ldots ,n$ in the squares of the page such that we know the following two conditions are true: a) for each row we know all the numbers $1,2,3, \ldots ,n$ have appeared on it and the numbers that are in the black squares of that row have the same sum as the sum of the numbers in the white squares of that row. b) for each column we know all the numbers $1,2,3, \ldots ,n$ have appeared on it and the numbers that are in the black squares in that column have the same sum as the sum of the numbers in the white squares of that column.