#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int INF = 1e9 + 7;
const int N = 2e5 + 7;
const int M = 5e6 + 7;
int a[N];
signed main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n;
    int ans = 0, sum = 0, num = 0;
    for (int i = 1; i <= n; i++) {
      cin >> x;
      if (x == 0) ans++, x++;
      sum += x;
    }
    if (sum == 0) ans++;
    cout << ans << "\n";
  }
  return 0;
}
