#include <bits/stdc++.h>
using namespace std;
int cmp(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
int cmp1(pair<int, int> a, pair<int, int> b) { return a.second < b.second; }
int binarySearch(vector<string> &v, string &x, int n) {
  int l = 0;
  int r = n - 1;
  while (l <= r) {
    int m = l + (r - l) / 2;
    int res = 1;
    if (x == (v[m])) {
      res = 0;
    }
    if (res == 0) {
      return m;
    }
    if (x > (v[m])) {
      l = m + 1;
    } else {
      r = m - 1;
    }
  }
  return -1;
}
void check(string s) {
  long long len = s.length();
  string str(len, '1');
  if (s == str && stoi(str) >= 11) {
    cout << "YES" << endl;
    return;
  } else if (stoi(s) < 11) {
    cout << "NO" << endl;
    return;
  } else {
    long long ans = stoll(s) - stoll(str);
    if (ans > 0) {
      check(to_string(ans));
    } else {
      string s1(len - 1, '1');
      ans = stoll(s) - stoll(s1);
      check(to_string(ans));
    }
    return;
  }
}
void twoWaySort(int arr[], int n) {
  for (int i = 0; i < n; i++)
    if (arr[i] & 1) arr[i] *= -1;
  sort(arr, arr + n);
  for (int i = 0; i < n; i++)
    if (arr[i] & 1) arr[i] *= -1;
}
void display(double a[], int n) {
  for (int i = 0; i < n; i++) {
    cout << a[i] << "  ";
  }
  cout << endl;
}
void findPermutations(double a[], int n, int m) {
  sort(a, a + n);
  long long sum = 0;
  bool check = 1;
  do {
    display(a, n);
    for (int i = 1; i <= n; i++) {
      for (int j = i; j <= n; j++) {
        sum += a[j - 1] / (double)j;
        cout << sum << " ";
      }
    }
    cout << sum << endl;
  } while (next_permutation(a, a + n));
}
vector<int> a[100001];
int vis[100001] = {0};
map<int, int> m;
int dis[2001] = {0};
int color[2001] = {0};
int in[2001] = {0};
int out[2001] = {0};
int cnt = 1;
long long ans = 1;
int call = 1;
int longest[2001] = {0};
int maxD, maxNode;
int subTreeSize[2001] = {0};
int dfs(int n) {
  vis[n] = 1;
  int current_size = 1;
  for (int child : a[n]) {
    if (vis[child] == 0) {
      current_size += dfs(child);
    }
  }
  subTreeSize[n] = current_size;
  return current_size;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    int sum1 = 0, sum2 = 0;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] > 0) {
        sum1 += a[i];
      } else if (a[i] == 0) {
        cnt++;
      } else {
        sum2 += a[i];
      }
    }
    if (cnt == 0) {
      if (sum1 + sum2 == 0) {
        cout << 1 << endl;
      } else {
        cout << 0 << endl;
      }
    } else {
      if (sum1 + sum2 == 0) {
        cout << cnt << endl;
      } else {
        if (sum1 + cnt + sum2 == 0) {
          cout << cnt + 1 << endl;
        } else {
          cout << cnt << endl;
        }
      }
    }
  }
}
