import math
t=int(raw_input())
while t>0:
    line=raw_input()
    line=line.split()
    p=int(line[0])
    s=int(line[1])
    h= (p-math.sqrt(p**2-24*s))/12
    l=p/4-2*h
    vol=l*h*h
    print '%.2f'%vol  
    t-=1