#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <math.h>
#include <fstream>
#define MAXN 500050
using namespace std;
struct Node
{
int value;
bool flag;
}node[MAXN];
bool cmp(const Node& x, const Node& y)
{
return x.value < y.value;
}
int main(void)
{
int T;
//ofstream fout("D:\\cplusplus\\out.txt");
scanf("%d", &T);
while (T--)
{
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
int temp;
scanf("%d", &temp);
node[i].value = abs(temp);
node[i].flag = (temp > 0) ? true : false;
}
sort(node, node + n, cmp);
bool ok = (node[0].flag) ? true : false;
int coun = 0;
for (int i = 0; i < n; i++)
{
if (ok&&node[i].flag) { coun++; ok = false; }
if (!ok&&!node[i].flag) { coun++; ok = true; }
}
printf("%d\n", coun);
//fout << coun << endl;
}
return 0;
}