Logo
(追記) (追記ここまで)

7190번 - Carpets 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB51191562.500%

문제

The fanciest hall of Prince Ville’s new castle has a rectangular floor. The walls of the hall run from North to South and from East to West. Ville’s advisors have proposed to cover some parts of the floor with carpets and even suggested a specific arrangement of them.

Ville, caring mostly only about the quantitative aspect of the deal, would like to know the total area covered by the carpets in the proposed arrangement.

입력

The first line of input contains three space-separated integers: the number of carpets $K$ (1ドル ≤ K ≤ 3$), the distance $L$ from the East wall to the West wall (1ドル ≤ L ≤ 10^6$), and the distance $P$ from the North wall to the South wall (1ドル ≤ P ≤ 10^6$) of the hall. Each of the following $K$ lines contains four space-separated integers $N,ドル $S,ドル $E,ドル and $W$ describing one carpet. The edges of the carpet are parallel to the walls and the numbers $N,ドル $S,ドル $E,ドル and $W$ show, respectively, the distance of the North, South, East, and West edge of the carpet from the corresponding wall. The carpets may overlap partially or fully. All distances are given in metres.

출력

The only line of output should contain a single integer $S,ドル the total area of the floor covered by carpets, in square metres.

제한

예제 입력 1

2 8 9
3 3 3 0
5 1 2 4

예제 출력 1

20

예제 입력 2

3 5 5
3 1 1 3
1 3 3 1
3 1 3 1

예제 출력 2

3

힌트

출처

Olympiad > Estonian Informatics Olympiad > 2014-15 > Open Competition 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /