__author__ = 'deveshbajpai'

from math import sqrt


def solve(p,s):

    det = sqrt((p*p)-(24*s))

    b1 = (-p + det)/(-12)
    b2 = (-p - det)/(-12)

    c1 = p/4 - (2*b1)
    c2 = p/4 - (2*b2)

    return round(max(b1*b1*c1,b2*b2*c2),2)

if __name__ == "__main__":

    cases = int(input())
    results = []
    for case in range(cases):
        p,s = map(int,raw_input().split(" "))
        results.append(solve(p,s))

    for result in results:
        print result