CIRCIRC - Missing Side


It is well known that every triangle has an unique incircle and an unique circumcircle. Given the lengths of two sides of a triangle, determine the length of the missing side, such that the area between incircle and circumcircle is as small as possible.

Input

Input starts with a positive integer t≈10000 in a single line, then t lines follow.
Each of the t lines contains the lengths of two sides of a triangle, separated by a single space.
All values are given with four digits after the decimal point and are not larger than 100.

Output

For every testcase print the length of the missing side that satisfies the condition given above, rounded to four digits after the decimal point. If there is no unique solution, print "ambiguous" (without quotes) instead.

Example

Input:
2
1.8491 3.5678 
7.5000 5.1480 

Output:
3.1416
6.0000

hide comments
Gavrilo Milicevic: 2016-04-20 12:05:54

Can someone give me test case where answer is "ambiguous"?


Added by:numerix
Date:2014-12-30
Time limit:0.5s
Source limit:5000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:own problem