2. (10 points) In each cell of a $50 \times 50$ square, a number is written that is equal to the number of $1 \times 16$ rectangles (both vertical and horizontal) in which this cell is an end cell. In how many cells are numbers greater than or equal to 3 written?
Answer: 1600.

Solution. We will denote the cells of the square by pairs $(i, j)$, where $i=1, \ldots, 50, j=$ $=1, \ldots, 50$. We will start the numbering from the bottom left corner of the square.

The cell $(i, j)$ is the rightmost for a horizontal rectangle if $16 \leqslant$ $\leqslant i-$ inequality (1), and the leftmost if $i \leqslant 50-15=35-$ inequality (2). The cell $(i, j)$ is the topmost for a vertical rectangle if $16 \leqslant j-$ inequality (3), and the bottommost if $j \leqslant 50-15=35-$ inequality (4). We are interested in the number of cells of the square for which at least three of the inequalities (1)-(4) are satisfied.

First, we will find the number of cells for which all inequalities are true. These are the cells for which $16 \leqslant i \leqslant 35$ and $16 \leqslant j \leqslant 35$. There are $(35-15) \times(54-15)=20 \times 20=400$ such cells.

Now we will calculate the number of cells for which inequality (1) is not true, but (2)-(4) are true. That is, $i<16$ and $16 \leqslant j \leqslant 35$. There are $15 \times(35-15)=15 \times 20=300$ such cells. It is easy to see that due to the symmetry (of the square) the number of cells for which other sets of three inequalities are true will be the same.

In total, we get $400+3 \cdot 300=1600$.