#include <bits/stdc++.h>
using namespace std;
void go() {
  int n;
  cin >> n;
  vector<int> v(n);
  int sum = 0, zero = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
    if (v[i] == 0) zero++;
  }
  int ans = zero;
  if (ans == 0 && sum == 0) {
    cout << 1 << "\n";
    return;
  }
  if (sum + zero == 0) {
    ans++;
  }
  cout << ans << "\n";
  return;
}
signed main() {
  ios::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) go();
  return 0;
}
