#include <bits/stdc++.h>
using namespace std;
inline string IntToString(long long a) {
  char x[100];
  sprintf(x, "%lld", a);
  string s = x;
  return s;
}
inline long long StringToInt(string a) {
  char x[100];
  long long res;
  strcpy(x, a.c_str());
  sscanf(x, "%lld", &res);
  return res;
}
void solve() {
  int n;
  cin >> n;
  vector<int> a;
  int inp;
  while (n--) {
    cin >> inp;
    a.push_back(inp);
  }
  int s = 0;
  int m = 1;
  for (int i : a) {
    s += i;
    m *= i;
  }
  int c = 0, z = 0;
  if (m == 0) {
    for (int i : a) {
      if (i == 0) z++;
    }
    c = z;
    s += z;
  }
  if (s == 0) c++;
  cout << c << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
