시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1 1 1 100.000%

문제

선영이의 조경회사는 컴퓨터 geek을 위한 정원 관리로 유명하다. 그 중 가장 유명한 것은 정삼각형 모양의 테라스에 원형 풀장이 내접하고 있는 형태이다.

그러나 선영이의 일부 고객은 정원 가운데 정삼각형 모양을 만드는 대신, 정원의 구석이나 비스듬한 면에 테라스를 만들기를 원한다. 선영이는 임의의 삼각형 모양에 대해 아래 그림과 같이 타원형의 풀장이 삼각형 변의 중점에 접하는 형태를 제안했다.

타원의 두 초점에 막대를 꽂으면, 막대에 줄을 연결해 타원을 그릴 수 있다. 삼각형의 세 꼭지점의 좌표가 주어졌을 때, 두 초점의 좌표와 필요한 줄의 길이를 출력하는 프로그램을 작성하라. (줄의 길이는 두 초점에서 타원 위의 임의의 점까지의 길이의 합이다.)

입력

입력의 첫 줄에는 테스트의 개수인 정수 N(1 ≤ N ≤ 1000)이 주어진다.

각각의 테스트에는 세 점의 좌표인 실수 x1, y1, x2, y2, x3, y3가 공백으로 구분되어 한 줄에 주어진다.

출력

각각의 테스트에 대해 한 줄에 fx1, fy1, fx2, fy2, rl(fx1<=fx2, fx1=fx2이면 fy1<=fy2)을 공백으로 구분하여 소수 둘째 자리까지 반올림하여 출력한다. (fx1, fy1)과 (fx2, fy2)는 각각 타원의 초점이며, rl은 줄의 길이이다. 타원이 원일 경우 두 초점은 같다.

예제 입력 1

3
100 100 200 273.2051 300 100
100 100 100 300 300 100
100 200 100 300 300 100

예제 출력 1

200.00 157.71 200.00 157.76 115.47
119.53 213.81 213.81 119.53 163.30
103.94 253.14 229.40 146.86 170.51
W3sicHJvYmxlbV9pZCI6IjI3MTAiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMwYmNcdWFjMDFcdWQ2MTUgXHVjODE1XHVjNmQwIiwiZGVzY3JpcHRpb24iOiJcclxuPHA+XHJcblx0XHVjMTIwXHVjNjAxXHVjNzc0XHVjNzU4IFx1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