Submission #22054

# Submission time Handle Problem Language Result Execution time Memory
22054 2017-04-29T06:13:45 Z nemo(#1010, nemo) None (KRIII5P_1) Python 2
7 / 7
61 ms 3 KB
def f(x,y):
	return 0<=x<=23 and 0<=y<=59
def g(x,y):
	a = [31,29]+[31,30]*2+[31,31]+[30,31]*2
	return 1<=x<=12 and 1<=y<=a[x-1]
for i in range(input()):
	x,y = map(int,raw_input().split())
	a = "Yes" if f(x,y) else "No"
	b = "Yes" if g(x,y) else "No"
	print a,b
# Verdict Execution time Memory Grader output
1 Correct 61 ms 3 KB Output is correct