5. In the cells of a $2015 \times n$ table, non-negative numbers are arranged such that in each row and each column there is at least one positive number. It is known that if a cell contains a positive number, then the sum of all numbers in its column is equal to the sum of all numbers in its row. For which $n$ is this possible?
Answer: $n=2015$.

Solution. We will prove by induction on $m+n$ that for an $m \times n$ table, the specified arrangement is possible only when $m=n$. For $m+n=2$, the statement is obvious. Consider an $m \times n$ table. Let the sum of the numbers in the first row be $a$. Consider all rows and columns whose sum of numbers is also $a$. If these are all the rows and all the columns, then the sum of all numbers in the table, calculated by rows, is $m a$, and calculated by columns, is $n a$. Therefore, $m=n$. If these are not all the rows and all the columns, then consider any row with a different sum. Then at the intersection of this row with a column with sum $a$, there is a zero. The same conclusion is true for a column with a sum different from $a$. Now, let's strike out from the table all rows and columns whose sum of numbers is different from $a$. After striking out, there cannot be any zero rows and columns, since from the rows and columns that remained, only zeros were struck out. Repeating the reasoning with the calculation of the sum of the numbers in the table, we understand that there will be an equal number of rows and columns left (let there be $k$ of each). Now, let's strike out from the original table all rows and columns whose sum of numbers is equal to $a$. We will get a table of size $(m-k) \times (n-k)$, satisfying the condition of the problem. Then, by the inductive hypothesis, $m-k=n-k$. Therefore, $m=n$.