#include <bits/stdc++.h>
using namespace std;
bool bol = true;
vector<long long int> vec;
char fe, fa, fu, fi;
long long int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v,
    w, x, y, z;
long long int mis = 1000000007, mas = -1, ans, bas, mid, son, st, en, temp, sum,
              prd;
string aa, bb, cc, dd, ee, ff, gg, hh, ii, jj, kk, ll, mm, nn, oo, pp, qq, rr,
    ss, tt, uu, vv, ww, xx, yy, zz;
int main() {
  cin >> q;
  while (q--) {
    sum = 0;
    prd = 0;
    ans = 0;
    vec.clear();
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> x;
      if (x == 0) {
        x++;
        ans++;
      }
      vec.push_back(x);
      sum += x;
      prd *= x;
    }
    while (sum == 0 && prd == 0) {
      prd = prd / vec[0];
      sum++;
      vec[0]++;
      ans++;
      prd *= vec[0];
    }
    cout << ans << "\n";
  }
}
