Run ID:18447
提交时间:2021-10-24 19:09:26
#include<iostream> using namespace std; int main(){ int T,Y,N,i,m; cin>>T; while(T--){ cin>>Y>>N; m=0; for(i=Y;i>0;i++){ if(i%400==0||i%4==0&&i%100!=0){ m++; if(m==N){ break; } } } cout<<i<<endl; } return 0; }