#include <bits/stdc++.h>
using namespace std;
int main() {
  long int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n, x, zer = 0;
    cin >> n;
    long int s = 0;
    for (int j = 0; j < n; j++) {
      cin >> x;
      s += x;
      if (x == 0) zer++;
    }
    if (zer == 0) {
      if (s == 0)
        cout << 1 << endl;
      else
        cout << 0 << endl;
    } else {
      s += zer;
      if (s == 0)
        cout << zer + 1 << endl;
      else
        cout << zer << endl;
    }
  }
  return 0;
}
