CIRCLE_E - Three Circle Problem (EASY)

no tags 

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


hide comments
prakash_reddy: 2015-08-21 19:59:37

Simply use the formula of soddy(inner) circle.... :)

Last edit: 2015-08-21 19:59:57
Mohd Ausaf Jafri: 2015-08-13 20:41:06

the inner soddy circle

Caesar Flickerman: 2015-06-04 12:01:32

Direct Formula!!!!

Apoorva: 2014-12-20 17:24:53

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

Vidur Katyal: 2014-08-31 13:08:10

in c/c++ take r1,r2,r3 as double. int costed me 2 WAs :(

Sankaranarayanan G: 2014-06-07 09:55:11

datatypes play a major role. got WA after many submissions of a silly mistake.

(Tjandra Satria Gunawan)(曾毅昆): 2014-06-03 20:45:18

@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
`Ak: 2014-05-30 10:46:13

use scanf and printf instead of cin cout

simararorarox9: 2014-05-28 01:05:44

soddy circles for 3 tangent circles.. standard problem

pvkcse: 2014-05-23 21:40:08

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

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