2. In each cell of a $15 \times 15$ square, there is a natural number not exceeding 4, and the sum of the numbers in each $2 \times 2$ square is 7. What is the maximum value that the sum of the numbers in the entire table can take?
Answer: 417

Solution. Note that the sum of the numbers in two adjacent cells does not exceed five, since otherwise the sum of the numbers in the $2 \times 2$ square containing these two cells would be at least eight, which is impossible according to the condition.

Divide the table into 49 squares of $2 \times 2$ and a corner of width 1. Divide the corner into a corner cell and 14 dominoes of $1 \times 2$. The sum of the numbers in each $2 \times 2$ square is 7, the sum of the numbers in each domino does not exceed 5, and the number in the corner cell does not exceed 4, so the sum of all the numbers in the table does not exceed $49 \cdot 7 + 14 \cdot 5 + 4 = 417$.

Example. Number the rows and columns of the table from 1 to 15 from left to right and from bottom to top. Place fours in the cells at the intersections of odd-numbered rows and columns, and ones in the other cells (see the figure). The sum of all the numbers is $64 \cdot 4 + (225 - 64) \cdot 1 = 417$.

| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 | 4 | 1 |
| 1 | 1 | 1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