CIRCLE_M - Three Circle Problem (MEDIUM)

no tags 

Given 3 distinct circles with positive integer radius R1,  R2, 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 = 104) denoting number of test cases, than T lines follow.

For each lines, there are three integer R1, R2, and R3 (0 < {R1, R2, R3} < 1020) 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. Truncate the output to 50 digit after decimal point.

Example

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

Output:
0.15470053837925152901829756100391491129520350254025
1.54700538379251529018297561003914911295203502540253
6.00000000000000000000000000000000000000000000000000

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

See also: Another problem added by Tjandra Satria Gunawan


hide comments
যোবায়ের: 2013-11-16 19:27:01

The same logic passes the easy version, may be I am doing things wrong when writing the output (New to python). Does the judge make an exact match with the output? By truncating the output to 50 digits after decimal point, does it anyway mean the precision is also 50 digits after decimal point?

Nick: 2013-07-12 12:51:31

Anyone can help me?
I have problem with output precision in Java Program..

Input:
1
1 1

Output:
0.15470053837925152901829756100400000000000000000000

Last edit: 2013-07-12 12:51:54
Francky: 2013-04-06 21:20:07

As this problem can be solved with exactly the same code of the hard edition, this one should leave classical. In agreement with Tjandra who ask me to move it.
I think the best place is not hidden, but rather tutorial. This edition will be helpful for solver of Three Circle Problem (hard).

Francky: 2013-04-06 14:54:39

OK, I found my error, it was just next after the decimal point, wrong zero padding... And Python3 Check OK ;-) It's a good problem.
Ans: Thanks for your appreciation :-)

Last edit: 2013-04-06 18:02:33

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