Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: gay69

Problemset: ปฏิทินวันแม่

Language: cpp

Time: 0.002 second

Submitted On: 2025-07-27 11:29:33

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll inf = 1e18;

ll month[13] = {1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    ll m, d;
    cin >> m >> d;
    cout << ((abs(accumulate(month, month + m, 0ll) - (accumulate(month, month + 8, 0ll) + 11)) + d - 1) % 7 + 1) << "\n";
    return 0;
}