code name :splst

#include<stdio.h>
int main(void)
{int t,l,i,f,a;
long long int x,y,p[5],count,m,n,j,k,temp;

scanf("%d\n",&t);
for(f=0;f<t;f++)
{ count=0;
for(i=0;i<5;i++)
{scanf("%lld",&p[i]);

 } 
    x=p[3];
    y=p[4];

  for(i=0;i<3;i++)
   { 
      for(k=0;k<=p[i];k++)
       {  j=p[i]-k;
            a=i;
       i++; 
     if(i==3)
      i=0;
      n=p[i]+j;
      i++;
      if(i==3)
       i=0;

     m=p[i]+k;
     if(n==x&&m==y || n==y&&m==x)
     {
        printf("yes\n");
          count++;
          goto label;
     }
        
         i=a;
        
      }

    }
    
       if(count==0)
       printf("no\n");

   label:
    ;   }
return 0;

}
can you tell me the mistake in code.