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 (a[i]
, b[i]
) and (c[i]
, d[i]
).
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 ≤ a[i]
, c[i]
≤ n, 0 ≤ b[i]
, d[i]
≤ m).
Output
Print the area of the largest rectangle that will remain uncovered by the inscribed rectangles.