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

문제

기원이의 방에는 시침과 분침으로 이루어진 아날로그 시계가 있다. 기원이는 시침과 분침이 형성하는 각도 중 작은 각도를 측정하는 것이 취미이며, 이 각도는 0보다 크거나 같고 180보다 작거나 같다.

기원이는 서로 다른 5개의 시간이 hh:mm의 형태로 주어졌을 때, 중간값을 갖는 각도가 몇 시 인지 궁금해져서 이를 알아내는 프로그램을 만들고자 한다.

즉, 주어진 시간들이 이루는 각도를 기준으로 오름차순 정렬했을 때, 세번째에 위치한 시간을 찾으면 되는 것이다. 만일 동일한 각도를 갖는 시간들이 있으면, 빠른 시간 순서대로 정렬한다.

예를들어 06:05, 07:10, 03:00, 21:00, 12:55 가 주어졌으면, 정렬 결과는 12:55, 03:00, 21:00, 06:05, 07:10 이 되고, 중간 값은 21:00 이 된다.

기원이를 도와 주어진 시간들의 각도 중 중간값을 갖는 시간이 언제인지 찾는 프로그램을 작성해보자

입력

입력의 첫 줄에 테스트 케이스의 개수 T가 주어진다.

각 테스트 케이스는 5개의 hh:mm의 형식으로 이루어진 시간 데이터로 구성되어 있으며, 띄어쓰기 한칸으로 구분되어 있다.

단, 00 ≤ hh ≤ 23이고, 00 ≤ mm ≤ 59이다

출력

각 테스트 케이스마다 주어진 시간 데이터들 중, 중간 각도 값을 갖는 시간을 hh:mm의 형태로 출력한다.

예제 입력 1

3
00:00 01:00 02:00 03:00 04:00
06:05 07:10 03:00 21:00 12:55
11:05 12:05 13:05 14:05 15:05

예제 출력 1

02:00
21:00
14:05

힌트

W3sicHJvYmxlbV9pZCI6Ijg5ODkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyZGNcdWFjYzQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YWUzMFx1YzZkMFx1Yzc3NFx1Yzc1OCBcdWJjMjlcdWM1ZDBcdWIyOTQgXHVjMmRjXHVjZTY4XHVhY2ZjIFx1YmQ4NFx1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3A+XHJcbiIsImlucHV0IjoiPHA+VGhlIGlucHV0IGNvbnNpc3RzIG9mIFQgdGVzdCBjYXNlcy4gVGhlIG51bWJlciBvZiB0ZXN0IGNhc2VzIChUKSBpcyBnaXZlbiBvbiB0aGUgZmlyc3QgbGluZSBvZiB0aGUgaW5wdXQgZmlsZS4gRWFjaCB0ZXN0IGNhc2UgaXMgZ2l2ZW4gb24gYSBzaW5nbGUgbGluZSwgd2hpY2ggY29udGFpbnMgYSBzZXF1ZW5jZSBvZiBmaXZlIGRpc3RpbmN0IHRpbWVzLCB3aGVyZSB0aW1lcyBhcmUgZ2l2ZW4gaW4gdGhlIGZvcm1hdCA8Y29kZT5oaDptbTxcL2NvZGU+IGFuZCBhcmUgc2VwYXJhdGVkIGJ5IGEgc2luZ2xlIHNwYWNlLiZuYnNwOzxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPlByaW50IGV4YWN0bHkgb25lIGxpbmUgZm9yIGVhY2ggdGVzdCBjYXNlLiBUaGUgbGluZSBpcyB0byBjb250YWluIHRoZSBtZWRpYW4gaW4gdGhlIGZvcm1hdCA8Y29kZT5oaDptbTxcL2NvZGU+IG9mIHRoZSB0aW1lcyBnaXZlbi4gVGhlIGZvbGxvd2luZyBzaG93cyBzYW1wbGUgaW5wdXQgYW5kIG91dHB1dCBmb3IgdGhyZWUgdGVzdCBjYXNlcy4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

ACM-ICPC > Regionals > Asia > Korea > Asia Regional - Seoul 2003 B번

  • 잘못된 데이터를 찾은 사람: koosaga
  • 문제를 번역한 사람: occidere