#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  int res[t];
  for (int i = 0; i < t; i++) {
    int n;
    scanf("%d", &n);
    int a[n];
    int sum = 0;
    int pro = 1;
    int d = 0;
    for (int j = 0; j < n; j++) {
      scanf("%lli", &a[j]);
      sum += a[j];
      if (a[j] == 0) d++;
    }
    if (d == 0) {
      if (sum == 0)
        res[i] = 1;
      else
        res[i] = 0;
    } else {
      if (sum == 0) {
        res[i] = d;
      } else {
        if ((d + sum) == 0) {
          res[i] = d + 1;
        } else
          res[i] = d;
      }
    }
  }
  for (int i = 0; i < t; i++) {
    printf("%d\n", res[i]);
  }
  return 0;
}
