#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 300005;
long long gcd(long long n, long long m) {
  if (n == 0)
    return m;
  else
    return gcd(m % n, n);
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long sum = 0, cnt = 0;
    for (long long i = 1; i <= n; i++) {
      long long x;
      cin >> x;
      sum += x;
      if (x == 0) cnt++;
    }
    if (cnt > 0) {
      if (sum + cnt == 0) {
        cout << cnt + 1 << endl;
      } else {
        cout << cnt << endl;
      }
      continue;
    }
    if (sum == 0) {
      cout << "1" << endl;
    } else {
      cout << "0" << endl;
    }
  }
}
