#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long power(long long a, long long b) {
  long long ans = 1;
  if (b == 0) return 1;
  if (b % 2 == 0) {
    ans = (ans * power((a * a) % mod, b / 2)) % mod;
  } else {
    ans = (ans * a) % mod;
    ans = (ans * power((a * a) % mod, b / 2)) % mod;
  }
  return ans;
}
bool dfs(long long node, long long par, long long* p, long long* h,
         vector<long long>* g) {
  bool ret = 1;
  long long sum = 0;
  long long x = p[node];
  for (long long i = 0; i < g[node].size(); i++) {
    if (g[node][i] != par) {
      ret &= dfs(g[node][i], node, p, h, g);
      p[node] += p[g[node][i]];
      sum += h[g[node][i]];
    }
  }
  if (h[node] > p[node] || h[node] < (-p[node]) ||
      (g[node].size() > 1 && (sum) > (h[node] + x)))
    ret = 0;
  if (g[node].size() > 1 && x == 0 && (h[node] - sum) % 2 != 0) ret = 0;
  if (p[node] % 2 != abs(h[node]) % 2) ret = 0;
  return ret;
}
signed main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n], sm = 0, ct = 0;
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
      sm += arr[i];
      if (arr[i] == 0) ct++;
    }
    if (ct == 0 && sm != 0)
      cout << 0 << endl;
    else {
      if (ct == 0)
        cout << 1 << endl;
      else {
        if (sm + ct == 0)
          cout << ct + 1 << endl;
        else
          cout << ct << endl;
      }
    }
  }
  return 0;
}
