#K2681. Combined Force Field Volume Calculation
Combined Force Field Volume Calculation
Combined Force Field Volume Calculation
You are given several test cases, each representing a set of force field stations. Each station is defined by its 3D coordinates (x, y, z) and a radius. The volume of a station's force field is calculated using the formula: $$V = \frac{4}{3}\pi r^3$$.
For each test case, compute the total volume of all stations. The input terminates with a single line containing 0. For each test case, output the sum of the volumes on a separate line with exactly 5 digits after the decimal point.
inputFormat
The input consists of multiple test cases. Each test case begins with an integer N (the number of force field stations). This is followed by N lines, each containing four space-separated integers: x, y, z, and r, where r is the radius of the station. The input ends when a line containing a single 0 is encountered.
outputFormat
For each test case, output a single line containing the total volume of the force fields. The result must be printed with exactly 5 digits after the decimal point.## sample
1
0 0 0 1
0
4.18879
</p>