RINBOWA-showing wrong answer. why is it so?

#include
using namespace std;
int main()
{ int t,n,a[101],i,j,f;

cin>>t;
for(i=0;i<t;i++)
{   
    cin>>n;
    for(j=0;j<n;j++)
    {cin>>a[j];}
    
    if(a[n/2]==7)
    {    for(j=0;j<n/2;j++)
        {   if((a[j])!=(a[n-j-1]))
            {    f=1;break;}
         }
        f==0?cout<<"\nyes":cout<<"\nno";
   }
    else cout<<"\nno";
}
return 0;

}

where are you checking that all elements are less than 7?

so modified it.

maxi=0;

for(j=0;j<n;j++)

{

    if(a[j]>=maxi)

        maxi=a[j];

}

if(maxi==7)

… remains same. still its not wroking.

//