#include <bits/stdc++.h>
#define ll long long
#define endll '\n';
#define pb push_back
#define all(v) v.begin(), v.end()
using namespace std;
const int mod = 1e9 + 7, N = 1e6;
void solve()
{
int n;
cin >> n;
int ar[n + 4];
for (int i = 1; i <= n; i++)
cin >> ar[i];
int click = 0;
int vis[n + 4] = {0};
int last[n + 4] = {0};
int clicked[n + 4] = {0};
for (int i = 1; i <= n; i++)
{
if (vis[i] == 0)
{
click++;
clicked[i] = 1;
vis[i] = 0;
}
int nxt = ar[i] + i;
if (nxt <= n)
{
vis[nxt] += 1;
last[nxt] = i;
}
}
// cout << "Clicke = ";
// for (int i = 1; i <= n; i++)
// {
// cout << clicked[i] << " ";
// }
// cout << endll;
// cout << "vis = ";
// for (int i = 1; i <= n; i++)
// {
// cout << vis[i] << " ";
// }
// cout << endll;
// cout << "last = ";
// for (int i = 1; i <= n; i++)
// {
// cout << last[i] << " ";
// }
// cout << endll;
for (int i = 1; i <= n; i++)
{
int ans = click;
int nxt = ar[i] + i;
if (clicked[i] == 0)
{
if (vis[i])
{
}
else
ans++;
if (nxt <= n)
{
if (vis[nxt] == 1 && last[nxt] == i)
{
ans++;
}
}
}
else
{
if (nxt <= n)
{
if (vis[nxt] == 1 && last[nxt] == i)
{
ans++;
}
}
}
cout << ans << " ";
}
cout << endll;
}
int32_t main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int t = 1;
cin >> t;
while (t--)
{
solve();
}
return 0;
}