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

[백준/파이썬] 25024번 시간과 날짜

by 현장 2022. 5. 27.

-Code

month = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

for _ in range(int(input())):
    r1, r2 = "No", "No"
    x, y = map(int, input().split())
    if 0 <= x < 24 and 0 <= y < 60:
        r1 = "Yes"
    if 0 < x <= 12 and 0 < y <= month[x]:
        r2 = "Yes"
    print(r1, r2)