Everybody May Get Lost in Space

No attempts yetTime limit1sMemory limit512 MB

Problem

A space shuttle is drifting somewhere in empty space, and its exact position is unknown. To help locate it, the shuttle is equipped with three independent navigation systems.

Each system reports the shuttle's position as coordinates (x,y,z)(x, y, z) together with a bound bb on its measurement error. If a system is working correctly, the shuttle's true position lies within distance bb of the reported point: it is some (x,y,z)(x', y', z') with (xx)2+(yy)2+(zz)2b\sqrt{(x - x')^2 + (y - y')^2 + (z - z')^2} \le b. In other words, each system restricts the shuttle to a solid ball of radius bb centered at its reported point (x,y,z)(x, y, z).

At least one of the three systems is guaranteed to be working, but any of the others may be broken and report arbitrary, meaningless values. Since we do not know which systems are reliable, the shuttle may be located at any point that lies inside at least one of the three balls: if a point lies in some system's ball, then that system alone being the working one is a consistent explanation.

Compute the total volume of the region of all possible positions of the shuttle, which is the volume of the union of the three balls.

Input

The first line contains a single positive integer ZZ (Z10000Z \le 10000), the number of test cases. Each test case is given on three lines. Each of those lines describes one measurement with four integers xx, yy, zz, and bb separated by single spaces, where 109x,y,z109-10^9 \le x, y, z \le 10^9 and 1b1091 \le b \le 10^9. Here (x,y,z)(x, y, z) is the reported position and bb is the error bound, i.e. the radius of that system's ball.

Output

For each test case, print on its own line the volume of the union of the three balls, rounded to exactly six digits after the decimal point.