C. [Atc318B] Overlapping sheets

    传统题 1000ms 256MiB

[Atc318B] Overlapping sheets

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Problem Statement

There are NN rectangular sheets spread out on a coordinate plane.

Each side of the rectangular region covered by each sheet is parallel to the xx- or yy-axis. Specifically, the ii-th sheet covers exactly the region satisfying AixBiA_i \le x \le B_i and CiyDiC_i \le y \le D_i.

Let SS be the area of ​the region covered by one or more sheets​. It can be proved that SS is an integer under the constraints. Print SS as an integer.

Constraints

  • 2N1002 \le N \le 100
  • 0Ai<Bi1000 \le A_i < B_i \le 100
  • 0Ci<Di1000 \le C_i < D_i \le 100
  • All input values are integers.

Input

The input is given from Standard Input in the following format: image

Output

Print the area SS of the region covered by one or more sheets as an integer.


3
0 5 1 3
1 4 0 5
2 5 2 4
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 S=20S=20.


2
0 100 0 100
0 100 0 100
10000

Note that different sheets may cover the same region.


3
0 1 0 1
0 3 0 5
5 10 0 10
65

Programming exercise on 21 August

未参加
状态
已结束
规则
XCPC
题目
4
开始于
2024-8-21 17:30
结束于
2024-8-21 18:30
持续时间
1 小时
主持人
参赛人数
2