spoj#ACC. A Complex Cone
A Complex Cone
当前没有测试数据。
A cone with radius of base 'r' and height 'h', is stretched to the left and right by length 'a' and 'b' respectively such that height of the stretched cones equal the height of the original cone and apexes of all the three cones are colinear.
Write a program to calculate the volume of the union of the two stretched cones (colored blue in attached image).
Input
The first line of input is the number of test cases T. (1 <= T <= 100)
For each test case, there is a single line containing 4 integers 'r', 'h', 'a' and 'b' respectively. (0 < r, h, a, b <= 10)
Output
Output a single line for each test case, containing the volume with 1 decimal place only. Answer should be correct to 1 decimal place without rounding off.
Example
Input
2
1 1 1 1
10 10 10 10
Output
1.4
1491.6