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

5903번 - Overplanting 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB17411611066.667%

문제

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 N (1 <= N <= 10) 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.

입력

  • Line 1: The integer N.
  • Lines 2..1+N: Each line contains four space-separated integers x1 y1 x2 y2 specifying a rectangular region with upper-left corner (x1,y1) and lower-right corner (x2,y2). All coordinates are in the range -10,000...10,000.

출력

  • Line 1: The total area covered by grass.

제한

예제 입력 1

2
0 5 4 1
2 4 6 2

예제 출력 1

20

힌트

출처

Olympiad > USA Computing Olympiad > 2011-2012 Season > USACO February 2012 Contest > Bronze 2번

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

출처

대학교 대회

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

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