#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a;
    cin >> a;
    int arr[a];
    int sum = 0;
    int zero = 0;
    for (int i = 0; i < a; i++) {
      cin >> arr[i];
      sum += arr[i];
      if (arr[i] == 0) zero++;
    }
    if (zero == 0) {
      if (sum == 0) {
        cout << "1" << endl;
      } else {
        cout << "0" << endl;
      }
    } else {
      int total = zero;
      sum = sum + zero;
      if (sum == 0) {
        cout << total + 1 << endl;
      } else {
        cout << total << endl;
      }
    }
  }
}
