import bisect
for _ in range(int(input())):
n=int(input())
a=sorted(map(int,input().split()))
m=set()
e=[]
w={}
for i in a:
if i not in m:
m.add(i)
else:
e+=[i]
w[i]=w.get(i,0)+1
s=0
r=[]
t=0
for i in range(n+1):
if t:
r+=[-1]
else:
if i not in m:
o=bisect.bisect_right(e,i)
if o==0:
t=1
r+=[s]
else:
r+=[s]
s+=i-e[o-1]
e.pop(o-1)
else:
r+=[w[i]+s]
print(*r)
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define N 300005
const int mod = 998244353;
template<typename T>void print(vector<T>&a,int c=0) {
for(auto&it :a)cout << it+c<< " ";
cout << endl;
}
void fast() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
ll prime[N];
void sieve() {
memset(prime,0,sizeof(prime));
for(ll i=2;i<N;i++) {
if(!prime[i]) {
prime[i] = i;
for(ll j = i*i;j<N;j+=i) {
prime[j] = i;
}
}
}
}
bool isPrime(int a) {
if(a <= 1) return false;
if(a <= 3) return true ;
if(a%2 == 0 || a%3 == 0) return false;
for(int i=5;i*i<=a;i+=6) {
if(a%i == 0 || a%(i+2) == 0) return false;
}
return true ;
}
ll pow(ll a, ll b, ll m = 998244353) {
if(b == 0) return 1;
ll ans = pow(a, b / 2, m);
if(b&1) return (ans * ans * a) % m;
else return (ans * ans) % m;
}
int main(){
fast();
/* Code starts here -------------------------------------------> */
int t;cin>>t;
while(t--) {
int n;cin>>n;
vector<int>a(n);
vector<ll>cnt(n + 1, 0), res(n + 1, -1);
for(auto&it : a) {
cin>>it ;
cnt[it]++;
}
ll ans = 0;
int op = 0;
vector<pair<int ,int>>tmp;
for(int i=0;i<=n;i++) {
if(op != i) break;
res[i] = 1LL * (ans + cnt[i]);
if(cnt[i] == 0) {
if(tmp.size() != 0) {
ans += 1LL * (i - tmp.back().ff);
++op;
if(--tmp.back().ss == 0) {
tmp.pop_back();
}
}
}else {
++op;
if(cnt[i] > 1) tmp.push_back({i, cnt[i] - 1});
}
}
print(res);
}
return 0;
}
1650C - Weight of the System of Nested Segments | 1097A - Gennady and a Card Game |
248A - Cupboards | 1641A - Great Sequence |
1537A - Arithmetic Array | 1370A - Maximum GCD |
149A - Business trip | 34A - Reconnaissance 2 |
59A - Word | 462B - Appleman and Card Game |
1560C - Infinity Table | 1605C - Dominant Character |
1399A - Remove Smallest | 208A - Dubstep |
1581A - CQXYM Count Permutations | 337A - Puzzles |
495A - Digital Counter | 796A - Buying A House |
67A - Partial Teacher | 116A - Tram |
1472B - Fair Division | 1281C - Cut and Paste |
141A - Amusing Joke | 112A - Petya and Strings |
677A - Vanya and Fence | 1621A - Stable Arrangement of Rooks |
472A - Design Tutorial Learn from Math | 1368A - C+= |
450A - Jzzhu and Children | 546A - Soldier and Bananas |