본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬]18063번 Jazz Enthusiast

by 현장 2021. 4. 22.

-코드

n, c = map(int, input().split())
r = -c * (n - 1)

for _ in range(n):
    t = list(map(int, input().split(':')))
    r += t[0] * 60 + t[1]

print("%02d:%02d:%02d" % (r // 3600, r % 3600 // 60, r % 60))