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

12619번 - Lights (Small) 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 512 MB154327.273%

문제

In a big, square room there are two point light sources: one is red and the other is green. There are also n circular pillars.

Light travels in straight lines and is absorbed by walls and pillars. The pillars therefore cast shadows: they do not let light through. There are places in the room where no light reaches (black), where only one of the two light sources reaches (red or green), and places where both lights reach (yellow). Compute the total area of each of the four colors in the room. Do not include the area of the pillars.

입력

  • One line containing the number of test cases, T.

Each test case contains, in order:

  • One line containing the coordinates x, y of the red light source.
  • One line containing the coordinates x, y of the green light source.
  • One line containing the number of pillars n.
  • n lines describing the pillars. Each contains 3 numbers x, y, r. The pillar is a disk with the center (x, y) and radius r.

The room is the square described by 0 ≤ x, y ≤ 100. Pillars, room walls and light sources are all disjoint, they do not overlap or touch.

Limits

  • All input numbers are integers.
  • 1 ≤ T ≤ 15
  • 0 ≤ x, y ≤ 100
  • 1 ≤ r ≤ 49
  • 0 ≤ n ≤ 1

출력

For each test case, output:

Case #X:
black area
red area
green area
yellow area

where X is the test case number, starting from 1, and each area is a real number.

Any answer with absolute or relative error of at most 10-5 will be accepted.

제한

예제 입력 1

1
5 50
95 50
1
50 50 10

예제 출력 1

Case #1:
0.7656121
1437.986
1437.986
6809.104

힌트

출처

Contest > Google > Code Jam > Google Code Jam 2009 > World Finals F1번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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