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: 1092kB
Author: 2018212212132
In contest: 1273

#include<stdio.h>
#include<math.h>
int main(){
	int a,b,c,d;
	while(scanf("%d%d%d",&a,&b,&c)!=EOF){
	  if(b==1||b==2){
		  a-=1;
		  b+=12;
		  d=(c+2*b+3*(b+1)/5+a+a/4-a/100+a/400+1)%7;
	  }else{
		  d=(c+2*b+3*(b+1)/5+a+a/4-a/100+a/400+1)%7;
	  }
	  
	  if(d==0){
		  printf("Sunday\n");
	  }
	  if(d==1){
		  printf("Monday\n");
	  }
	  if(d==2){
		  printf("Tuesday\n");
	  }
	  if(d==3){
		  printf("Wednesday\n");
	  }
	  if(d==4){
		  printf("Thursday\n");
	  }
	  if(d==5){
		  printf("Friday\n");
	  }
	  if(d==6){
		  printf("Saturday\n");
	  }
	}
 return 0;
}