BLCONE  Painting Hat
In preparations for Jeffroy's birthday party, his mom, named Cirsie, assigns her employees to paint the hats to be used in the party. Each hat is cone shaped with height H and radius R. Cirsie and her employees then go to the store to buy the paint. Since there is no container for the paint, all bought paint will be stored inside each hat.
Here is how the paint is stored:
It is known that 1 unit of paint volume is enough to paint exactly 1 unit of hat area. To be as efficient as possible, all bought paint must be used to paint the hat. Each hat will be filled with paint until it reaches a height h. All the paint inside the hat must be used to paint that hat inside and out (ignore depth). Part of the hat that have been submerged in paint don't need to be painted. If the hat can't contain enough paint, it's filled until it's full.
Input
First line is N, number of birthday parties (1 < N < 10000). Next N line contains the hat used in each birthday party, containing 2 integers R and H (1 < R,H < 100)
Output
For each birthday party, output h, the height of paint that Cersei bought. Output until 6 digit after decimal point.
Example
Input: 3 4 6 6 4 2 10 Output: 5.874692 3.916461 10.000000
hide comments
adarshraj365_:
20200422 16:46:19
I am trying to solve this by just applying mathematical formula, But it is giving WA please help !


prabhat236218:
20171230 21:25:55
can anyone provide the hint for this. 

mhz2:
20170712 18:27:29
NACP class comes into play! 

Andy:
20161123 17:06:53
It means you can safely assume that the hat's thickness is 0. Last edit: 20161123 17:07:03 

Chinmay Kousik:
20161122 15:25:13
what does the question mean by ignore depth?


rajat_kumar:
20160819 09:56:50
. Last edit: 20160903 17:37:50 

ASHUTOSH DWIVEDI:
20160718 20:49:48
@Vipul Srivastava You are welcome 

Vipul Srivastava:
20160718 19:30:45
@ASHUTOSH DWIVEDI thanks a lot for your help I was doing a very silly mistake and your reply helped me to rectify it :) 

ASHUTOSH DWIVEDI:
20160718 15:12:41
Last edit: 20160718 20:47:43 

Vipul Srivastava:
20160717 19:39:41
can you give me the answer for R=100, H=100? 
Added by:  Andy 
Date:  20160714 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 GOSU JSMONKEY 
Resource:  BLPCS3 