# Problem 7. (4 points)

In a $7 \times 7$ table, some cells are black, and the rest are white. In each white cell, the total number of black cells on the same row or column is written; nothing is written in the black cells. What is the maximum value that the sum of the numbers in the entire table can take?

#
# Answer: 168

## Solution:

The number in the white cell consists of two addends: a "horizontal" and a "vertical" one. Consider the sum of all "horizontal" addends and the sum of all "vertical" addends separately across the entire table. If we maximize each of these two sums separately, the total sum will also be the largest.

Consider the sum of the "horizontal" addends. If a row contains $x$ black cells and 7 - $x$ white cells, then the sum of the horizontal addends in this row is $x(7-x)$. This value is maximized when $x=3$ and $x=4$, and equals 12. Therefore, the maximum sum of "horizontal" addends is $7 \cdot 12=84$, and the total of all numbers is 168.

This value is achieved, for example, with a checkerboard pattern—easily verified, as each row and each column indeed contains 3 or 4 black cells.