LearnPy Hub
← Arena
AdvancedRating 1900

Area Covered by Many Rectangles

Rectangles have sides parallel to the axes, given as 'x1 y1 x2 y2' (bottom-left and top-right). Print the total area they cover (overlaps counted once).

Input

n (≤ 100); then n lines.

Output

One integer.

Sample 1

Input
3
0 0 2 2
1 0 2 3
1 0 3 1
Output
6

Sample 2

Input
1
0 0 1000000000 1000000000
Output
1000000000000000000
solution.py
Output appears here
Area Covered by Many Rectangles · Python Arena problem · LearnPy Hub