TRICENTR  Triangle From Centroid
Given the length of side a of a triangle and the distances from the centroid (the point of concurrence of the medians  red in the picture) to all sides: a, b and c, calculate this triangle's area and the distance (blue line) from the orthocenter (the point of concurrence of the heights  green in the picture) to the centroid.
Input
In the first line integer n  the number of test cases (equal to about 1000). The next n lines  4 floating point values: the length of side a, and distances from the centroid to sides a, b and c.
Output
n lines consisting of 2 floating point values with 3 digits after the decimal point: the area of the triangle and the distance from the orthocenter to centroid.
Example
Input: 2 3.0 0.8660254038 0.8660254038 0.8660254038 657.8256599140 151.6154399062 213.5392629932 139.4878846649 Output: 3.897 0.000 149604.790 150.275
hide comments
Ruffneck:
20141111 01:24:56
maths maths maths 

Harunur Rashid:
20140818 22:36:53
b=a*ga/gb;


mayank:
20131231 18:35:09
purely formula based! nothing sepcial required! and @liz can you tell how do you plan to do this question without the measure of length side 'a' ? My mail id is mayank25080562@gmail.com 

liz:
20131110 10:20:35
Actually the length of side a is not necessary. One can solve the problem using only distances from the centroid to the sides. 

Mike Rush:
20130215 12:46:09
Who can help me? 

Mike Rush:
20130215 12:45:43
It's too hard 

Lloyd_feb:
20121028 08:16:57
can some one help me.


P Venkata sri harsha:
20120922 04:18:13
can anyone give more test cases i am struck with WA 

The Vagabond:
20120724 00:02:14
this question tests only mathematical skill.....anybody can search for formulas relating area of triangle in terms of given parameter :( :(


saket diwakar:
20120706 10:26:38
@all, no the given output is correct..my AC solution gives the same... 
Added by:  Patryk Pomykalski 
Date:  20040522 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS PERL6 VB.NET 