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 Z1 is equal to Z2, he still asks you. Tom tells you origin of coordinates is on the axis of cylinder , Z-axis is the axis of cylinder. And he measures that the height of undersurface Z1 and the height of upsurface of the stean Z2. 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.
The 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 Z1 and Z2 (|Z1| <= 1000.00, |Z2| <= 1000.00). They are separated by a space.
There 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!
2 0 3.14159 -0.0001 0.0
44.41 76.28 0.00 28.27
Author: WANG, Xinglu
Source: ZOJ Monthly, September 2015