from math import sqrt

def bestBox():
    t = int(raw_input())
    
    while (t>0):
        t-=1
        
        P,S = map(float, raw_input().split())
        
        #print "The length of the wire is: ", P, " and the area of the paper is: ", S
        
        x1 = float(0)
        z1 = float(0)
        x2 = float(0)
        z2 = float(0)
        
        x1 = (P+sqrt( P**2 - 24*S))/12
        x2 = (P-sqrt( P**2 - 24*S))/12
        
        z1 = (P - 8*x1)/4
        z2 = (P - 8*x2)/4
        
        #print "The two sets of values are: "
        #print "x1: ", x1
        #print "x2: ", x2
        #print "z1: ", z1
        #print "z2: ", z2
        
        v1 = x1 * x1 * z1
        v2 = x2 * x2 * z2
        
        print max(round(v1,2),round(v2,2))
    
    pass

bestBox()