Problem J
The Optimal Coffee Shop !!
Input: Standard Input
Output: Standard Output
Time Limit: 2 seconds

 

In Bangladesh there are many private Universities now. Almost all of them don’t have their own campuses (by campus I mean a large area consisting many buildings) and at their present locations (two busy areas of Dhaka – Banani, Mohakhali) it is not possible for them to have their own campus covering large area like the Public Universities (Bangladesh University of Engineering & Technology, Dhaka University, Jahangir Nagar University etc). So three Private Universities in Dhaka (North South University, East West University & BRAC University (Sorry! There is no Up Down University)) decide to move away from their current location to a large vacant plain field in Savar (Another place near Dhaka). This field is so large (the Bangladeshi people can consider it like the field of Tepantor described in fairytales) that the campuses of these Universities can be considered as points (You know better than me, that if I don’t consider them as points this problem will be even harder). These Universities decide to build a common coffee shop for their students, but the problem is that everyone wants the coffee shop to be established in their own campus. At last they decided that the coffee shop would be established in a place whose total distance from these three Universities is minimum. For the convenience of you & me (You will have to solve it in contest time along with 11 other problems and I’ll have to write the judge solution) I would like you to find this total minimum distance (if the campuses are A, B, C and the optimal location is P find PA + PB + PC). One of the Universities proposed the coffee shop to be on the in-center of triangle ABC (Let’s say the in-center is I), another proposed it to be on the Center of Gravity of triangle ABC (Let’s say the center of Gravity is G) and the other proposed it to be on the circum-center of the triangle (Let’s say the circum-center is O). So you will also need to print the value of (AI + BI + CI), the value of (AG + BG + CG) and the value of (AO + BO + CO). If any value cannot be determined print its value as –1 with appropriate formatting.

 

/* In the paragraph above only but the names and current locations of the Universities are true. */  

 

Input

The first line of the input file contains an integer S (0<S<=100) that indicates how many sets of inputs are there. Each of the next S lines contains 1 set of input. Each set contains three integer numbers a, b, c where a is the distance between B & C, b is the distance between C & A and c is the distance between A & B.  The important condition is (0<a,b,c<=10000). As you already know A, B, C are the locations of the three campuses.

 

Output

For each set of input you should output four floating-point numbers DM, DI, DG, DO, all of which have three digits after the decimal point. Here DM = AP + BP + CP, DI = AI + BI + CI, DG = AG + BG + CG, DO = AO + BO + CO.

 

Sample Input:

2
3 3 3
4 4 4

 

Sample Output:

5.196 5.196 5.196 5.196
6.928 6.928 6.928 6.928

Shahriar Manzoor