|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||256 MB||29||8||8||34.783%|
Professor Boffin is a regional contest director of ACM ICPC. He loves watching and analyzing the scoreboard during the contest. He believes that the scoreboard is ideal when all these criteria hold together:
Obviously, the scoreboard is not ideal at the beginning of the contest, but it may become ideal during the contest. The scoreboard may remain ideal through the end of the contest, or it may lose this property some time later during the contest. In the latter case, it can be shown that it will never become ideal any more. Given the list of the submissions in a regional contest, you must determine the interval in which the scoreboard was ideal.
The input consists of several test cases. Each test case starts with a line containing 3 space-separated integers T, P, and S which represent the number of teams, problems, and submissions respectively (1 ⩽ T ⩽ 150, 1 ⩽ P ⩽ 15, 0 ⩽ S ⩽ 5000). Each of the next S lines represents a contest submission with 4 space-separated parameters:
No two submissions have the same time. The input terminates with a line containing 0 0 0 which should not be processed as a test case.
For each test case, output a line containing the ideal-interval of the corresponding contest. The interval must be provided with two times in exact HH:MM:SS format (as described in the input). The first time shows the moment the scoreboard becomes ideal, and the second time shows the moment the scoreboard is not ideal anymore. If the scoreboard remains ideal through the end of the contest, the second time must be --:--:--. If the scoreboard never becomes ideal throughout the contest, both times must be --:--:--.
2 3 5 1 A 00:10:05 Yes 2 A 00:15:15 No - Wrong Answer 1 C 01:01:01 Yes 2 B 02:20:00 Yes 1 B 03:10:00 Yes 2 3 5 1 A 00:10:05 Yes 2 A 00:15:15 No - Wrong Answer 1 C 01:01:01 Yes 2 B 02:20:00 Yes 1 B 03:10:00 No - Wrong Answer 2 3 5 1 A 00:10:05 Yes 1 C 01:01:01 Yes 2 A 00:15:15 No - Wrong Answer 1 B 03:10:00 Yes 2 B 04:20:00 Yes 0 0 0
02:20:00 03:10:00 02:20:00 --:--:-- --:--:-- --:--:--