Determine all $n$ positive integers such that exists an $n\times n$ where we can write $n$ times each of the numbers from $1$ to $n$ (one number in each cell), such that the $n$ sums of numbers in each line leave $n$ distinct remainders in the division by $n$, and the $n$ sums of numbers in each column leave $n$ distinct remainders in the division by $n$.
Problem
Source: 2023 Girls in Mathematical Tournament- Level A, Problem 4
Tags: combinatorics, number theory