Submit | All submissions | Best solutions | Back to list |
BLCONE - Painting Hat |
In preparations for Joffrey's birthday party, his mom, named Cersei, assigns her employees to paint the hats to be used in the party. Each hat is cone shaped with height H and radius R. Cersei 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
Added by: | Andy |
Date: | 2016-07-14 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU JS-MONKEY |
Resource: | BLPCS3 |
hide comments
2020-04-22 16:46:19
I am trying to solve this by just applying mathematical formula, But it is giving WA please help ! |
|
2017-12-30 21:25:55
can anyone provide the hint for this. |
|
2017-07-12 18:27:29
NACP class comes into play! |
|
2016-11-23 17:06:53 Andy
It means you can safely assume that the hat's thickness is 0. Last edit: 2016-11-23 17:07:03 |
|
2016-11-22 15:25:13 Chinmay Kousik
what does the question mean by ignore depth? |
|
2016-07-18 20:49:48 ASHUTOSH DWIVEDI
@Vipul Srivastava You are welcome |
|
2016-07-18 19:30:45 Vipul Srivastava
@ASHUTOSH DWIVEDI thanks a lot for your help I was doing a very silly mistake and your reply helped me to rectify it :) |
|
2016-07-17 19:39:41 Vipul Srivastava
can you give me the answer for R=100, H=100? |
|
2016-07-17 18:00:26 Andy
@Vipul Srivastava Try generating the input yourself, in the output file you can see the mistake (it's very obvious). |
|
2016-07-16 10:33:23 Vipul Srivastava
@ Andy can you please check my recent submission. I am constantly getting WA Last edit: 2016-07-17 13:38:45 |