THREETW1 - Connecting three towns (variation)

no tags 

Given three towns find the point for which the summary distance to all towns is minimal. Wanted are the accurate coordinates ±10-6.

Input

In the first line the number T (T<100) of test cases. Then T lines with the space separated coordinates (integer 0<=x,y<=100) of the three towns.

Output

For each test case the coordinates of the above specified point.

Example

Input:
2
2 2 1 1 2 1
1 0 0 0 2 1 Output: 1.788675 1.211324
1 0

hide comments
ZiYuan: 2011-09-24 23:15:32

Thank you, @HWK. I am done.

Last edit: 2011-09-25 01:16:06
HWK: 2011-09-24 21:37:48

@ZiYuan:
E.g. 39 48 98 82 88 42

ZiYuan: 2011-09-24 16:34:50

Weird. I've passed the challenge version, but failed in this one. @HWK, can you tell me the test case I didn't pass? Thank you. (5718652)

Last edit: 2011-09-24 16:35:33
HWK: 2011-09-11 07:52:51

@Manish Jain: E.g. look at the 2nd example. Your answer there is '2 1' not '1 0'.

Manish Jain: 2011-09-10 20:23:33

@HWK:-why i m getting WA??
i think i m using d correct algo.
would u pls point me where my code fails..?
my solution id:5637542

Last edit: 2011-09-10 21:18:53
[Rampage] Blue.Mary: 2011-08-31 10:03:56

The challenge version of this problem is here: http://www.spoj.pl/problems/THREETWN

HWK: 2011-08-30 10:46:38

@Aurelian Tutuianu:
Another hint:
input - 46 61 5 97 68 69
your output - 46.0791736376 61.4109853749
my output - 46.0791729818 61.4109817954
This are no rounding problems.

HWK: 2011-08-29 18:05:40

@Robin Lee: Thanks!

Robin Lee: 2011-08-29 12:59:01

The rounding issue was clear from the problem statement and does not provide cause to attack the setter. Always print to 1dp more than requested if you have the opportunity.

Last edit: 2011-08-29 14:55:56
HWK: 2011-08-29 11:36:49

@Damian Straszak: 0 0 1 0 5 0 -> 1 0
You're right: There's no intersection at this case.
I changed the problem description.
Thank You.
"%.6f" sometimes can be good enough, but sometimes because of rounding errors not. See my last comment and you propably will understand it.


Added by:HWK
Date:2011-08-25
Time limit:0.100s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64