Run ID:138146
提交时间:2025-11-23 12:58:01
#include <bits/stdc++.h> using namespace std; int main() { int i,j,k,n,y,t,s; cin>>t; while (t--) { s=0; cin>>y>>n; while (true) { if (y%400==0 and y%100==0 or y%4==0 and y%100!=0) s++; if (s==n) break; y++; } cout<<y<<endl; } return 0; }