#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    int sum = 0;
    int counts = 0;
    for (int i = 0; i < n; ++i) {
      int a;
      cin >> a;
      if (a == 0) counts++;
      sum += a;
    }
    int temp = 0;
    if (sum == 0) temp = 1;
    if (counts + sum == 0) counts++;
    cout << max(counts, temp) << endl;
  }
}
