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