Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: solarsunny

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-09-28 19:40:57

#include <bits/stdc++.h>

using namespace std;

int month[] = {3,0,3,2,3,2,3,3,2,3,2,3};


int main()
{
    int m, d;
    cin >> m >> d;
    m--;
    d--;
    if(m <= 7) {
        d= d + 11;
        for(; m<7; m++) {
            d = d + month[m];
        }
    } else {
        d = d - 20;
        for(int i=8; i<m; i++) {
            d = d - month[i];
        }
        d = d + 7*100;
    }
    cout << d%7+1 << endl;

}