시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 106 42 35 41.667%

문제

어느 날, 할 것이 없던 윤표는 시계를 관찰하기 시작했다. 어느 순간 윤표는 시계가 하나의 원이라는 사실을 깨달았다. 또, 시계의 중심에서 시침, 분침, 그리고 초침의 방향으로 직선을 그어 시계의 둘레와 만나는 점을 각각 A, B, C라고 하고, 시계의 중심점을 O라고 했을 때 OA, OB, OC 중 어느 두 직선이 이루는 각들을 비교하다가 어떤 각이 가장 작은지 궁금해졌다. OA, OB, OC 중 어느 두 직선이 이루는 각 중 최소 각을 출력하는 프로그램을 만드시오. 단, 각도의 단위는 도(°)이다.

입력

첫번째 줄에 테스트 케이스 개수 T(1 ≤ T ≤ 3,000)가 주어지고 2번째 줄부터 T+1 번째 줄까지 한 줄에 하나씩 h시 m분 s초(0 ≤ h ≤ 11, 0 ≤ m ≤ 59, 0 ≤ s ≤ 59. h, m, s는 정수.)가 공백으로 구분되어 주어진다.

출력

T개의 테스트 케이스 각각에 대해 OA, OB, OC 중 어느 두 직선이 이루는 각 중 최소의 각을 출력한다.

실제 정답과 출력 값의 절대오차 또는 상대오차가 10-6 이하이면 정답으로 처리된다.

예제 입력 1

1
7 47 17

예제 출력 1

50.058333
W3sicHJvYmxlbV9pZCI6IjE3ODQzIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjMmRjXHVhY2M0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM1YjRcdWIyOTAgXHViMGEwLCBcdWQ1NjAgXHVhYzgzXHVjNzc0IFx1YzVjNlx1YjM1OCBcdWM3MjRcdWQ0NWNcdWIyOTQgXHVjMmRjXHVhY2M0XHViOTdjIFx1YWQwMFx1Y2MzMFx1ZDU1OFx1YWUzMCBcdWMyZGNcdWM3OTFcdWQ1ODhcdWIyZTQuIFx1YzViNFx1YjI5MCBcdWMyMWNcdWFjMDQgXHVjNzI0XHVkNDVjXHViMjk0IFx1YzJkY1x1YWNjNFx1YWMwMC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