Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: KantaponZ

Problemset: E.Comet

Language: cpp

Time: 0.004 second

Submitted On: 2025-09-24 23:12:42

#include <bits/stdc++.h>
using namespace std;

int D, M, Y;
int T, N;
int mth[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> D >> M >> Y >> T >> N;
    T = T * N;
    while (T--) {
        D++;
        if (D > mth[M] + (M == 2 && ((Y % 4 == 0 && Y % 100 != 0) || (Y % 400 == 0)) ? 1 : 0)) {
            D = 1;
            M++;
        }
        if (M > 12) {
            M = 1;
            Y++;
        }
    }
    cout << D << " " << M << " " << Y;
}