import math
for i in range(int(raw_input())):
    
    p,s=map(int,raw_input().split())
    
    a1=(p+math.sqrt(p**2-24*s))/12
    a2=(p-math.sqrt(p**2-24*s))/12
    
    b1=p/4-2*a1
    b2=p/4-2*a2
    
    print round(max(a1*a1*b1,a2*a2*b2),2)