Practice · 4 of 5
Poster Wall
CHALLENGE
Difficulty: intermediate+25 XP
**Description:** A wall is an n x m grid. Stick q rectangular posters: every cell of
rectangle (r1, c1) - (r2, c2) gets one layer. Print the maximum number of layers
on any cell.
**Input:** Line 1: n m q (1 <= n, m <= 1000, 1 <= q <= 2*10^5). Next q lines:
r1 c1 r2 c2.
**Output:** One integer — the maximum layer count.
**Example:** 3 3 2 / 1 1 2 2 / 2 2 3 3 -> 2 (cell (2,2) gets both posters).
Press Submit to check your solution.
Back to lesson: Practice: Difference Array Problem Set