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

18561번 - Everything Has Changed 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB34251565.217%

문제

Edward is a worker for Aluminum Cyclic Machinery. His work is operating mechanical arms to cut out designed models. Here is a brief introduction to his work.

Assume the operating plane as a two-dimensional coordinate system. At first, there is a disc with center coordinates (0, 0) and radius R. Then, m mechanical arms will cut and erase everything within its area of influence simultaneously, the i-th area of which is a circle with center coordinates (xi, yi) and radius ri (i = 1, 2, . . . , m). In order to obtain considerable models, it is guaranteed that every two cutting areas have no intersection and no cutting area contains the whole disc.

Your task is to determine the perimeter of the remaining area of the disc excluding internal perimeter.

Here is an illustration of the sample, in which the red curve is counted but the green curve is not.

입력

The first line contains one integer T, indicating the number of test cases.

The following lines describe all the test cases. For each test case:

The first line contains two integers m and R.

The i-th line of the following m lines contains three integers xi, yi and ri, indicating a cutting area.

1 ≤ T ≤ 1000, 1 ≤ m ≤ 100, −1000 ≤ xi, yi ≤ 1000, 1 ≤ R, ri ≤ 1000 (i = 1, 2, . . . , m).

출력

For each test case, print the perimeter of the remaining area in one line. Your answer is considered correct if its absolute or relative error does not exceed 10−6.

Formally, let your answer be a and the jury’s answer be b. Your answer is considered correct if |a−b|/max(1,|b|) ≤ 10−6.

제한

예제 입력 1

1
4 10
6 3 5
10 -4 3
-2 -4 4
0 9 1

예제 출력 1

81.62198908430238475376

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2019 > Day 2: Jingzhe Tang Contest E번

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

출처

대학교 대회

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

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