Write $n^2$ real numbers into $n \times n$ square grid Let $k$ and $n$ be two positive integers such that $k<n$ and $k$ does not divide $n$. Show that one can fill a $n \times n$ square grid with $n^2$ real numbers such that sum of numbers in an arbitrary $k \times k$ square grid is negative, but sum of all $n^2$ numbers is positive.
Source: Homework
My idea: I presented $n = mk + r$ and write $-k^2$ into each square with coordinate of the form $(ik, jk)$ where $i, j$ are positive integers and 1 in another squares. Then the sum of each $k \times k$ square is $-1$ and sum of $n^2$ numbers is $n^2 - m^2(k^2+1)$. But this doesn't work for large $m$.

This can be done so that all rows are the same.  Here's the idea of my solution: let the first column all have a value of $a > 0$, to be chosen later.  Let the next $k - 1$ columns all have $-1$ in them.  Then repeat this pattern: one column of $a$'s, $k-1$ column's of $-1$'s.  Then every $k \times k$ square has exactly one column of $a$'s and the rest are $-1$'s.  Thus, the sum over this square is $ ka - k(k-1)$.  If we want this value to be negative, then we need $a < k - 1$, i.e. $a = k-1 - \epsilon$ for some $\epsilon > 0$, to be decided later.  
Now let's look at the sum over the whole matrix.  If we write $n = mk + r$, then we have $m$ columns of $a$'s and $n - m$ columns of $-1$'s.  The total sum is then $$ nma - (n - m)n$.
Note that $n = mk + r \implies n - m = m(k - 1) + r$.  Thus, we have that the sum over the whole matrix is $$ nm((k - 1) - \epsilon) - ((k - 1)m - r)n = rn - nm\epsilon.$$
Thus, if we take $\epsilon = \frac{r}{2m}$, then we have that the sum is $$ rn - nm\epsilon = rn - nm \frac{r}{2m} = \frac{rn}{2} > 0$$
as desired.
EDIT:  The final matrix looks like: $$ \left(\begin{array}{cccc|cccc|c|ccc}
a& -1 & \cdots & -1 &a & -1 & \cdots & -1 &\cdots &a & \cdots & -1 \\
a& -1 & \cdots & -1 &a & -1 & \cdots & -1 &\cdots &a & \cdots & -1 \\
\vdots& \vdots & \ddots & \vdots & \vdots &  \vdots &  \ddots & \vdots &\ddots &\vdots & \ddots & \vdots \\
a& -1 & \cdots & -1 &a & -1 & \cdots & -1 &\cdots &a & \cdots & -1 \\
\end{array} \right)$$
Where $a = k-1 -\frac{r}{2m}$ in each block but the last I have one column of $a$'s and $(k-1)$ columns of $-1$'s.  In the last column, I have $r$ $-1$'s.  note, if I multiply the whole matrix by $2m$, then it has integer entries.
