5. In an $8 \times 8$ table, natural numbers are arranged. The numbers in cells symmetric with respect to both diagonals of the table are equal. It is known that the sum of all numbers in the table is 1000, and the sum of the numbers on the diagonals is 200. For what smallest number $M$ can we assert that the sum of the numbers in each row does not exceed $M$?
Answer: $M=288$.

Solution. Consider the upper half of the table. Let the numbers be arranged as shown in the figure. Due to symmetry, the marked numbers completely determine the placement of the remaining numbers in the table.

| $a_{1}$ | $b_{1}$ | $b_{2}$ | $b_{3}$ | $c_{3}$ | $c_{2}$ | $c_{1}$ | $d_{1}$ |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
|  | $a_{2}$ | $b_{4}$ | $b_{5}$ | $c_{5}$ | $c_{4}$ | $d_{2}$ |  |
|  |  | $a_{3}$ | $b_{6}$ | $c_{6}$ | $d_{3}$ |  |  |
|  |  |  | $a_{4}$ | $d_{4}$ |  |  |  |

Let

$$
\begin{array}{ll}
A=a_{1}+a_{2}+a_{3}+a_{4}, & B=b_{1}+b_{2}+b_{3}+b_{4}+b_{5}+b_{6} \\
D=d_{1}+d_{2}+d_{3}+d_{4}, & C=c_{1}+c_{2}+c_{3}+c_{4}+c_{5}+c_{6}
\end{array}
$$

By the condition, $2(A+D)=200$ and $2(A+D)+4(B+C)=1000$. Therefore, $A+D=100$ and $B+C=200$. Since the numbers are natural, $a_{i}+d_{j} \leqslant A+D-6=94$, and the sum of any three numbers $b_{i}$ and any three numbers $c_{j}$ does not exceed $B+C-6=194$. It remains to note that in each row there is one number of the form $a_{i}$ and $d_{j}$, and three numbers of the form $b_{i}$ and $c_{j}$, so their sum does not exceed $94+194=288$. Therefore, $M=288$ fits. We will show that smaller $M$ do not work. Consider the table

| 47 | 95 | 1 | 1 | 1 | 1 | 95 | 47 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 95 | 1 | 1 | 1 | 1 | 1 | 1 | 95 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 95 | 1 | 1 | 1 | 1 | 1 | 1 | 95 |
| 47 | 95 | 1 | 1 | 1 | 1 | 95 | 47 |

The sum of the numbers in it is $8 \cdot 95+4 \cdot 47+52=1000$, on the diagonals $4 \cdot 47+12=200$, and in the first row $-2 \cdot 47+2 \cdot 95+4=288$.