#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int co[t];
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int ar[n], sum = 0, c = 0;
    for (int j = 0; j < n; j++) {
      cin >> ar[j];
      if (ar[j] == 0) {
        ar[j]++;
        c++;
      }
      sum += ar[j];
    }
    if (sum != 0 && c == 0) {
      co[i] = 0;
    } else if (sum != 0 && c != 0) {
      co[i] = c;
    } else if (sum == 0 && c != 0) {
      co[i] = c + 1;
    } else {
      co[i] = 1;
    }
  }
  for (int i = 0; i < t; i++) {
    cout << co[i] << endl;
  }
  return 0;
}
