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: 49ms
Memory: 25184kB
Author: 15924081415
In contest: 1295

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