#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    unsigned long long int sum = 0, p = 1, cnt = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
      p = (p % 1000000007 * a[i]);
      if (a[i] == 0) cnt++;
    }
    if (p != 0 && sum == 0)
      cout << "1" << endl;
    else if (p == 0 && sum == 0) {
      cout << cnt << endl;
    } else {
      if ((cnt + sum) == 0)
        cout << cnt + 1 << endl;
      else
        cout << cnt << endl;
    }
  }
}
