#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n, sum = 0;
    int z = 0;
    cin >> n;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      sum = sum + a[i];
      if (a[i] == 0) {
        z++;
      }
    }
    int ans = 0;
    if (sum == 0) {
      ans = 1;
      sum++;
    }
    if (z != 0) {
      ans = max(ans, z);
      if (sum == 1) {
        sum = sum + ans - 1;
      } else {
        sum = sum + ans;
      }
    }
    if (sum == 0) {
      ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
