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

[백준/파이썬] 25774번 Simplified Calendar System

by 현장 2023. 12. 21.

-Code

d1, m1, y1, n = map(int, input().split())
d2, m2, y2 = map(int, input().split())

res = (((y2 - y1) * 360) + ((m2 - m1) * 30) + (d2 - d1)) % 7 + n

print(res if res <= 7 else res - 7)