COVID question

Sir i just wanted to know the reason due to which my below given solution
is not considered to be right for the COVID question in recent april
challenge.

#include
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int n;
cin >> n;
int a[n] , i , k , lastone = -1 , m = 0 , x = 0;
for(i=0;i> a[i];
x += a[i];
if(a[i] == 1 && lastone == -1)
{
lastone = i;
}
}
if(x == 0)
{
cout << “NO” << endl;
}
else if(x>0)
{
for( k = lastone + 1 ; k < n; k++)
{
if(a[k]==1)
{
long long int check = k - lastone;
lastone=k;
if(check >= 6)
{
m=1;
}
else if(check < 6)
{
m=0;
break;
}
}
}
if(m == 0)
{
cout << “NO” << endl;
}
else if(m == 1)
{
cout << “YES” << endl;
}
}

}
}

is this giving right answers for test cases

yes