CLOSCHEF why is this code giving WA?

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(a,b,c) for (ll(a) = (b); (a) < (c); a++)
#define wit int t;cin>>t; while (t–)
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
int main()
{
fio
wit{
ll n;
cin>>n;
ll a[n];
rep(i,0,n)
{
cin>>a[i];
}
sort(a,a+n);
int count=0,countminusone=0,countone=0;
rep(i,0,n)
{
if(abs(a[i])>1) count++;
else if(a[i]==-1) countminusone++;
else if(a[i]==1) countone++;
}
if(count>1||(countminusone==1&&count==1)||(countminusone==2&&countone==0))
cout<<0<<endl;
else
cout<<1<<endl;
}
return 0;
}

Consider the test input:

1
3
-1 -1 -1 
1 Like