Everyone loves short problem statements.
Given a function $ f(x) $ find its minimum value over the range $ 0 < x < π/2$
$
f(x) = ( x^2 + b*x + c ) / sin( x )
$
-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, two real numbers $b, c$. 
-----Output:-----
For each test case, output the minimum value of $ f(x) $ over the given range. Absolute error of $10^{-6}$ is allowed.
-----Constraints-----
- $1 \leq T \leq 100000$
- $1 \leq b,c \leq 20$
-----Sample Input:-----
1
2 2
-----Sample Output:-----
5.8831725615
import sys
import math
input=sys.stdin.readline
def binary(l,r,co,b,c):
 x=(l+r)/2
 #print(x)
 val1=(2*x+b)*math.sin(x)
 val2=(x**2+b*x+c)*math.cos(x)
 x=(l+r)/2
 val=val1-val2
 if(abs(val)<.0000001 or co==150):
  return (l+r)/2
 if(val<0):
  return binary((l+r)/2,r,co+1,b,c)
 else:
  return binary(l,(l+r)/2,co+1,b,c)
t=int(input())
for _ in range(t):
 b,c=list(map(float,input().split()))
 x=binary(.0000000001,math.pi/2-.0000000001,0,b,c)
 #print("t=",_)
 val=(x*x+b*x+c)/math.sin(x)
 print(val)
 

 


 
 
 


 

import sys
import math
input=sys.stdin.readline
def binary(l,r,co,b,c):
 x=(l+r)/2
 #print(x)
 val1=(2*x+b)*math.sin(x)
 val2=(x**2+b*x+c)*math.cos(x)
 x=(l+r)/2
 val=val1-val2
 if(abs(val)<.0000001 or co==150):
  return (l+r)/2
 if(val<0):
  return binary((l+r)/2,r,co+1,b,c)
 else:
  return binary(l,(l+r)/2,co+1,b,c)
t=int(input())
for _ in range(t):
 b,c=list(map(float,input().split()))
 x=binary(.0000000001,math.pi/2-.0000000001,0,b,c)
 #print("t=",_)
 val=(x*x+b*x+c)/math.sin(x)
 print(val)
 

 


 
 
 


 
