Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- day = 24 * 60
- times = []
- for i in range(n):
- ex = list(map(int, input().replace(':', ' ').split()))
- #print(ex)
- times.append((ex[0] * 60 + ex[1] + ex[2]) % day)
- #print(times)
- times.sort()
- for i in times:
- hours = str(i // 60)
- mins = str(i % 60)
- if len(hours) == 1:
- print('0' + hours, end=':')
- else:
- print(hours, end=':')
- if len(mins) == 1:
- print('0' + mins)
- else:
- print(mins)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement