semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/****************
?????????
???????
****************/
int main()
{
	int n,i,j;                                   //??????n,i,j

	double x[10000],y[10000],dis[10000];         //???????????
	cin>>n;                                      //??n
	for(i=1;i<=n;i++)
	{
		cin>>x[i]>>y[i];                        //??????x[i],y[i]
	}

	int k=1;
    for (i=1;i<=n;i++)                         //???????n???
	{
         for (j=1;j<=n;j++)                    //?????
		 	
			 { dis[k]=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));   //?????????
				 k=k+1;                                                        //?k??1
				}
		 
	}

		
				 
				 
				 
	double max=0;		                //???max	 
				 
				 
	for (k=1;k<=10000;k++)             //????

		
		
			 if (max<dis[k])          //???????????
			 {
				 max=dis[k];
			 }
			 

	
	printf("%.4f\n",max);          //??????????????????
	return 0;
}
int main ()
{
int n;
scanf("%d",&n);
int i,k;
double x[100],y[100],m=0;
 for (i=0;i<n;i++)
 {
	scanf("%lf%lf",&x[i],&y[i]);
 }
    for (i=0;i<n;i++)
	{
		for (k=i+1;k<n;k++)
		{
         if (m<sqrt((x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k])))
			 m=sqrt((x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k]));
		}
	}
   
  printf("%.4lf\n",m);
  return 0;
}
int main(int argc, char* argv[])
{
	struct point{
		float x,y;
	}p[num];
	int n,i,m;
	float max=0,d,c;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		
		scanf("%f %f",&(p[i].x),&(p[i].y));
		for(m=0;m<i;m++)
		{
			d=(p[i].x-p[m].x)*(p[i].x-p[m].x)+(p[i].y-p[m].y)*(p[i].y-p[m].y);
			c=(float)pow(d,0.5);
	
	if(c>max)
	{
		max=c;
	}
		}
	}
	printf("%.4f",max);
	return 0;
}
void main()
{
	int i,j,k=0,n;
	double t,x[100],y[100],d[500];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%lf %lf",&x[i],&y[i]);
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			d[k]=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
			k++;
		}
	}
	for(j=0;j<k;j++)
		for(i=0;i<k-j;i++)
			if(d[i]<d[i+1])
			{
				t=d[i];
				d[i]=d[i+1];
				d[i+1]=t;
			}
			printf("%.4lf\n",d[0]);
}
int main()
{
	int n;
	scanf("%d",&n);
	double x[10],y[10];
	double dis=0;
	double m;
	int i,j;
	for(i=0;i<n;i++)
	{
		double a,b;
		scanf("%lf %lf",&a,&b);
		x[i]=a;
		y[i]=b;
	}
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			m=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
			if(dis<=m)
			{
				dis=m;
			}
		}
	}
	printf("%.4f\n",dis);
	return 0;
}
int main(int argc,  char* argv[])
{
	int n,i,j;
	double distance=0,d;
	struct point {
		double x,y;
	};
    struct point *p;
	scanf ("%d",&n);
	p=(struct point*)malloc(sizeof(point)*n);
	for (i=0;i<n;i++)
	{
		scanf ("%lf%lf",&p[i].x,&p[i].y);
	}
	for (i=0;i<n-1;i++)
	{
		for (j=i+1;j<n;j++)
		{
			d=(p[i].x-p[j].x)*(p[i].x-p[j].x)+(p[i].y-p[j].y)*(p[i].y-p[j].y);
			if (sqrt(d)>distance) distance=sqrt(d);
		}
	}
	printf("%.4lf\n",distance);
	free(p);
	return 0;
}
void main()
{
	int n,i,j,k,l=0;
	float a[100],b[100],c[100],max;
	scanf("%d",&n);
	for(i=0;i<=(n-1);i++)
		scanf("%f%f",&a[i],&b[i]);
	for(j=0;j<=(n-2);j++)
		for(k=(j+1);k<=(n-1);k++)
		{
			c[l]=(a[k]-a[j])*(a[k]-a[j])+(b[k]-b[j])*(b[k]-b[j]);
		    l++;
		}
		max=c[0];
		for(i=1;i<=(l-1);i++)
		if(c[i]>max)
		        max=c[i];
		printf("%.4f\n",sqrt(max));
}
int main()
{
	int n,i,j;
	int k=0;
	double a[10000],b[10000],l[10000];
	double max=0.0000;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%lf%lf",&a[i],&b[i]);
	}
	for(i=1;i<n;i++)
	{
		if(i>=2)
		{
		 for(j=1;j<i;j++)
		 {
			k++;
			l[k]=sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
	        if(k>=2)
			{
			    if(l[k]>max)
				{
				    max=l[k];
				}
			}
			 if(k==1)
			 {
				  max=0;
			 }
			
		 }
		}
	}
	printf("%.4f\n",max);
		return 0;
}
int main(int argc, char* argv[])
{
	int i,n,j;
	scanf("%d\n",&n);
	double a[100],b[100],max,s[1000];
	for(i=1;i<=n;i++)
	{
		scanf("%lf %lf",&a[i],&b[i]);
	}
	for(i=1;i<=n;i++)
	{
		for(j=i+1;j<=n;j++)
		{
			s[j-i+(2*n-i)*(i-1)/2]=sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
		}
	}
	max=s[1];
	for(i=1;i<=(n-1)*n/2;i++)
	{
		if(max<s[i])
		{
			max=s[i];
		}
	}
	printf("%.4lf",max);
	return 0;
}
int  main(int argc, char* argv[])
{
	int a,i,j;// a ????????
	double value[100];
	int number=0;//????
	scanf("%d",&a);
	struct{
		double x;
		double y;
		 
	} point[10];
	for(i=0;i<a;i++){//?point ??
		double m,n;
		scanf("%lf%lf",&m,&n);
		point[i].x=m;
		point[i].y=n;
	}
     
	for(i=0;i<a-1;i++){
		for(j=a-1;j>i;j--){
	   value[number]=sqrt( pow((point[i].x -point[j].x),2) +pow((point[i].y-point[j].y),2));
	    number++;
		}
	}
	 
	for(i=0;i<number;i++){  //???? a-1
		double turn;
		if(value[i]>value[i+1]){
		turn= value[i+1];
		value[i+1]=value[i];
		value[i]=turn;
		}
		else;
	}
	
		printf("%.4lf",value[number]);
   
    return 0;
	
}
void main()
{
	int n,i,j;
	double y[100][99],k,x[100][2];
	
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%lf %lf",&x[i][0],&x[i][1]);
    for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
             y[i][j]=sqrt((x[j][0]-x[i][0])*(x[j][0]-x[i][0])+(x[j][1]-x[i][1])*(x[j][1]-x[i][1]));
		}
    for(i=0;i<n-2;i++)
		for(j=i+1;j<n-1;j++)
		{
             if(y[i][j]>y[i][j+1])
			 {
				k=y[i][j];
				y[i][j]=y[i][j+1];
				y[i][j+1]=k;
			 }
		}
		for(i=0;i<n-1;i++)
		{
			if(y[i][n-1]>y[i+1][n-1])
			{
            	k=y[i][n-1];
				y[i][n-1]=y[i+1][n-1];
				y[i+1][n-1]=k;
			}
		}
		printf("%.4lf\n",y[n-1][n-1]);
}
int main()
{ 

int n,i,j;
double Ldist,dist;
struct dis
{
	double x;
	double y;
}dis[100];
scanf("%d",&n);
for(i=0;i<n;i++)
{
	scanf("%lf%lf",&dis[i].x,&dis[i].y);
}
Ldist=sqrt((dis[0].x-dis[1].x)*(dis[0].x-dis[1].x)+(dis[0].y-dis[1].y)*(dis[0].y-dis[1].y));
for(i=0;i<n;i++)
{for(j=i+1;j<n;j++)
{dist=sqrt((dis[i].x-dis[j].x)*(dis[i].x-dis[j].x)+(dis[i].y-dis[j].y)*(dis[i].y-dis[j].y));
 if(dist>Ldist)
	 Ldist=dist;
}
}
printf("%.4lf",Ldist);
return 0;
}
struct point 
   {
     double x;
     double y;
     
   };
main ()
{
   struct point p[20];
   int n;
   scanf ("%d\n",&n);
   int i,j;
   for (i=0;i<n;i++)
   {
     scanf ("%lf%lf\n",&p[i].x,&p[i].y);
   }
      double dis[400] ;
      double t;
      int k=0;
      for (i=0;i<n-1;i++)
      {
         for (j=i+1;j<n;j++)
         {
            t=(p[i].x-p[j].x)*(p[i].x-p[j].x)+(p[i].y-p[j].y)*(p[i].y-p[j].y);
            dis[k] =sqrt (t);
            k++;
         }
      }
    double max=dis [0];
    for (i=1;dis[i]!='\0';i++)
          {
          if (dis [i]>max)
            max =dis [i];
          
          }

        printf ("%.4lf\n",max);


getchar ();
getchar ();



}
struct dian
{
	double x,y;
}a[100];
void main()
{
	int n,i,k=0,j,t;
	double c[100]={0},max;
	struct dian *p=a;
	scanf("%d",&n);
	t=p;
	for(i=0;i<n;i++)
	{
		scanf("%lf%lf",&p->x,&p->y);
		p++;
	}
	p=t;
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			c[k]=sqrt((a[i].x-a[j].x)*(a[i].x-a[j].x)+(a[i].y-a[j].y)*(a[i].y-a[j].y));
			k++;
		}
	}
	max=c[0];
	for(i=0;i<=k;i++)
	{
		if(c[i]>max)
			max=c[i];
	}
	printf("%.4lf",max);
}
int main()
{
	double distance(double,double,double,double);
	int n,i,j;
	double a[50][2];
	double max=0,temp;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%lf %lf",&a[i][0],&a[i][1]);
	for(i=0;i<n-1;i++)
	{
		for(j=1;j<n;j++)
		{temp=distance(a[i][0],a[i][1],a[j][0],a[j][1]);
		if(temp>max) max=temp;}
	}
	printf("%.4f\n",max);
}
double distance(double a,double b,double c,double d)
{
	double k;
	k=sqrt((a-c)*(a-c)+(b-d)*(b-d));
	return (k);
}
int main()
{
	int i,j,n;
	scanf ("%d",&n);
	double *x,*y;
	double s=0;
         double d;
	x=(double*)malloc(sizeof(double)*n);
	y=(double*)malloc(sizeof(double)*n);
	for (i=0;i<n;i++)
	{
		double x1,y1;
		scanf ("%lf%lf",&x1,&y1);
		*(x+i)=x1;
		*(y+i)=y1;
    }
	
for(i=0;i<n-1;i++)
{
		double x2,y2;
		for(j=1;j<n-i;j++)
		{
			x2=*(x+i)-*(x+i+j);
			y2=*(y+i)-*(y+i+j);
			d=sqrt(x2*x2+y2*y2);
	   		if(d>s)s=d;
		}
}
  printf ("%.4lf\n",s);
  free (x);
  free (y);
  return 0;
}
int main(int argc, char* argv[])
{
	int n,i,t;
	double a[100][2];
	double x=0.0,s;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lf%lf",&a[i][0],&a[i][1]);
	}
    for(i=0;i<n;i++)
	{
		for(t=i+1;t<n;t++)
		{
			s=(a[t][1]-a[i][1])*(a[t][1]-a[i][1])+(a[t][0]-a[i][0])*(a[t][0]-a[i][0]);
            if(s>x)x=s;
		}
	}
	printf("%.4lf\n",(double)sqrt(x));
	return 0;
}
main()
{
 int i,j,n; double ss,max;
 double spot[100][2];
 scanf("%d",&n);
 for(i=0;i<n;i++)
 {
  scanf("%lf%lf",&spot[i][0],&spot[i][1]);
 }
 for(i=0;i<n-1;i++)
 for(j=i+1;j<n;j++)
 {
  ss=sqrt((spot[i][0]-spot[j][0])*(spot[i][0]-spot[j][0])+(spot[i][1]-spot[j][1])*(spot[i][1]-spot[j][1]));
  if(max<=ss)
  max=ss;
 }
 printf("%.4lf",max);
}
int main()
{
 int n,i,j;                        //??n?????i?j
 double x[100],y[100],dis,max;     //??x?y??????dis?????max???
 cin>>n;
 max=0;
 for(i=1;i<=n;i++)
   cin>>x[i]>>y[i];                //????
 for(i=1;i<=n;i++)
  for(j=1;j<=n;j++)
   {
    dis=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2));    //????
    if(dis>max)
     max=dis;                                       //?????
   }
 cout<<fixed<<setprecision(4)<<max;
 return 0;
}
int main ()
{
    int n;
    double point[3000][2],
           ans=0;
    cin >>n;
    for (int i=1;i<=n;i++)
        cin >>point[i][0]>>point[i][1];
    for (int i=1;i<=n;i++)
    {
        for (int j=1;j<=n;j++)
        {
            if (i==j)
                continue;
            double f;
            f=hypot(point[i][0]-point[j][0],point[i][1]-point[j][1]);
            ans=max(ans,f);
        }
    }
    cout <<fixed<<setprecision(4)<<ans;
    return 0;
}
int main()
{
	int i,j,n;
	double x[100],y[100],z[100][100],w;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>x[i]>>y[i];
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
			z[i][j]=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2));
	w=z[0][1];
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
			if(w<z[i][j])
				w=z[i][j];
	printf("%.4f\n",w);
	return 0;
}
int main()
{
	int n, i;
	double max=0;
	scanf("%d", &n);
	struct
	{
		double x, y;
	}a[100];
	for(i=0;i<n;i++)
	{
		scanf("%lf%lf", &a[i].x, &a[i].y);
	}
	for(i=0;i<n;i++)
	{
		for(int j=0;j<n&&j!=i;j++)
		{
			double dis=sqrt(pow(a[i].x-a[j].x,2)+pow(a[i].y-a[j].y,2));
		    if(dis>max)
			{
				max=dis;
			}
		}
	}
	printf("%.4f\n", max);
	return 0;
}
int main(int argc, char* argv[])
{
	double c,d,z,max=0;
	struct{
		double x,y;
	}a[100];
	int i,n,b;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lf%lf",&c,&d);
		a[i].x=c;
		a[i].y=d;
		
	}
    for(i=0;i<n;i++)
	{
		for(b=0;b<n;b++)
		{
		   z=sqrt((a[i].x-a[b].x)*(a[i].x-a[b].x)+(a[i].y-a[b].y)*(a[i].y-a[b].y));
		   if(z>max)
			   max=z;
		   else
			   max=max;
	}
	}
	printf("%.4f\n",max);
	return 0;
}
int main()
{
     int n,i,k;
     scanf("%d",&n);
     double l=0,lest=0;
     double *x;
     x=(double*)malloc(sizeof(double)*n);
     double *y;
     y=(double*)malloc(sizeof(double)*n);
     for(i=0;i<n;i++)
	 {
         scanf("%lf%lf",&x[i],&y[i]);
	 }
	 for(i=0;i<n;i++)
	 {
		 for(k=i+1;k<n;k++)
		 {
			 l=sqrt((x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k]));
			 if(lest<l)
			 {
				 lest=l;
			 }
		 }
	 }
     printf("%.4lf\n",lest);
     free(x);
     free(y);
     return 0;
}
int main()
{
	int i,j,n;double m=0,k=0,x[50],y[50];
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%lf%lf",&x[i],&y[i]);
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
		{
			if(j>=n)break;
			m=pow((x[i]-x[j]),2)+pow((y[i]-y[j]),2);
			if(m>k)k=m;
		}
	printf("%.4f\n",sqrt(k));
	return 0;
}
int main()
{
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int n,year,month1,month2,i,j,k,s;
	cin>>n;
	for (i=0;i<n;i++)
	{
		cin>>year>>month1>>month2;
		if (year%400==0)  //????
			k=1;
		else if (year%100==0)
			k=0;
		else if (year%4==0)
			k=1;
		else
			k=0;
		if (k==1)
			a[2]=29;
		else
			a[2]=28;
		if (month1>month2)
		{
			k=month2;
			month2=month1;
			month1=k;
		}
		s=0;
		for (j=month1;j<month2;j++)  //??????
			s+=a[j];
		if (s%7==0)  //?????
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}
int main()
{
	int input[500][3];
	int n;
	scanf("%d",&n);
	int i,j;
	for(i=0;i<n;i++)
	{
		for(j=0;j<3;j++)
		{
			scanf("%d",&input[i][j]);
		}
	}
	for(i=0;i<n;i++)
	{
		if(input[i][1]>input[i][2])
		{
			int e;
			e=input[i][1];
			input[i][1]=input[i][2];
			input[i][2]=e;
		}
	}
	for(i=0;i<n;i++)
	{
		int result;
		if(input[i][0]==0||(input[i][0]%4==0&&input[i][0]%100!=0)||input[i][0]%400==0)
		{
			result=1;
		}
		else
		{
			result=0;
		}
		int days=0;
		for(j=input[i][1];j<input[i][2];j++)
		{
			
			if(j==1||j==3||j==5||j==7||j==8||j==10)
			{
			days+=31;
			}
			if(j==4||j==6||j==9||j==11)
			{
			days+=30;
			}
			if(j==2)
			{
				days+=28+result;
			}
		}
		if(days%7==0)
		{
			printf("YES\n");
		}
		else if(days%7!=0)
		{
			printf("NO\n");
		}
	}
	return 0;
}
int main() 
{
	int n,i,j,a[200][3],b[12]={31,28,31,30,31,30,31,31,30,31,30,31},s,e;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		for(j=0;j<3;j++)
		{
		    scanf("%d",&a[i][j]);
		}
		if(a[i][1]>a[i][2])
		{
			e=a[i][1];
			a[i][1]=a[i][2];
			a[i][2]=e;
		}
	}
	for(i=0;i<n;i++)
	{
		s=0;
		if(((a[i][0]%4==0)&&(a[i][0]%100!=0))||(a[i][0]%400==0))
		{
			b[1]=29;
			for(j=a[i][1];j<a[i][2];j++)
			{
				s=s+b[j-1];
			}
			if(s%7==0)
			{
				printf("YES\n");
			}
			else
			printf("NO\n");
		}
		else
		{
			b[1]=28;
			for(j=a[i][1];j<a[i][2];j++)
			{
				s=s+b[j-1];
			}
			if(s%7==0)
			{
				printf("YES\n");
			}
			else
			printf("NO\n");
		}
	}
	return 0;
		
}
int main (){
 int n,i,year[200],mouth1[200],mouth2[200],result[200];
 int djt(int year , int mouth);
 scanf("%d", &n);
 for(i=0;i<n;i++){
  scanf("%d %d %d", &year[i], &mouth1[i], &mouth2[i]);
  result[i]= djt( year[i],  mouth1[i]) - djt( year[i],  mouth2[i]);
 }
for(i=0;i<n;i++){
 if(result[i]%7==0){
  printf("YES\n");
 }
 else{
  printf("NO\n");
 }
}
return 0;
}


int djt(int year , int mouth)
{
 int i,djt=0;
    for(i=0;i<mouth;i++){
 if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
  djt+=31;
 }
 if(i==4||i==6||i==9||i==11){
  djt+=30;
 }
 if(i==2){
  if((year%4==0&&year%100!=0)||year%400==0){
   djt+=29;
  }
  else{
   djt+=28;
  }
 }
 }
 return (djt);
}
int main()
{
	int n,i,j,y,m1,m2,sum,sum1,sum2;
	int a[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	int b[12]={0,31,29,31,30,31,30,31,31,30,31,30};
	cin>>n;
    for(i=1;i<=n;i++)
	{
		sum1=0;
		sum2=0;
		cin>>y>>m1>>m2;
        if(y%4==0&&y%100!=0||y%400==0)
		{
			for(j=0;j<=m1-1;j++)
				sum1+=b[j];
		    for(j=0;j<=m2-1;j++)
				sum2+=b[j];
			sum=sum2-sum1;
			if(sum%7==0)cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}
		else
		{
            for(j=0;j<=m1-1;j++)
				sum1+=a[j];
		    for(j=0;j<=m2-1;j++)
				sum2+=a[j];
			sum=sum2-sum1;
			if(sum%7==0)cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}
	}

return 0;
}
int main()
{
	int n,i,x,j,k,p,s=0;
	int month1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int month2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		s=0;
		scanf("%d %d %d",&x,&j,&k);
		if(x%4==0&&x%100!=0||x%400==0)
		{
			if(j<k)
			{
               for(p=j;p<k;p++)
			   {
				   s+=month2[p];
			   }
			   if(s%7==0)
			   {
				   printf("YES\n");
			   }
			   else
			   {
				   printf("NO\n");
			   }
			}
			else if(j>k)
			{
               for(p=k;p<j;p++)
			   {
				   s+=month2[p];
			   }
			   if(s%7==0)
			   {
				   printf("YES\n");
			   }
			   else
			   {
				   printf("NO\n");
			   }
			}
		}
		else
		{
           if(j<k)
		   {  
               for(p=j;p<k;p++)
			   {
				   s+=month1[p];
			   }
			   if(s%7==0)
			   {
				   printf("YES\n");
			   }
			   else
			   {
				   printf("NO\n");
			   }
			}
			else if(j>k)
			{
               for(p=k;p<j;p++)
			   {
				   s+=month1[p];
			   }
			   if(s%7==0)
			   {
				   printf("YES\n");
			   }
			   else
			   {
				   printf("NO\n");
			   }
			}
		}
	}
	return 0;
}
int main()
{
	int i,n,year[200],m1[200],m2[200],run=0,sum[200]={0},j,k,t,s;
  scanf("%d",&n);
for(i=0;i<n;i++)
{
	scanf("%d%d%d",&year[i],&m1[i],&m2[i]);}
for(i=0;i<n;i++){
	run=0;
	if(year[i]%400 == 0 ||(year[i]%4==0 && year[i]%100!=0)){
		run=1;}
	if(run==0){
		if(m1[i]>m2[i]){
			for(j=m2[i];j>=m2[i]&&j<m1[i];j++){
			if(j==1||j==3||j==5||j==7||j==8||j==10||j==12){
				sum[i]+=31;
			}
			else if(j==4||j==6||j==9||j==11){
				sum[i]+=30;}
				else if(j==2){
					sum[i]+=28;}
			}
		}
			else if(m2[i]>m1[i]){
					for(k=m1[i];k>=m1[i]&&k<m2[i];k++){
			if(k==1||k==3||k==5||k==7||k==8||k==10||k==12){
				sum[i]+=31;
			}
			else if(k==4||k==6||k==9||k==11){
				sum[i]+=30;}
				else if(k==2){
					sum[i]+=28;}
					}
				}
				}
				else if(run==1){
						if(m1[i]
							>m2[i])
						{
		     	for(t=m2[i];t>=m2[i]&&t<m1[i];t++){
			if(t==1||t==3||t==5||t==7||t==8||t==10||t==12){
				sum[i]+=31;
			}
			else if(t==4||t==6||t==9||t==11){
				sum[i]+=30;}
				else if(t==2){
					sum[i]+=29;}
			}
						}
			else if(m2[i]>m1[i]){
					for(s=m1[i];s>=m1[i]&&s<m2[i];s++){
			if(s==1||s==3||s==5||s==7||s==8||s==10||s==12){
				sum[i]+=31;
			}
			else if(s==4||s==6||s==9||s==11){
				sum[i]+=30;}
				else if(s==2){
					sum[i]+=29;}
				}
				}
					}
							
	}
for(i=0;i<n;i++){
	if(sum[i]%7==0){
					printf("YES\n");
				}
				else if(sum[i]%7!=0){
					printf("NO\n");
				}
}

return 0;
					}
int main(){
	int n,a,b,c,i,max=0,j;
	int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int e[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	cin>>n;
	for(j=1;j<=n;j++){
		cin>>a;
		cin>>b;
		cin>>c;
		if(a%400==0||(a%4==0&&a%100!=0)){
		   if(b>c)	{
			   for(i=c;i<b;i++)
				   max=max+e[i];
			   }
		   if(b<c){
			   for(i=b;i<c;i++)
			   	 max=max+e[i];
		   }
			   if(max%7==0) cout<<"YES"<<endl;
			   else cout<<"NO"<<endl;
		      max=0;
		}
		else {
			   if(b>c)	{
						   for(i=c;i<b;i++)
							   max=max+d[i];
						   }
			    if(b<c){
						   for(i=b;i<c;i++)
						   	 max=max+d[i];
					   }
						   if(max%7==0) cout<<"YES"<<endl;
						   else cout<<"NO"<<endl;
					      max=0;
		}
	}



}
int main()
{
	int n,i,j,year,m1,m2,t,m;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>year>>m1>>m2;
		t=0;
        if(m1>m2)
			{m=m1;m1=m2;m2=m;}
		if((year%4==0&&year%100!=0)||(year%400==0))
		{
			int a[12]={0,31,29,31,30,31,30,31,31,30,31,30};
			for(j=m1;j<m2;j++)
			{t=t+a[j];}
			if(t%7==0)
				cout<<"YES"<<endl;
			else
				cout<<"NO"<<endl;
		}
		else
		{
			int a[12]={0,31,28,31,30,31,30,31,31,30,31,30};
			for(j=m1;j<m2;j++)
			{t=t+a[j];}
			if(t%7==0)
				cout<<"YES"<<endl;
			else
				cout<<"NO"<<endl;
		}
	}
	return 0;
}
int main()
{
	int n ,i,j,a=0,b=0,c;
	int y[300],m1[300],m2[300];
	scanf("%d",&n);
	for (i=0;i<n;i++)
		scanf("%d%d%d",&y[i],&m1[i],&m2[i]);
	for (i=0;i<n;i++)
	{
		a=0;
		if (m1[i]>m2[i])
		{
			c=m1[i];
			m1[i]=m2[i];
			m2[i]=c;
		}

		for (j=m1[i];j<m2[i];j++)
		{
			if (j==1 || j==3 || j==5 || j==7 || j==8 || j==10||j==12)
				a=a+31;
			else if (j==4|| j==6 || j==9 || j==11)
				a=a+30;
			else if (j==2)
			{
				if ((y[i]%4==0 && y[i]%100 !=0) || y[i] % 400 ==0)
					a=a+29;
				else a=a+28;
			}
		}
		if (a%7==0)
			printf("YES\n");
		else printf("NO\n");
	}




	return 0;
}
int main()
{
    int n,year,month1,month2,i,j,m,x;  
  
    scanf("%d",&n);
    for(j=0;j<n;j++){
      scanf("%d%d%d", &year,&month1,&month2);
       int total1 = 0;
	   int total2 = 0;
      for(i=1; i < month1; i++)
      {
         if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
         {
             total1 += 31;	
         } 
         else if (i == 4 || i ==6 || i == 9 || i==11)
         {
             total1 += 30;
         } 
         else if(i == 2)
         {
	         if(year % 400 == 0||(year % 4==0 && year % 100 != 0))
             {
	          total1 += 29;
			 } 
             else 
             {
	           total1 += 28;
			 }	
         }
      }   total1 += 1;	
      
       for(i=1; i < month2; i++)
      {
         if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
         {
             total2 += 31;	
         } 
         else if (i == 4 || i ==6 || i == 9 || i==11)
         {
             total2 += 30;
         } 
         else if(i == 2)
         {
	     if(year % 400 == 0||(year % 4==0 && year % 100 != 0))
             {
	          total2 += 29;
	     } 
             else 
             {
	          total2 += 28;
	     }	
         }
      }   total2 += 1;	
      if(total2>total1){
          m=total2-total1;
      }else{
          m=total1-total2;
      }
      x=m%7;
      if(x==0){
          printf("YES\n");
      }else{
          printf("NO\n");
      }
    }
    return 0;	
}
int days(int year,int month)
{
	int i,day=0;
	for(i=1;i<month;i++)
	{
		
		if(i==1||i==3||i==5||i==7||i==8||i==10)
			day+=31;
		else if(i==4||i==6||i==9||i==11)
			day+=30;
		else if(i==2&&((year%4==0&&year%100!=0)||year%400==0))
			day+=29;
		else 
			day+=28;
	}
	return day;
}
int main()
{
	int year[200],month1[200],month2[200],day1[200],day2[200];
	int n,i,day;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&year[i],&month1[i],&month2[i]);
		day1[i]=days(year[i],month1[i]);
		day2[i]=days(year[i],month2[i]);
		
	}
	for(i=0;i<n;i++)
	{
		if((day1[i]-day2[i])%7==0)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}
int main()
{
	int n, leap=0, year, mon1, mon2, day=0, mon[2][13]={0,31,28,31,30,31,30,31,31,30,31,30,31,0,31,29,31,30,31,30,31,31,30,31,30,31};
	cin>>n;
	for(int i=0; i<n;i++)
	{
		day=0;
		cin>>year>>mon1>>mon2;
        leap=((year%4==0 && year%100!=0) || year%400==0);
	    int m;
		m=mon1>mon2?mon2:mon1;
		while(m<mon1 || m<mon2)
		{
			day+=mon[leap][m];
			m++;
		}
		if(day%7==0)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}
//???


int days(int m)            //???????1?????1?1?????
{
	int d=0;      
	switch(m) 
	{
	case 12: d+=30;
	case 11: d+=31;
	case 10: d+=30;
	case 9: d+=31;
	case 8: d+=31;
	case 7: d+=30;
	case 6: d+=31;
	case 5: d+=30;
	case 4: d+=31;
	case 3: d+=28;
	case 2: d+=31;
	}
	return d;
}
int main ()
{
	int n,year,month1,month2,days1,days2;  //????????1???2???1???2
	cin>>n;
	for(int i=0;i<n;i++) 
	{
		cin>>year>>month1>>month2;
		days1=days(month1);
		days2=days(month2);
		if (year%4==0&&year%100!=0||year%400==0)   //?????????????????????days+1
		{
			if (month1>2) days1+=1;
			if (month2>2) days2+=1;
		}
		if ((days1-days2)%7==0)                     //?????7??
			cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}
main()
{
      int n,i,a[200],b[200],c[200],d[13],j,min,max,s;
      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
         scanf("%d %d %d",&a[i],&b[i],&c[i]);
      }
      d[1]=31;
      d[3]=31;
      d[4]=30;
      d[5]=31;
      d[6]=30;
      d[7]=31;
      d[8]=31;
      d[9]=30;
      d[10]=31;
      d[11]=30;
      d[12]=31;
      for(i=0;i<n;i++)
      {
      if((a[i]%400==0)||(a[i]%4==0&&a[i]%100!=0))
           d[2]=29;
      else
      {
           d[2]=28;
      }
       s=0;
     if(b[i]>c[i])
      {
         min=c[i];
          max=b[i];
     }
     else
      {
          min=b[i];
          max=c[i];
      }
      for(j=min;j<max;j++)
      {
          s=s+d[j];
      }
     if(s%7==0)
      printf("YES\n");
      else
      printf("NO\n");
      }





      getchar();getchar();getchar();getchar();
}
int main ()
{
	int y ,m1,m2,p;
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int n,s;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>y>>m1>>m2;a[1]=28;s=0;
		if(y%400==0||(y%4==0&&y%100!=0))  a[1]=29;
		if(m2<m1)  
		{
			p=m1;
			m1=m2;
			m2=p;
		}
		for(int j=m1;j<m2;j++)
		{
			s=s+a[j-1];
		}
		if(s%7==0) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}
int main()
{
	int y,m1,m2,n,i,j;
	int d1[12]={31,29,31,30,31,30,31,31,30,31,30,31},d2[12],e1[12],e2[12];
	for(i=0;i<12;i++){
		if(i!=1) d2[i]=d1[i],e1[i]=e2[i]=0;
	    else     d2[i]=28,e1[i]=e2[i]=0;
	}
	for(i=0;i<12;i++){
		for(j=0;j<i;j++){
			e1[i]+=d1[j];
			e2[i]+=d2[j];
		}
	}
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d %d",&y,&m1,&m2);
		if(y%400==0||(y%4==0&&y%100!=0)){
			int f1=(e1[m1-1]>=e1[m2-1])?(e1[m1-1]-e1[m2-1]):(e1[m2-1]-e1[m1-1]);
			 if(f1%7==0)       
				 printf("YES\n");
			 else
				 printf("NO\n");
		}
		else{
			int f2=(e2[m1-1]>=e2[m2-1])?(e2[m1-1]-e2[m2-1]):(e2[m2-1]-e2[m1-1]);
			if(f2%7==0)				
				printf("YES\n");
			else
				printf("NO\n");
		}
	}
	return 0;
}