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

26346번 - Simi Circles 다국어

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

문제

Arup has a step-daughter, Simi, at home, so he’s frequently in charge when she’s swimming with her friends. Unfortunately, after she’s done, Simi will run inside the house without completely drying herself. As she scurries through the house to the bathroom, she leaves drops of water that fall on the floor. Naturally, Arup’s wife, Anita, blames him for not properly watching the kids and making sure they properly dry themselves before entering the house. Anita will say that the wood was ruined by the water damage. But, of course, Arup realizes that not all of the wood is ruined. Thus, he only wants to take responsibility for the area of the wood floor that has water on it.

When Simi runs through the house, each drop of water hits the ground and forms a perfect circle. Furthermore, she runs fast enough that any drop at most intersects with the previous drop and no others. Sometimes a drop does not intersect with the previous drop. This means that any individual drop can at most intersect with two drops: the one before it and the one after it. Assume that each drop (circle) covers some area of the wood floor. In particular, assume that a circle will not be completely encompassed (covered) by another circle.

Given a list of circles, where a circle in the list may only intersect the previous circle on the list and the subsequent circle on the list, determine the total area that the circles cover.

입력

The first input line contains a single positive integer, n (1 ≤ n ≤ 100), indicating the number of Simi circle scenarios to consider. Each of the n input sets follows. The first line of each input set contains only an integer, c (1 ≤ c ≤ 100), representing the number of drops for the input set. The following c lines contain information about each drop, one drop per line, in the order that the drops occurred. Each of these lines contains exactly three real numbers (each separated from the next by a single space): x (-3000 < x < 3000), y (-3000 < y < 3000), and r (0 < r < 10), representing (respectively) the x and y coordinates of the center of the drop (in cm) and the radius of the drop (in cm).

출력

For each Simi circle scenario, first output “Set #i: ” where i is the input set number, starting with 1. Follow this with a single positive real number rounded to 2 decimal places, representing the total area (in cm2) covered by all of the drops for the Simi circle scenario. Thus, if the actual area is 31.674 cm2, output 31.67 and if the actual area is 31.675 cm2, output 31.68.

a blank line after the output for each test case. Follow the format illustrated in Sample Output.

제한

예제 입력 1

3
2
0 0 1
0 2 1
2
0 0 5
6 0 5
1
0.1 0.1 0.1

예제 출력 1

Set #1: 6.28
Set #2: 134.71
Set #3: 0.03

힌트

If you need to use pi in your program, use the value 3.1415926535898.

출처

University > University of Central Florida > 2012 Local Programming Contest 9번

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

출처

대학교 대회

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

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