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.


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.


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.


1 1 1
10 10 10
23 46 69



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

See also: Another problem added by Tjandra Satria Gunawan

hide comments
mishra_sharad: 2016-08-14 21:23:10

don't be confused by integer inputs mentioned in problem....use double otherwise WA is waiting for u...long long int costed me one WA...

ritik_agr: 2016-07-08 09:11:51

use of formula only

vineetpratik: 2016-07-06 11:43:38

the inner soddy circle

shubham9466: 2016-03-13 17:19:10

for c/c++: Use double for taking radius input
costed me a wrong ans..

street_funker: 2016-02-23 18:52:50

use double

rishabh_1997: 2016-02-15 19:45:52

too easy if u know the formula...
For math geeks, i prefer you to find formula yourself...

try2catch: 2016-02-03 02:28:13

50th! ^_~'
Man! I was waiting to post this comment .Took me 1 month.

ragwave: 2016-01-02 13:17:04

use setiosflags(ios::fixed) to avoid large answer in exponential form!!

hmp: 2015-12-18 06:22:08

equate 3 smaller triangle's area to a larger triangle area and get required radius.

kiner_shah: 2015-11-05 10:03:23

Soddy circles! Got it! AC!

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