#include <bits/stdc++.h>
const long long maxn = 2e5 + 100;
using namespace std;
const int mod = 1e9 + 7;
int a[maxn];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    cin >> n;
    int sum = 0;
    for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i];
    int step = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == 0) {
        a[i] += 1;
        sum += 1;
        step += 1;
      }
    }
    if (sum == 0) {
      int ok = 0;
      for (int i = 1; i <= n; i++) {
        if (a[i] != -1) {
          printf("%d\n", step + 1);
          ok = 1;
          break;
        }
      }
    } else
      printf("%d\n", step);
  }
}
