알람시계

h, m = map(int, input().split())
if m >= 45:
print(h, m-45)
elif m < 45 and h > 0:
print(h-1, m+15)
else:
print(23, m+15)
Check!
x, y = map(int, input().split())
a = x - 1
b = y + 15
if b >= 60 and a >= 0:
a = x
b = 0
elif a < 0:
a = 23
print(a, b)
h, m = map(int, input().split())
time = ((h * 60) + m - 45)
if h > 0:
h = time // 60
m = time % 60
else:
h = ((24 * 60) + m - 45) // 60
m = ((24 * 60) + m - 45) % 60
print(h, m)