intget_days(int month, int year) { if (month == 2) return months[2] + is_leap(year); return months[month]; }
intmain() { int a, b, c, y1, y2; cin >> a >> b >> c >> y1 >> y2; int days = 0; for (int year = 1850; year <= y2; year++) { for (int month = 1; month <= 12; month++) { if (year >= y1 && month == a) { int w = (1 + days) % 7, cnt = 0; for (int d = 1; d <= get_days(month, year); d++) { if (w == c - 1) { cnt++; if (cnt == b) { printf("%04d/%02d/%02d\n", year, month, d); break; } } w = (w + 1) % 7; } if (cnt < b) { puts("none"); } } days += get_days(month, year); } } }