import math
output = list()
val = raw_input()
t = int(val)
for i in range(t) :
	nums = list()
	string1 = raw_input()
	nums = string1.split()
	a = float(nums[0])
	b = float(nums[1])
	bh = ((a/2.0)-math.sqrt(math.pow((a/2.0),2)-(6*b)))/6.0
	l = (a/4.0)-(2*bh)
	v = (math.pow(bh,2))*l
	output.append(v)
for i in range(t) :
	print("%.2f" %output[i])