- Time limit: 1.00 s
- Memory limit: 512 MB
Given rectangles, your task is to determine the total area of their union.
Input
The first input line has an integer : the number of rectangles.
After that, there are lines describing the rectangles. Each line has four integers , , and : a rectangle begins at point and ends at point .
Output
Print the total area covered by the rectangles.
Constraints
Example
Input:
3 1 3 4 5 3 1 7 4 5 3 8 6
Output:
24