Pankaj likes to eat Ice cream when he is working late into the night. Today has been yet another long day for Pankaj. So, he wants to eat ice cream now. He opens the fridge and sees that he has 2 types of containers holding the ice cream.
The first container is a cone with radius r1 and height h1. There is also a hemisphere on the top of the cone which has the same radius. The other container is a cylindrical with radius r2 and height h2. Pankaj wants to know the amount (volume) of ice cream in both the containers. Since Pankaj is tired after coding all day, you have to help him with this task.

-----Input-----
- The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
- Each test case consists of a single line having the r1, h1, r2 and h2. Each value is given upto 2 decimal places. See example for more information.

-----Output-----
- For each test case, output a single line containing the volumes of the two containers separated by space. The answer is considered correct if it is correct upto 6 decimal places.

-----Constraints-----
- 1 ≤ T ≤ 100
- 0 <  r1, h1, r2, h2 ≤ 100

-----Example-----
Input:
2
1.00 1.00 1.00 1.00
3.02 7.23 5.20 6.00

Output:
3.141592654 3.141592654
126.739919445 509.691992118

Difficulty: interview

Starter code:

Solutions:
import math
t=eval(input())
while t:
    t=t-1
    r1,h1,r2,h2=list(map(float,input().split()))
    vol1=(math.pi*r1*r1*h1)/3 + (2*math.pi*r1*r1*r1)/3
    vol2=math.pi*r2*r2*h2
    print("%.8f %.8f" % (vol1,vol2))



import math
inputs = eval(input())
for i in range(inputs):
	inpu = input().split()
	r1 = float(inpu[0])
	h1 = float(inpu[1])
	r2 = float(inpu[2])
	h2 = float(inpu[3])
	s_r = math.pi * r2 * r2 * h2 
	f_r = 4.0 / 6.0 * math.pi * r1 * r1 * r1
	f_r += math.pi * r1 * r1 * (h1 / 3.0)
	print("%f %f" % (f_r,s_r))

import sys,math

PI = math.pi
for __ in range(eval(input())) :
    r1 , h1 , r2 , h2 = list(map(float , sys.stdin.readline().split()))
    print("%.6f %.6f"%((((float(1)/float(3)) * PI * r1 * r1 * h1) +((float(2)/float(3))*PI*r1*r1*r1)),( PI * r2 * r2 * h2)))


from math import pi as p
#print p
for II_II in range(eval(input())):
    r1,h1,r2,h2=list(map(float,input().split()))
    a1=((p*r1*r1*h1)/3)+((2*p*r1*r1*r1)/3)
    a2=(p*r2*r2*h2)
    print('%.9f' % a1 ,'%.9f' % a2)


for i in range(eval(input())):
    r1,h1,r2,h2=list(map(float,input().split()))
    a= ((3.1415926535897932*(r1**2)*h1)/3)+((2* 3.1415926535897932*(r1**3))/3)
    b= ((3.1415926535897932*(r2**2)*h2))
    print('%.9f' % a ,'%.9f' % b)
    


import math
t = int(input())

for i in range(t):
    r1, h1, r2, h2 = [float(x) for x in input().split()]

    #pi = 3.141592654
    pi = math.pi
    temp1 = (((r1**2) * pi) * (h1 + 2*r1))/3
    temp2 = pi * (r2**2) * (h2)

    print('%.8f' %temp1, '%.8f' %temp2)


from decimal import Decimal
for _ in range(0,eval(input())):
    [r1,h1,r2,h2],p=list(map(Decimal,input().split())),Decimal(3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603)
    print(p*(r1**2)*(h1+Decimal(2.0)*r1)/3, p*(r2**2)*h2)

from math import pi
for _ in range(int(input())):
  r1, h1, r2, h2 = list(map(float, input().split()))
  print("%0.6f %0.6f"%(r1 ** 2 * pi * h1 / 3 + r1 ** 3 * pi * 2 / 3, r2 ** 2 * pi * h2))


import sys
pi=3.1415926535897
t=int(sys.stdin.readline())
for tc in range(t):
    r1,h1,r2,h2=list(map(float,sys.stdin.readline().split()))
    v=pi*r1*r1*h1/3
    v+=(pi*r1*r1*r1*4.0/3.0)/2.0
    c=pi*r2*r2*h2
    print("%.9f" % v,"%.9f" % c)
    

import math
pi=math.pi
for t in range(int(input())):
    r1,h1,r2,h2=list(map(float,input().split()))
    v_1=(pi*(r1**2)*h1)/3
    v_2=(2*pi*(r1**3)/3)
    v_3=(pi*(r2**2)*h2)
    a=v_1+v_2
    b=v_3
    print("%.7f"%a,"%.7f"%b)

import math
pi=math.pi
#print pi
t=eval(input())
while(t!=0):
    a=list(map(float,input().split(' ')))
    vc=pi/3*(a[0]*a[0]*a[1]+2*a[0]*a[0]*a[0])
    vp=pi*a[2]*a[2]*a[3]
    print("%.10f %.10f"%(vc,vp))
    t=t-1 

from math import pi
def solve():
	s = input().split(' ')
	r1 = float(s[0])
	h1 = float(s[1])
	r2 = float(s[2])
	h2 = float(s[3])
	vCone = (1.0/3 * pi * r1 * r1 * h1) + (2.0/3 * pi * r1 * r1 * r1)
	vCyl = pi * r2 * r2 * h2;
	print('%0.6f %0.6f' %(vCone, vCyl))

t = int(input())
i = 0
while i < t:
	solve()
	i+=1