Now that we have observed the areas formed by intersecting spheres of common radii,
next we will observe the volumes formed by two intersecting spheres of different radii r1 and r2, and each having
centerpoints at some coordinates (x1, y1, z1) and (x2, y2, z2).
What is the total area of the green region bounded by these intersecting spheres?
Input Data
First line will be Q, the quantity of testcases.
Q lines will then follow, each holding a testcase in the format
r1 x1 y1 z1 r2 x2 y2 z2 describing two intersecting spheres.
Answer
Should consists of Q space-separated values corresponding to the volume of the
region formed by the intersection of the two spheres described in each testcase.
Error should be less than 1e-3.
Example
input data:
2
1 0 0 0 2 2 0 0
11 1 12 23 19 11 12 13
answer:
1.702 3987.353