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

7156번 - Unreal Estate 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
10 초 128 MB86242027.027%

문제

A dishonest landowner is selling off plots of land. He’s selling it in large, rectangular plots, but many of the plots overlap, so he’s actually selling the same land multiple times! It’s not real estate, it’s unreal estate!

Given a description of the possibly overlapping rectangular plots of land that the dishonest landowner has sold, determine the total actual area of land covered by them.

입력

There will be several test cases in the input. Each test case will begin with a line with a single integer n (0<n≤5,000), indicating the number of plots of land sold. The next n lines will each have a description of a rectangular plot of land, consisting of four real numbers:

x1 y1 x2 y2

where (x1,y1) is the southwest corner, and (x2,y2) is the northeast corner (-1,000≤x1<x2≤1,000, -1,000≤y1<y2≤1,000). Every plot will have an area of at least 1.

The input will end with a line with a single 0.

출력

For each test case, output a single real number, which represents the total actual area covered by all of the rectangular plots of land. Output this number with exactly two decimal places, rounded. Do not print any spaces. Do not print any blank lines between outputs.

제한

예제 입력 1

2
0 0 100 100
30 30 60 60
2
0 100 300 200
100 0 200 300
0

예제 출력 1

10000.00
50000.00

힌트

출처

University > North American Invitational Programming Contest > UCIPC 2013 I번

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

출처

대학교 대회

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

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