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
2015-08-21 19:59:37
Simply use the formula of soddy(inner) circle.... :)

Last edit: 2015-08-21 19:59:57
2015-08-13 20:41:06 Mohd Ausaf Jafri
the inner soddy circle
2015-06-04 12:01:32 Caesar Flickerman
Direct Formula!!!!
2014-12-20 17:24:53 Apoorva
my submission id is 13223010..i am using descartes formula to solve this and i get the right answer on my compiler..but still i am getting wrong answer here...pls help
2014-08-31 13:08:10 Vidur Katyal
in c/c++ take r1,r2,r3 as double. int costed me 2 WAs :(
2014-06-07 09:55:11 Sankaranarayanan G
datatypes play a major role. got WA after many submissions of a silly mistake.
2014-06-03 20:45:18 (Tjandra Satria Gunawan)(曾毅昆)
@all: when I make this problem, I don't know there are famous name of this problem. I derive formula using basic geometry knowledge, without finding it on other sources :)

Last edit: 2014-06-03 20:45:49
2014-05-30 10:46:13 `Ak
use scanf and printf instead of cin cout
2014-05-28 01:05:44 simararorarox9
soddy circles for 3 tangent circles.. standard problem
2014-05-23 21:40:08 pvkcse
looking like kissing circles and when i apply descartes formula something wrong occurs...more work for pen and paper...

Finally got AC...brackets played the game...!!!

Last edit: 2014-05-23 21:48:12
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.