Run ID:158791

提交时间:2026-08-22 17:22:36

#include<bits/stdc++.h> using namespace std; bool run(int y){ if(y%400==0 || (y%100!=0 && y%4==0)){ return 1; } return 0; } int main(){ int T; cin>>T; while(T--){ int Y,N; cin>>Y>>N; int cnt=0; int ans; for(int i=Y;;i++){ if(run(i)){ cnt++; if(cnt==N){ ans=i; break; } } } cout<<ans<<endl; } }