Start: Jun, 26, 2019 08:30:00
2019年度暑期短学期第一天
End: Jun, 26, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 6ms
Memory: 1712kB
Author: 2018212212030
In contest: 1273

#include <iostream>
#include <cstring>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <list>
using namespace std;
#define ll long long                                               
#define inf 0x3f3f3f3f
int i, j, k;
int m, n, p;
int main(){
	int year, month, day;
	while (scanf("%d %d %d", &year, &month, &day) != EOF) {
		if (month == 1 || month == 2) {
			month += 12;
			year--;
		}
		int week = (day + 2 * month + 3 * (month + 1) / 5 + year + year / 4 - year / 100 + year / 400) % 7;
		if (week == 0)
			printf("Monday\n");
		else if (week == 1)
			printf("Tuesday\n");
		else if (week == 2)
			printf("Wednesday\n");
		else if (week == 3)
			printf("Thursday\n");
		else if (week == 4)
			printf("Friday\n");
		else if (week == 5)
			printf("Saturday\n");
		else if (week == 6)
			printf("Sunday\n");
	}
	return 0;
}