#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int step = 0, sum = 0;
    int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      if (arr[i] == 0) {
        arr[i]++;
        step++;
      }
      sum = sum + arr[i];
    }
    if (sum == 0) step++;
    cout << step << endl;
  }
  return 0;
}
