Run ID:45251
提交时间:2023-03-12 14:19:22
a=int(input()) d=[] for i in range(a): b,c=map(int,input().split()) if b%4==0 and b%100!=0 or b%400==0: c-=1 if c>0: while True: b+=1 if b%4==0 and b%100!=0 or b%400==0: c-=1 if c<=0: break d.append(b) for i in d: print(i)