
ZOJ Problem Set  3898
Tom is good at making stean, he can make steans of various color and shape. Now he want to know how many water it can contain, and how many material he need to making a stean. The shape of the stean follows rules below: 1. The horizontal projection is a circle. The front projection contains two cosine curve. Tom can pour water from the top of stean. 2.To describe it more clearly, Tom constructs a cylindrical coordinate system. Tom is a strange person, because if there no stean at all when Z_{1} is equal to Z_{2}, he still asks you. Tom tells you origin of coordinates is on the axis of cylinder , Zaxis is the axis of cylinder. And he measures that the height of undersurface Z_{1} and the height of upsurface of the stean Z_{2}. And he find the formula of cosine curve is R = 2 + cos(Z).Here Z is the inner circle's radius. Now you need to tell him the capacity and the area of internal surface, which are in direct proportional to water tank capacity and material needed. You need to be precise to two digits after float point. InputThe first line of the input contains a single integer T (1 <= T <= 300), which denotes the number of test cases. Then each line contains a case, consisted by a pair of integer numbers Z_{1} and Z_{2} (Z_{1} <= 1000.00, Z_{2} <= 1000.00). They are separated by a space. OutputThere are T lines, each line contains a floating point number, the capacity and the area of internal surface. It uses "%.2f" format. No extra space key is permited! Sample Input2 0 3.14159 0.0001 0.0 Sample Output44.41 76.28 0.00 28.27 Author: WANG, Xinglu Source: ZOJ Monthly, September 2015 