#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    vector<int> v(n, 0);
    for (int j = 0; j < n; j++) cin >> v[j];
    int sum = 0, prod = 1;
    for (int j = 0; j < n; j++) {
      sum += v[j];
      prod *= v[j];
    }
    if (sum && prod) {
      cout << 0 << endl;
      continue;
    }
    int steps = 0;
    if (prod == 0) {
      unsigned int ct = count(v.begin(), v.end(), 0);
      steps += ct;
      sum += ct;
      if (!sum) steps++;
    } else if (!sum) {
      steps++;
    }
    cout << steps << endl;
  }
  return 0;
}
