#include <bits/stdc++.h>
int main() {
  int n, i, t, s1 = 0, p = 1, s2 = 0, c = 0;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &t);
    int a[t];
    for (i = 0; i < t; i++) {
      scanf("%d", &a[i]);
      s1 = s1 + a[i];
      p = p * a[i];
      if (a[i] == 0) {
        s2 = s2 + 1;
        c++;
      } else
        s2 = s2 + a[i];
    }
    if (s1 != 0 && p != 0)
      printf("0\n");
    else if (p != 0 && s1 == 0)
      printf("1\n");
    else if (p == 0 && s1 == 0 || p == 0 && s1 != 0) {
      if (s2 == 0)
        printf("%d\n", c + 1);
      else
        printf("%d\n", c);
    }
    c = 0;
    p = 1;
    s1 = 0;
    s2 = 0;
  }
  return 0;
}
