Result: Accepted
Time: 6ms
Memory: 1092kB
#include<stdio.h>
int main(){
int a,b,c,a1,b1,c1;
scanf("%d%d%d",&a,&b,&c);
scanf("%d%d%d",&a1,&b1,&c1);
if(a1>a){
if(a1-a==1){
if(b>b1)
printf("Y e s\n");
else if(b<b1)
printf("N o\n");
else {
if(c1>c)
printf("N o\n");
else printf("Y e s\n");
}
}
else printf("N o\n");
}
else if(a1<a){
if(a1+7-a>1)
printf("N o\n");
else if(a1+7-a==1){
if(b>b1)
printf("Y e s\n");
else if(b<b1)
printf("N o\n");
else {
if(c1<=c)
printf("Y e s\n");
else printf("N o\n");
}
}
else printf("Y e s\n");
}
else {
if(b1>b)
printf("Y e s\n");
else if(b1==b){
if(c1>=c)
printf("Y e s\n");
else printf("N o\n");
}
else printf("N o\n");
}
return 0;
}