Submission

Status:

PPPPPPPPP----PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: kkxkkx001

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-30 13:52:33

#include <iostream>
using namespace std;

int main()
{
	int m, d, total;
	cin >> m;
	cin >> d;
	
	if (m==1){total=1;}
	if (m==2){total=32;}
	if (m==3){total=60;}
	if (m==4){total=91;}
	if (m==5){total=121;}
	if (m==6){total=152;}
	if (m==7){total=182;}
	if (m==8){total=213;}
	if (m==9){total=244;}
	if (m==10){total=274;}
	if (m==11){total=305;}
	if (m==12){total=335;}
	
	if (total < 224){
		total = 224-total;
		total = total%7;
		total += d;
		total = total%7;
		if (total != 0){cout << total;}
		else {cout << "7";}
	}
	else if (total > 224){
		total = total-224;
		total = total%7;
		total += d;
		total = total%7;
		if (total != 0){cout << total;}
		else {cout << "7";}
	}
	else {
		cout << d;
	}
}