#P8734. [蓝桥杯 2020 国 A] 奇偶覆盖
[蓝桥杯 2020 国 A] 奇偶覆盖
Problem Description
There are some rectangles on the plane, and both of their sides are parallel to the coordinate axes.
We say that a point is covered by a rectangle if the point lies inside the rectangle or on its boundary.
Find the areas of the regions covered by an odd number of rectangles, and covered by an even number of rectangles, respectively.
Input Format
The first line contains an integer , which denotes the number of rectangles.
The next lines describe the rectangles. The -th line contains four integers , meaning that the two diagonal corners of the rectangle are and .
Output Format
Output two lines.
The first line contains an integer, the area of the region covered by an odd number of rectangles.
The second line contains an integer, the area of the region covered by an even number of rectangles.
3
1 1 3 3
2 2 4 4
3 3 5 5
8
2
Hint
For of the test cases, , , .
For of the test cases, , , .
For of the test cases, , , .
For of the test cases, , , .
For all test cases, , , .
Lanqiao Cup 2020 National Contest, Group A, Problem I.
Translated by ChatGPT 5