Submission
Status:
PPP-----------------
Subtask/Task Score:
15/100
Score: 15
User: un8qe_x3
Problemset: ปฏิทินวันแม่
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-19 11:49:24
#include<bits/stdc++.h>
using namespace std;
#define For(len) for(int i=0; i<len; i++)
int offset(int M) {
int offsets[12] = {5, 2, 6, 4, 1, 6, 3, 4, 6, 3, 1, 5};
if(M < 1 || M > 12) return -1;
return offsets[M - 1];
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int m,d,r;cin >> m >> d;
m=offset(m);r=((d+m)%7)+1;
cout << r;
}