#include <bits/stdc++.h>
using namespace std;
#define ll long long
void solve() {
int n; cin >> n;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int ways[n] {};
int ans = 0;
for (int i = 0; i < n; i++) {
if (!ways[i]) ans++;
if (i + arr[i] < n) ways[i + arr[i]]++;
}
// cout << ans << " ";
for (int i = 0; i < n; i++) {
int a = ans;
if (i + arr[i] < n and ways[i + arr[i]] == 1) a++;
cout << a << " ";
}
cout << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tt = 1;
cin >> tt;
while (tt--) {
solve();
}
}