3. Given a $101 \times 101$ grid, all cells of which are painted white. It is allowed to choose several rows and repaint all cells in these rows to black. Then, choose exactly the same number of columns and repaint all cells in these columns to the opposite color (i.e., white to black, and black to white). What is the maximum number of black cells that the grid can contain after this operation?
Answer: 5100.

Solution. Let $k$ rows be repainted first, then $k$ columns. After the first stage of repainting, each column will contain $k$ black and $101-k$ white cells. Since $101-k$ columns will remain untouched, the total number of black cells in these columns will be $k(101-k)$. In each of the repainted columns, there will be $101-k$ black cells, so the total number of black cells in these columns will be $(101-k)k$. Therefore, the total number of black cells is $f(k) = 2k(101-k)$. It is clear that the graph of the function $f(x) = 2x(101-x)$ is a parabola with branches pointing downwards. This means that the maximum value of the function $f(x) = 2x(101-x)$ is achieved at the point $a = \frac{101}{2}$, and the function increases up to this point and then decreases. Therefore, for any integer $k$, $f(k) \leq f(50)$ for $0 \leq k \leq 50$ and $f(k) \leq f(51)$ for $51 \leq k \leq 101$. It remains to note that $f(50) = f(51) = 5100$.

Remark. The analysis of the behavior of the function $f(x)$ can be conducted using the derivative. From the fact that the maximum value of the function $f(x)$ is achieved at the point $a = \frac{101}{2}$, it does not follow that the function $f(k)$ (for integer $k$) must achieve its maximum value at one of the nearest integer points to $a$. Although this is true for our function, in general, there is a counterexample. For a valid conclusion, a reference to monotonicity is needed.

Comment. Only the answer - 1 point.

In the solution, an explicit formula for the number of black cells (in terms of $k$) is obtained - no less than 3 points.

An unproven conclusion that the maximum value is $f(50)$ or $f(51)$ - no more than 4 points.