#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    int sum = 0;
    int numberZero = 0;
    cin >> n;
    vector<int> A(n);
    for (int j = 0; j < n; j++) {
      cin >> A[j];
      if (A[j] == 0) {
        numberZero++;
      }
      sum = sum + A[j];
    }
    int sol = numberZero;
    if (sol + sum == 0) {
      sol++;
    }
    cout << sol << endl;
  }
  return 0;
}
