Here is my code for the question:

#include<stdio.h>

```
int main(){
int arr[100];
int narr[50];
narr[0]=0;
int t,n,i,j=0,k;
scanf("%d",&t);
for(;t>0;t--) {
int flag=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&arr*);
}
for(i=1;i<=7;i++){
while(arr[j]==i){
j++;
}
narr*=j;
for(k=i-1;k>0;k--){
narr*-=narr[k];
}
}
for(i=6;i>0;i--){
while(arr[j]==i){
j++;
}
narr[14-i]=j;
for(k=13-i;k>0;k--){
narr[14-i]-=narr[k];
}
}
for(i=1;i<14;i++){
if(narr*!=0&&(narr*==narr[14-i])&& arr[i-1]<8&&arr[i-1]>0){
}
else
{
flag = 1;
break;
}
}
if(flag==0)
printf("yes
```

");

else

printf("no

");

```
}
}
```

I have tried several inputs and i got the right output.Can anyone point out where this code is wrong?