Submission

Status:

-P------P---P-------

Subtask/Task Score:

15/100

Score: 15

User: pupu

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

Language: cpp

Time: 0.003 second

Submitted On: 2026-10-05 12:01:46

#include <iostream>
#include <vector>
using namespace std;
int main(){ios::sync_with_stdio(0);cin.tie(0);
    long long int m,d,more=0;
    cin>>m>>d;
    vector<int> v ={31,28,31,30,31,30,31,31,30,31,30,31};
    if(m==8){
        if((((d+11)%7))==0){
            cout<<7;
        }
        else{
            cout<<((d+11)%7);
        }
        return 0;
    }
    if(m<8){
        more = more+d;
        for(int i=m-1;i<7;i++){
            more = more + v[i]-(8-m);
        }
        more = more + 11;
    }
    if(m>8){
        for(int i=m-1;i<12;i++){
            more = more + v[i];
        }
        for(int i=0;i<7;i++){
            more = more+v[i];
        }
        more = more +11 +d - (12-m+1) -7;
    }
    if(more%7==0){
        cout<<7;
        }
        else{
        cout<<(more%7);
        }
}