Covering
Covering
A large rectangle with sides parallel to the coordinate axes is given, which non-adjacent vertices are the points (0, 0) and (n, m). It contains k smaller rectangles, also with sides parallel to the coordinate axes, which are given by non-adjacent vertices. The coordinates of the i-th rectangle are non-negative integer values (ai
, bi
) and (ci
, di
).
Find the area of the largest rectangle that is not covered by the inscribed rectangles.
Input
The first line contains the values n, m, k (1 ≤ n, m ≤ 10000, 1 * ≤ *k ≤ 100), specifying the dimension of the large rectangle and the number of inscribed rectangles, respectively.
The next k lines contain the coordinates of the inscribed rectangles (0 ≤ ai
, ci
≤ n, 0 ≤ bi
, di
≤ m).
Output
Print the area of the largest rectangle that will remain uncovered by the inscribed rectangles.
3 3 2 1 0 2 3 0 3 3 2
4