아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Three Countries

시간 제한1초메모리 제한512 MB

요약
세 원이 주어질 때 합집합의 볼록 껍질 넓이를 구한다. 바깥쪽 두 공통 접선과 양 끝 원의 호로 이루어진다.
난이도

보통10점 중 7점

유형
기하, 수학, 구현
정답자
아직 제출이 없습니다

문제

Today, you want to measure the accessible area of Teyvat.

Mondstadt, Liyue, and Inazuma are the three countries in Teyvat. The territories of these countries can be regarded as three circles c_1c\_1, c_2c\_2, and c_3c\_3, respectively. It is possible that some of the circles overlap.

Let S_iS\_i be the set of points in c_ic\_i. The area of Teyvat, SS, is defined as the convex hull of points in S_1∪S_2∪S_3S\_1 \cup S\_2 \cup S\_3.

Formally, SS is the smallest set of points satisfying the following two conditions:

  • S⊇S_1∪S_2∪S_3S \supseteq S\_1 \cup S\_2 \cup S\_3,
  • ∀p_1,p_2∈S,∀α∈\[0,1],αp_1+(1−α)p_2∈S\forall p\_1, p\_2 \in S, \forall \alpha \in \[0, 1], \alpha p\_1 + (1-\alpha)p\_2 \in S.

You are given the circles c_1c\_1, c_2c\_2, and c_3c\_3. Your task is to calculate the area of SS.

입력

The first line contains a single integer tt, the number of test cases (1≤t≤1041 \leq t \leq 10^4).

Each test case is given on three lines. The ii-th of these lines contains three integers, xx, yy, and rr, which are the coordinates of the center and the radius of ii-th circle (1≤x,y,r≤1001 \leq x, y ,r \leq 100).

출력

For each test case, output a single real number representing the area of SS. 

Your answer will be considered correct if its absolute or relative error when compared with the jury's answer is no more than 10−610^{-6}.

예제1

  1. 예제 1

    입력
    3
    1 1 1
    2 1 1
    3 1 1
    1 1 1
    2 2 1
    3 3 1
    1 1 100
    85 27 100
    53 82 100
    
    예상 출력
    7.14159265359
    8.79844690308
    58923.76801932990