In the cells of an $8 \times 8$ table, the numbers 1 and -1 are written such that the product of the numbers in each row, each column, and each diagonal (including the corner cells) is 1. What is the maximum number of negative ones possible?

#
Consider the diagonals containing an odd number of cells.

## Solution

In each row specified in the condition, there must be an even number minus one. Consider all diagonals containing an odd number of cells. There are 16 of them, and no two of them share any cells. On each of them, there must be at least one unit, so the number of units is at least 16, and consequently, the number of minus units is no more than 48. An example with 48 minus units is shown in the figure (the cells with units are shaded).

![](https://cdn.mathpix.com/cropped/2024_05_06_e0ce4a33d8b15522751eg-06.jpg?height=506&width=523&top_left_y=1371&top_left_x=756)

## Answer

48.