Start: Jul, 17, 2019 00:00:00
20190717Python程序设计基础培训第三次作业
End: Jul, 21, 2019 00:00:00
Time elapsed:
Time remaining:

Problem_ID: A
Result: Accepted
Time: 55ms
Memory: 25320kB
Author: 13600624162
In contest: 1295

#这是答案
d={0:6,1:9,2:6,3:5,4:5,5:5,6:5}
for tcase in range(int(input())):
    y,w=int(input()),2
    for i in range(1929,y+1):
        w+=366 if i%4==0 and i%100!=0 or i%400==0 else 365
    print(d[w%7])