## Task 4.

Each field of a $9 \times 9$ board is colored either blue or red. A row is said to be predominantly red if it has more red than blue fields, and a column is said to be predominantly blue if it has more blue than red fields. Let $C$ be the number of predominantly red rows, and $P$ be the number of predominantly blue columns.

a) Can it be that $C+P=18$?

b) Can it be that $C+P=17$?

c) Can it be that $C+P=16$?
## Solution.

The board has nine rows, so the number of predominantly red rows cannot be greater than 9, i.e., $C \leqslant 9$. Similarly, $P \leqslant 9$. Adding these two inequalities, we get $C+P \leqslant 18$. This makes the selection of numbers in the questions in the problem clearer.

If $C+P=18$ were true, then it would have to be that $C=9$ and $P=9$. This means that every row would be predominantly red and every column predominantly blue. Predominantly red rows have at least 5 red fields. If all rows are predominantly red, then we have at least 45 red fields in total. Similarly, if all columns are predominantly blue, then we have at least 45 blue fields in total. However, the total number of fields on the board is $9 \times 9=81$, which is less than $45+45$. Therefore, it is not possible that $C+P=18$.

In the same way, we can actually argue that $C+P$ cannot be 17. If $C+P=17$, then because $C \leqslant 9$ and $P \leqslant 9$, the only possibility is that one of these numbers is 9 and the other is 8. Everything in the problem remains the same if we swap rows and columns or the names of the colors, so without loss of generality, we can assume that $C=9$ and $P=8$. Then we conclude that we have at least 45 red and at least 40 blue fields, which is still greater than 81 in total.

Finally, if $C+P=16$, then both numbers must be 8 or one must be 9 and the other 7. If we repeat the previous argument, we will not get a contradiction, so we can try to construct an example where this holds. Color the fields in the upper left $8 \times 8$ part of the board in a checkerboard pattern, alternating red and blue, and color the entire last column red, and all fields in the last row, except the last one, blue. Then we see that the first 8 columns are predominantly blue, and the first 8 rows are predominantly red.

The other possibility is to place 5 red fields at the beginning of the first four rows and at the end of the last four rows, and color the remaining fields blue. This results in a pattern that has a certain symmetry with respect to a $90^{\circ}$ rotation of the board around its center. Of course, there are many similar examples.

Therefore, it is possible that $C+P=16$.