#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, sum = 0, num = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      int value;
      cin >> value;
      sum += value;
      if (value == 0) {
        num++;
      }
    }
    if (sum == 0) {
      if (num == 0) {
        cout << 1 << "\n";
      } else {
        cout << num << "\n";
      }
    } else {
      if (num == 0) {
        cout << 0 << "\n";
      } else {
        if (sum + num != 0) {
          cout << num << "\n";
        } else {
          cout << num + 1 << "\n";
        }
      }
    }
  }
  return 0;
}
