#include <iostream>
using namespace std;
int main(){
int k,
day,
month,
mon = 0,
i = 0,
m = 1,
raz = 0;
cin >> k >> day >> month;
for(i = 0;mon >= k;i++){
if(month % 2 == 0 && m == 5 && raz < 2){
mon = mon - 100;
raz++;
cout << raz << endl;
}
if(raz >= 2 && month % 2 == 0 && m == 3 || m == 4 || m == 5){
mon = mon + 100;
}
if(month % 2 != 0){
mon = mon + 200;
}
if(raz >= 2 && month % 2 == 0 && m != 3 && m != 4 && m != 5){
mon = mon + 200;
}
m++;
cout << m << endl;
if(m > 7){
m = 1;
}
day++;
cout << day << endl;
if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12 && day > 31){
day = 1;
month++;
if(month > 12){
month = 1;
}
raz = 0;
}
if(month == 4 || month == 6 || month == 9 || month == 11 && day == 30){
day = 1;
month++;
if(month > 12){
month = 1;
}
raz = 0;
}
if(month == 2 && day == 28){
day = 1;
month++;
if(month > 12){
month = 1;
}
raz = 0;
}
cout << month << endl;
}
cout << i;
return 0;
}
Выводит i = 0