Three Countries
시간 제한1초메모리 제한512 MB
세 원이 주어질 때 합집합의 볼록 껍질 넓이를 구한다. 바깥쪽 두 공통 접선과 양 끝 원의 호로 이루어진다.
문제
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 , , and , respectively. It is possible that some of the circles overlap.
Let be the set of points in . The area of Teyvat, , is defined as the convex hull of points in .
Formally, is the smallest set of points satisfying the following two conditions:
- ,
- .
You are given the circles , , and . Your task is to calculate the area of .
입력
The first line contains a single integer , the number of test cases ().
Each test case is given on three lines. The -th of these lines contains three integers, , , and , which are the coordinates of the center and the radius of -th circle ().
출력
For each test case, output a single real number representing the area of .
Your answer will be considered correct if its absolute or relative error when compared with the jury's answer is no more than .