8. (5 points) In the cells of a $5 \times 7$ table, the numbers 1, 2, and 3 are arranged such that in any $2 \times 2$ square, there are all three different numbers. What is the smallest value that the sum of the numbers in the entire table can take?
Answer: 55

Solution:

Example:

| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 2 | 3 | 2 | 3 | 2 | 3 | 2 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 2 | 3 | 2 | 3 | 2 | 3 | 2 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |

Evaluation

Consider the left upper $2 \times 2$ square of the $5 \times 7$ rectangle. In it, there are at least two non-ones, and at least one of them is on the side or in the corner of the rectangle. Let's call this cell marked. By considering the other corners of the rectangle, we get a total of at least four marked cells, i.e., cells on the boundary of the rectangle that are not ones.

The left upper and right lower $4 \times 6$ rectangles do not share any marked cells, so in one of them, there are no more than two marked cells. This rectangle can be divided into $2 \times 2$ squares, the sum of the numbers in each of which is at least 7. Therefore, the total sum of the numbers in this rectangle is at least 42.

Outside this $4 \times 6$ rectangle, there are 11 cells, at least two of which are marked. The sum of the numbers in these cells is at least $9 \cdot 1 + 2 \cdot 2 = 13$. In total, we get a sum of at least 55.

## 7th grade

## 2nd variant