#include <bits/stdc++.h>
using namespace std;
const int maxn=5e5+60;
struct node
{
int x;
bool f;
}a[maxn];
bool cmp(node a,node b)
{
return a.x<b.x;
}
int main()
{
int p;
scanf("%d",&p);
for(int kase = 1;kase<=p;kase++)
{
int n;
scanf("%d",&n);
if(n==0) {
printf("0\n");continue;}
for(int i=1;i<=n;i++)
{
int x;
scanf("%d",&x);
a[i].x=abs(x);
if(x<0) a[i].f=false;
else a[i].f=true;
}
sort(a+1,a+1+n,cmp);
bool flag=a[1].f;
int ans=1;
for(int i=2;i<=n;i++)
{
// cout<<"a[i]= "<<a[i].x<<endl;
if(a[i].f!=flag)
{
ans++;
flag=a[i].f;
//cout<<ans<<" "<<a[i].x<<endl;
}
}
printf("%d\n",ans);
}
return 0;
}
/*
2
5
7
-2
6
9
-3
8
11
-9
2
5
18
17
-15
4
*/