#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    int k = 0, s = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] == 0) {
        a[i] += 1;
        k += 1;
      }
      s = s + a[i];
    }
    if (s == 0) k += 1;
    cout << k << endl;
  }
  return 0;
}
