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

문제

다트판은 평평한 판과 동심원이 그려진 원형 코르크로 만든다. 사람들은 다트를 다트판에서 가장 중심에 있는 원(불스아이)을 향해 던진다.

다트판의 각 고리에는 점수가 적혀있고, 중심에 가까울수록 점수가 높다.

각 고리의 반지름은 3cm, 6cm, 9cm, 12cm, 15cm이다. (따라서, 불스아이의 지름은 6cm) 간단한 다트게임은 두 플레이어가 게임을 하며, 다음과 같이 플레이한다.

첫 번째 플레이어가 다트 3개를 다트판에 던진다. 다트가 맞춘 영역의 점수의 합이 그 플레이어의 점수가 된다. 첫 번째 플레이어가 던진 다트를 다트판에서 모두 제거한다. 두 번째 플레이어가 다트 3개를 다트판에 던진 뒤, 점수를 계산한다. 높은 점수를 얻은 플레이어가 이긴다.

두 플레이어의 점수를 계산한 뒤, 누가 이기는지를 구하는 프로그램을 작성하시오. 만약 다트가 경계에 걸쳐있다면, 높은 점수를 얻은 것이다. 다트가 다트판 밖을 맞춘다면, 점수를 얻지 못한다. Double precision floating point 연산을 사용하면 된다.

입력

첫재 줄에 테스트 케잇의 개수가 주어진다.. 각 테스트 케이스는 한 줄에 12개의 실수(double-precision 값)가 있다. 각 쌍은 중심과 다트의 거리이고, x, y거리 순서이고 단위는 cm이다.  처음 3개의 수는 첫 번째 플레이어가 던진 다트이고, 다음 3개는 두번재 플레이어가 던진 것이다. (-20.0 ≤ X,Y ≤ 20.0)

출력

각 테스트 케이스에 대해서, 게임을 이긴 사람이 있다면 다음과 같은 형식으로 출력한다.

SCORE: N to M, PLAYER P WINS.

만약, 비겼다면

SCORE: N to M, TIE.

를 출력한다.

N은 첫 번째 플레이어의 점수, M은 두 번째 플레이어의 점수이고, P는 게임을 승리한 사람의 번호 1 또는 2이다. 모든 값은 음이아닌 정수이다.

예제 입력 1

2
-9 0 0 -4.5 -2 2 9 0 0 4.5 2 -2
-19.0 19.0 0 0 0 0 3 3 6 6 12 12

예제 출력 1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