from math import sqrt
 
def largest_volume(p, s):
    sqrt_delta = sqrt(p*p-24*s)
    L = [(p+sqrt_delta)/12., (p-sqrt_delta)/12.]
    H = [(p-8*L[0])/4.,      (p-8*L[1])/4.]
    V = [L[0]*L[0]*H[0],     L[1]*L[1]*H[1]]
    return max(V)
 
t = int(raw_input())
for i in range(t):
    p, s = map(int, raw_input().split())
    print '%0.2f' % largest_volume(p, s)