5. A $7 \times 7$ table is filled with non-zero integers. First, the border of the table is filled with negative numbers. Then, the cells are filled in any order, and the next number is equal to the product of the previously placed numbers that are closest to it in the same row or column. What is the maximum number of positive numbers that can be in the table?
# Answer. 24.

Solution. Evaluation. We will prove that there must be at least one negative number in the shaded area. Suppose this is not the case. Consider the corner cell of the shaded area where the number was placed last among the four corners (it is shaded black). By assumption, if some other numbers are placed in the cells of its row and column, they are positive. Therefore, a negative number must be placed in the black cell. There are at least \(4 \cdot 6 + 1 = 25\) negative numbers, so there are at most 24 positive numbers.

![](https://cdn.mathpix.com/cropped/2024_05_06_db79d3f3e061e0382562g-7.jpg?height=446&width=440&top_left_y=722&top_left_x=885)

Example. We will place numbers in the shaded area in the order indicated by the numbers. In cells 1 and 2, we will choose factors by column, in cells 3 and 4, we will choose factors by row, resulting in positive numbers. In cell 5, there will be a negative number. All other cells can be filled with positive numbers, totaling 24.

![](https://cdn.mathpix.com/cropped/2024_05_06_db79d3f3e061e0382562g-7.jpg?height=468&width=446&top_left_y=1365&top_left_x=882)

Comment. Correct solution - 20 points. A filling method that is not optimal is proposed - 5 points. If the sequence of filling the cells is not indicated - 1 point.

## Variant 4