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: 48ms
Memory: 25316kB
Author: 15258406436
In contest: 1295

day = {0:6,1:9,2:6,3:5,4:5,5:5,6:5}
for case  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(day[w%7])