#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int neg_sum = 0, pos_sum = 0, zero_cnt = 0;
    while (n--) {
      int x;
      cin >> x;
      if (x < 0) {
        neg_sum += x;
      } else if (x > 0) {
        pos_sum += x;
      } else {
        ++zero_cnt;
      }
    }
    int cnt = 0;
    if (neg_sum + pos_sum == 0) {
      if (zero_cnt) {
        cnt += zero_cnt;
      } else {
        cnt += 1;
      }
      cout << cnt << "\n";
      continue;
    }
    if (zero_cnt) {
      int i = 0;
      while (true) {
        ++i;
        if (neg_sum + pos_sum + (zero_cnt * i)) {
          break;
        }
      }
      cnt = zero_cnt + i - 1;
      cout << cnt << "\n";
      continue;
    }
    cout << cnt << "\n";
  }
  return 0;
}
