Run ID:6847
提交时间:2021-02-20 17:14:08
#include <iostream> #include <cstdio> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int y, c; cin >> y >> c; int cnt = 0, year = y - 1; while (cnt < c) { year++; if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) { cnt++; } } cout << year << endl; } return 0; }