VHELSING - Van Helsings gun

In Transylvania, 1753, Dracula has returned from his long sleep, now, of course, someone needs to face it or humanity will be utterly destroyed by the evil bloodthirsty Dracula.

The only one with enough courage to face Dracula is Van Helsing. The only weapon that can defeat him is the silver gun, but Van Helsing does not know the exact amount of powder required for a deadly shot.

The magazine of gunpowder has the form given by intersection of three cylinders of radius r and infinite height, mutually orthogonal, and centered on the axes $X$, $Y$ and $Z$ in $R^3$, as shown below. Your task is to help Van Helsing calculate the exact amount of gunpowder that he will need, ie, the volume of the powder magazine.

Input

The first line of input contains an integer 1 ≤ T ≤ 100 representing the number of test cases. For each of the following
lines contain an integer 0 ≤ R ≤ 100, as shown above.

Output

For each case print one line containing the amount of gunpowder that Van Helsing needs, with 4 decimal places.

Example

Input:
2
0
1 Output: 0.0000
4.6863

Added by:Paulo Costa
Date:2012-01-16
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:IME/USP 2 - Brazilian ICPC Training Camp, Jan-Feb/2012

hide comments
2013-08-06 19:52:15 The Mundane Programmer
AC in first attempt :D , Easy Maths...
2013-07-11 06:31:15 Vijay Jain
for r=4
ans = 299.9227
2013-06-16 14:53:34 krypten
plz help wht the ans for r = 4??
2013-05-18 16:34:35 shiva_hellgeek
for 73
ans=1823047.0609
2013-03-02 06:24:12 prateek
ans for 73?
2012-12-17 13:22:19 ss
please give some more test case ....... i am getting WA ,,, but i think my code is alright
2012-06-18 22:37:18 Shubham


Last edit: 2012-06-19 10:43:34
2012-06-15 04:11:16 MR. BEAN
for R=100,ans=4686291.5010 :)

Last edit: 2012-06-15 04:11:58
2012-04-16 08:06:20 Xusha J
Could you please tell me the answer to 100?Thanks very much!

Last edit: 2012-04-16 08:12:21
2012-02-22 03:36:37 David Duncan
I've tried every combination of precision and formula calculation that I can think of, but still to no avail. I'm really curious what the value for 100 is supposed to be as well.
EDIT: Got it; I had every value right except for R=73. The lesson (if not obvious to everyone but apparently me): Use the most precision possible with the double type.

Last edit: 2012-07-01 17:50:52
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.