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

void solve(){
	
	int n;
	cin>>n;
	vector <int> a(n);
	
	int i =0;
	int j =0;
	int count = 0;
	
	for(int x = 0; x < n; x++){
		cin>>a[x];
	}
	for(int x = 0; x < n; x++){
		if(a[x] == -1){
			i++;
		}else if(a[x] == 1){
			j++;
		}
	}
	
	while(i>j){
		i--;
		j++;
		count++;
	}
	
	// cout<<i<<" "<<j<<endl;
	if( j-i>=0 && i%2 == 0 ){
		cout << count <<endl;
	}else cout<<count+1<<endl;

}

int main() {
	int t;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}