from math import sqrt


def maxvol(p, s):
    a = sqrt(p * p - 24 * s)
    b = p * p - 48 * s
    c = - (a + p) * (p * a + b)
    d = - (a - p) * (p * a - b)
    return max(c, d)/1728

for _ in range(int(raw_input())):
    l, m = map(float, raw_input().split())
    print '%.2f' % maxvol(l, m)