Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: gay69

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

Language: cpp

Time: 0.002 second

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

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll day[12] = {31,28,31,30,31,30,31,31,30,31,30,31};

int main() {
    cin.tie(0)->sync_with_stdio(0);
    ll m,d;
    cin>>m>>d; m--,d--;
    while(m<7)d+=day[m],m++;
    while(m>7)m--,d-=day[m];
    d+=11;
    cout<<(d%7+7)%7+1;
}