#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int a[n];
    int sum = 0, prod = 1, cnt = 0, cnnt = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i], prod *= a[i];
    }
    for (int i = 0; i < n; i++) {
      if (a[i] == 0) {
        cnt++;
        sum++;
      }
    }
    while (sum == 0) {
      cnt++;
      sum++;
    }
    cout << cnt << endl;
    ;
  }
  return 0;
}
