#Lutece0545. Overplanting
Overplanting
Migrated from Lutece 545 Overplanting
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Farmer John has purchased a new machine that is capable of planting grass within any rectangular region of his farm that is "axially aligned" (i.e., with vertical and horizontal sides). Unfortunately, the machine malfunctions one day and plants grass in not one, but () different rectangular regions, some of which may even overlap.
Given the rectangular regions planted with grass, please help FJ compute the total area in his farm that is now covered with grass.
Input
- Line : The integer .
- Lines : Each line contains four space-separated integers specifying a rectangular region with upper-left corner and lower-right corner . All coordinates are in the range .
Output
- Line : The total area covered by grass.
Samples
2
0 5 4 1
2 4 6 2
20
Resources
USACO Feb 2012