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