Shadow

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

As we all know, Earth is a unlimited plane in a 3D space and the sun is just a tiny ball shining evenly in all directions, for simplicity represented as a single point in a 3D space. One day the Death Star comes. The Death Star is a sphere with radius RR. Because it is really big, some area on Earth was covered by the shadow. Your task is to calculate the area of the shadow, given the initial positions of Earth, the Death Star and the sun.

입력

In the first line one integer Z104Z \le 10^4 is given, denoting number of testcases described in following lines.

The first line of each test case contains three integers X_sX\_s, Y_sY\_s, Z_sZ\_s meaning the initial sun coordinates. The second line contains four integers X_dX\_d, Y_dY\_d, Z_dZ\_d and RR meaning the position of the center of the Death Star and its radius. The third and last line contains four integers AA, BB, CC and DD meaning that Earth is a plane consisting of points (x,y,z)(x, y, z) such that Ax+By+Cz+D=0Ax + By + Cz + D = 0. You may assume that Earth, the Death Star and the sun are disjoint (they have no common points) and that the answer is greater than 00 and not infinity.

출력

For each test case, the first and only line of the standard output should contain one real number, meaning the area of the shadow cast by the Death Star on Earth. Your answer will be accepted, if the relative or absolute error will not exceed 10610^{-6}.

제한

  • X_s,Y_s,Z_s\[104,104]X\_s, Y\_s, Z\_s \in \[-10^4, 10^4]
  • X_d,Y_d,Z_d\[104,104]X\_d, Y\_d, Z\_d \in \[-10^4, 10^4], R\[1,104]R \in \[1, 10^4]
  • A,B,C,D\[104,104]A, B, C, D \in \[-10^4, 10^4]