#include <bits/stdc++.h>
using namespace std;
void solve() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int *arr = new int[n];
    int sum = 0;
    int prod = 1;
    int zero = 0;
    int neg = 0;
    int neg_one = 0;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      sum += arr[i];
      prod *= arr[i];
      if (arr[i] == 0)
        zero++;
      else if (arr[i] < 0) {
        neg++;
        if (arr[i] == -1) neg_one++;
      }
    }
    if (sum != 0 and prod != 0) {
      cout << "0" << endl;
    } else {
      if (prod == 0) {
        int64_t h = sum + zero;
        if (h == 0)
          cout << zero + 1 << endl;
        else
          cout << zero << endl;
      } else if (prod != 0) {
        cout << "1" << endl;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
