#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void solve(int cs) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int> sf(n, 0);
int cnt = 0;
for (int i = n - 1; i; i--) {
if (i + a[i] < n) {
sf[i + a[i]]++;
if (sf[i + a[i]] == 1) {
cnt += 1;
}
}
}
for (int i = 0; i < n; i++) {
cout << n - cnt << " \n"[i == n - 1];
if (i < n - 1) {
if (i + 1 + a[i + 1] < n) {
sf[i + 1 + a[i + 1]]--;
if (sf[i + 1 + a[i + 1]] == 0) {
cnt -= 1;
}
}
}
if (i + a[i] < n) {
sf[i + a[i]]++;
if (sf[i + a[i]] == 1) {
cnt += 1;
}
}
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tc = 1;
cin >> tc;
for (int cs = 1; cs <= tc; cs++) {
solve(cs);
}
return 0;
}