#!/usr/bin/env python3 from math import * def chk(n): #returns the area of an n-polygon side=(X-n*x)/n/2 return n*side*side/tan(pi/n) for _ in range(int(input())): x,X=map(int,input().split()) if x*3>=X:print(0);continue #Pahom needs at least 3 markers lo=3;hi=X//x while hi-lo>2: m=(hi+lo)//2 if chk(m)>=chk(m+1):hi=m+1 else:lo=m print(max(chk(i) for i in range(lo,hi+1)))