#1022
Unrated
KOŠARKA
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Author: Goran Gašić

Slavko has started to follow the NBA league. The game duration is exactly 48 minutes. When a game ends, the statistics are shown. Slavko has written down whenever a team scored. He is curious about how long each team was in the lead.

입력

The first line of input contains one integer N (1 ≤ N ≤ 100). The following N lines describe events when a team scored. Each description consists of a team that scored, which is either 1 or 2, and a timestamp in format MM:SS (minutes:seconds), the time when a team scored. Minutes and seconds are zero padded and from ranges [00, 47] and [00, 59] (inclusive). The given timestamps are unique.

출력

The first line of output must contain the duration that the first team was in the lead. The second line of output must contain the duration that the second team was in the lead. All durations should be in MM:SS format, with leading zeros.

예제 입력 1

1
1 20:00

예제 출력 1

28:00
00:00

예제 입력 2

3
1 01:10
2 21:10
2 31:30

예제 출력 2

20:00
16:30

예제 입력 3

5
1 01:10
1 02:20
2 45:30
2 46:40
2 47:50

예제 출력 3

45:30
00:10
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.