#abc318b. B - Overlapping sheets
B - Overlapping sheets
Score : points
问题描述
在坐标平面上铺有 张矩形纸片。
每张纸片所覆盖的矩形区域的边都与 -轴或 -轴平行。 具体来说,第 张纸片恰好覆盖满足 和 的区域。
令 表示 被一个或多个纸片覆盖的区域 的面积。可以证明,在给定约束下, 是一个整数。 请以整数形式输出 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are rectangular sheets spread out on a coordinate plane.
Each side of the rectangular region covered by each sheet is parallel to the - or -axis.
Specifically, the -th sheet covers exactly the region satisfying and .
Let be the area of the region covered by one or more sheets. It can be proved that is an integer under the constraints.
Print as an integer.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the area of the region covered by one or more sheets as an integer.
Sample Input 1
3
0 5 1 3
1 4 0 5
2 5 2 4
Sample Output 1
20
The three sheets cover the following regions.
Here, red, yellow, and blue represent the regions covered by the first, second, and third sheets, respectively.
Therefore, the area of the region covered by one or more sheets is .
Sample Input 2
2
0 100 0 100
0 100 0 100
Sample Output 2
10000
Note that different sheets may cover the same region.
Sample Input 3
3
0 1 0 1
0 3 0 5
5 10 0 10
Sample Output 3
65
update @ 2024/3/10 09:04:18
相关
在以下作业中: