TETRA  Sphere in a tetrahedron
Of course a Sphere Online Judge System is bound to have some tasks about spheres. So here is one. Given the lengths of the edges of a tetrahedron calculate the radius of a sphere inscribed in that tetrahedron (i.e. a sphere tangent to all the faces).
Input
Number N of test cases in a single line. ( N <= 30 ) Each of the next N lines consists of 6 integer numbers  the lengths of the edges of a tetrahedron separated by single spaces. The edges are not longer than 1000 and for the tetrahedron WXYZ, the order of the edges is: WX, WY, WZ, XY, XZ, YZ.
Output
N lines, each consisting of a real number given with four digits decimal precision equal to the radius of a sphere inscribed in the given tetrahedron.
Example
Input: 2 1 1 1 1 1 1 1000 999 998 5 5 6 Output: 0.2041 1.4189
hide comments
kaiyu:
20200618 03:14:49
Not a binary search qs!


i_0__0_i:
20200615 10:19:54
order of input of edge is sideedge  sideedge  sideedge  baseedge  baseedge  baseedge Last edit: 20200615 10:27:17 

black_shroud:
20200426 16:27:06
binary search did the trick :D


mohanish2504:
20190414 12:55:31
Do the following:


nguyenthihang:
20180609 12:34:33
input


mayankdhyani:
20180407 21:28:54
If sides are equal then apply the formula r(radii of sphere) = [ side*sqrt(6) ] / 12. i got my code wrong but my answer of first condition (1 1 1 1 1 1) was correct. please someone upload full program of this question. I dont understand if sides are different of tetrahedron then how sphere will get into it with same radii ? Last edit: 20180407 21:31:48 

nik12321:
20170413 11:17:10
Why can't we use the formula for volume of a tetrahedron as


scorpion_ajay:
20170113 19:30:35
mathematics!! 

vinit_coder:
20160813 19:21:17
go to http://rigmer.com and search this problem.


pranjalikumar9:
20160520 21:07:29
Calculate area of faces using herons formula and then radius of insphere is a simple formula r=3*v/(a1+a2+a3+a4)

Added by:  Adam Dzedzej 
Date:  20040511 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS PERL6 VB.NET 