Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: Prap

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-03-25 13:00:27

#include <iostream>
#include <cmath>
#include <vector>
#include <string>
using namespace std;
int main() {
	int D,M;
	cin>>M>>D;
	int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int count = 0;
	if (M <= 8) {
		for (int i = M-1; i<7; i++) {
			count = count + month[i];
		}
		cout<<(count+D+3)%7+1;
	}
	else {
		for (int i = M-1; i>7; i--) {
			count = count + month[i];
		}
		cout<<"Count = "<<count<<endl;
		cout<<(count+D-18)%7;
	}
}