#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  long long t, n, m;
  cin >> t;
  while (t--) {
    cin >> n;
    long long zero = 0, sum = 0;
    vector<long long> v(n);
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      sum += v[i];
      if (!v[i]) zero++;
    }
    if (sum == 0 && zero == 0)
      cout << 1 << endl;
    else if (sum == 0 && zero != 0)
      cout << zero << endl;
    else if (sum != 0 && zero == 0)
      cout << zero << endl;
    else {
      if (sum > 0)
        cout << zero << endl;
      else if (zero + sum == 0)
        cout << zero + 1 << endl;
      else
        cout << zero << endl;
    }
  }
  return 0;
}
