CIRCLE_E - Three Circle Problem (EASY)

Given 3 distinct circles with positive integer radius R1R2, and R3, and arranged like in the picture below:

Three Circle Problem

Now, your task is to compute radius of small circle that can be created like yellow circle in the picture above. All circles in the picture above tangent each other.

Input

The first line in the input data, there is an integer T(0 < T ≤ 103) denoting number of test cases, than T lines follow.

For each lines, there are three integer R1R2, and R3, (0 < {R1,R2,R3} < 109) denoting radius of each circle like in the picture above.

Output

For each test case, output radius of small circle that can be made, like in the picture above. Any output with absolute error less than 10-6 is accepted.

Example

Input:
3
1 1 1
10 10 10
23 46 69

Output:
0.154701
1.547005
6.000000

 

You can see my submission history and time record for this problem: here

See also: Another problem added by Tjandra Satria Gunawan


Added by:Tjandra Satria Gunawan
Date:2013-04-05
Time limit:1s
Source limit:10000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own Problem

hide comments
2013-04-06 11:28:07 Francky
The judge is curious, my first submission (that I think perfectly correct got WA only for output formating...)
Ans: Some output of your WA code have only 3 digits after decimal point, and not accurate enough (absolute error>10^6)..
--ans(francky)--> I know for the digits, eg: 23 46 69 give me 6.0 (and no other zeros), but I don't think it led to imprecision. The next code makes exactly the same computation, the only difference is in output formatting! Could you give a counter-example? I still find it very curious.
Ans(Tjandra): Here is the counter-example
Check for this input:
1
1000000000 1000000000 1000000000
your WA code output:
154700538.379
-----------
But this don't happen if you run your code in python 3.. I suggest to run your code on ideone with that case ;-)
--ans(francky)--> haha, another Py2.7 Curiosity, thanks.

Last edit: 2013-04-06 18:40:52
2013-04-06 08:49:38 Michael Kharitonov
Absolute or relative error?
Ans: it's absolute error of course, problem description has been updated, thanks for your catch :-)

Last edit: 2013-04-06 08:53:16
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.