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$.
To determine all positive integers \( n \) such that there exists an \( n \times n \) matrix where each number from \( 1 \) to \( n \) appears exactly \( n \) times, and the sums of the numbers in each row and each column leave \( n \) distinct remainders when divided by \( n \), we proceed as follows:

1. **Total Sum Calculation:**
   The total sum of all numbers in the \( n \times n \) matrix is:
   \[
   \text{Total} = n \sum_{k=1}^n k = n \left( \frac{n(n+1)}{2} \right)
   \]
   This simplifies to:
   \[
   \text{Total} = \frac{n^2(n+1)}{2}
   \]

2. **Modulo Condition:**
   For the sums of the numbers in each row and each column to leave \( n \) distinct remainders when divided by \( n \), the total sum modulo \( n \) must be considered. We have:
   \[
   \text{Total} \equiv \sum_{k=1}^n k \pmod{n}
   \]
   Since:
   \[
   \sum_{k=1}^n k = \frac{n(n+1)}{2}
   \]
   We need:
   \[
   n \mid \frac{n(n+1)}{2}
   \]
   This implies that \( n \) must divide \( \frac{n(n+1)}{2} \). For this to hold, \( n \) must be odd. This is because if \( n \) were even, \( n+1 \) would be odd, and the division by 2 would not necessarily result in an integer.

3. **Construction for Odd \( n \):**
   If \( n \) is odd, we can construct the matrix as follows. Let \( n = 2k + 1 \). Consider the following arrangement:
   \[
   \begin{array}{cccc|cccc}
   2 & 3 & \cdots & k+2 & k+1 & k+2 & \cdots & 2k \\
   3 & 4 & \cdots & k+3 & k & k+1 & \cdots & 2k-1 \\
   \vdots & \vdots & \ddots & \vdots & \vdots & \vdots & \ddots & \vdots \\
   2k & 2k+1 & \cdots & k-1 & k+2 & k+3 & \cdots & 2 \\
   2k+1 & 1 & \cdots & k & k+3 & k+4 & \cdots & 1 \\
   \hline
   2k & 2k-1 & \cdots & k & k-1 & k-2 & \cdots & 2k+1
   \end{array}
   \]

4. **Verification:**
   - Each number from \( 1 \) to \( n \) appears exactly \( n \) times.
   - The sums of the numbers in each row and each column leave \( n \) distinct remainders when divided by \( n \).

Thus, the construction works for all odd \( n \).

The final answer is \( \boxed{ n } \) must be odd.