import sys
from math import sqrt
T = int(raw_input())
while T>0:
        P,S = map(int,raw_input().split())
        a=(P-sqrt(P**2- 24*S))/12
        b=P/4-2*a
        
        print round(a**2*b,2)
        T-=1