2. On a sheet of lined paper, two rectangles are outlined. The first rectangle has a vertical side shorter than the horizontal side, while the second has the opposite. Find the maximum possible area of their common part, if the first rectangle contains 2015 cells, and the second - 2016.
Solution. The common part of these two rectangles (if it is non-empty) is a rectangle. Let's determine the maximum possible lengths of its sides.

The vertical side of the first rectangle is shorter than the horizontal one, so it is less than $\sqrt{2015}$, which is less than 45; the same is true for the horizontal side of the second rectangle. At the same time, the sides of the intersection cannot exceed the corresponding sides of the original rectangles (but they can obviously be equal to them).

Note that $2015=5 \cdot 403=5 \cdot 13 \cdot 31 ; 2016=4 \cdot 504=4 \cdot 4 \cdot 126=4 \cdot 4 \cdot 2 \cdot 7 \cdot 9=2^{5} \cdot 3^{2} \cdot 7$.

Taking this into account, the vertical side is no more than 31, and the horizontal side is no more than 42 (these are the largest divisors of the numbers 2015 and 2016 that are less than 45). Therefore, the sides of the intersection do not exceed 31 and 42, and the area is no more than $31 \cdot 42=1302$. The case of equality is obviously achieved for rectangles $65 \times 31$ and $42 \times 48$, aligned, for example, by the top-left cells.

Answer: 1302.