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

문제

기원이의 방에는 시침과 분침으로 이루어진 아날로그 시계가 있다. 기원이는 시침과 분침이 형성하는 각도 중 작은 각도를 측정하는 것이 취미이며, 이 각도는 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
W3sicHJvYmxlbV9pZCI6Ijg5ODkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyZGNcdWFjYzQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YWUzMFx1YzZkMFx1Yzc3NFx1Yzc1OCBcdWJjMjlcdWM1ZDBcdWIyOTQgXHVjMmRjXHVjZTY4XHVhY2ZjIFx1YmQ4NFx1Y2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C9wPlxyXG4iLCJpbnB1dCI6IjxwPlRoZSBpbnB1dCBjb25zaXN0cyBvZiBUIHRlc3QgY2FzZXMuIFRoZSBudW1iZXIgb2YgdGVzdCBjYXNlcyAoVCkgaXMgZ2l2ZW4gb24gdGhlIGZpcnN0IGxpbmUgb2YgdGhlIGlucHV0IGZpbGUuIEVhY2ggdGVzdCBjYXNlIGlzIGdpdmVuIG9uIGEgc2luZ2xlIGxpbmUsIHdoaWNoIGNvbnRhaW5zIGEgc2VxdWVuY2Ugb2YgZml2ZSBkaXN0aW5jdCB0aW1lcywgd2hlcmUgdGltZXMgYXJlIGdpdmVuIGluIHRoZSBmb3JtYXQgPGNvZGU+aGg6bW08XC9jb2RlPiBhbmQgYXJlIHNlcGFyYXRlZCBieSBhIHNpbmdsZSBzcGFjZS4mbmJzcDs8XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5QcmludCBleGFjdGx5IG9uZSBsaW5lIGZvciBlYWNoIHRlc3QgY2FzZS4gVGhlIGxpbmUgaXMgdG8gY29udGFpbiB0aGUgbWVkaWFuIGluIHRoZSBmb3JtYXQgPGNvZGU+aGg6bW08XC9jb2RlPiBvZiB0aGUgdGltZXMgZ2l2ZW4uIFRoZSBmb2xsb3dpbmcgc2hvd3Mgc2FtcGxlIGlucHV0IGFuZCBvdXRwdXQgZm9yIHRocmVlIHRlc3QgY2FzZXMuJm5ic3A7PFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

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

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