In an

by

grid, there are

rectangles, each described by a tuple
)
(

), indicating that the rectangle covers all cells from row

to

and from column

to

. For a collection of rectangles, their intersection is defined as the set of all cells that are covered by all these rectangles simultaneously. If no cell is covered by all these rectangles simultaneously, we consider the intersection of these rectangles to be empty.
Now, you need to select some rectangles from the given

rectangles
such that their intersection is non-empty, and you should
minimize the number of cells contained in the intersection of these rectangles. You only need to output the
number of cells contained in the intersection of these rectangles.
输入描述:
The first line of input contains three positive integers
,
, and
(
), representing the number of rows and columns in the grid, and the number of rectangles, respectively.
Then
lines follow, each containing a description of one rectangle. Each rectangle's description consists of
numbers
(
), indicating that the rectangle covers all cells from row
to
and from column
to
.
输出描述:
Output a positive integer in a line, denoting the answer.
示例2
输入
复制
19 19 4
1 9 10 9
9 10 9 19
11 1 11 10
10 11 19 11