Dmitry has an array of $n$ non-negative integers $a_1, a_2, \dots, a_n$.

In one operation, Dmitry can choose any index $j$ ($1 \le j \le n$) and increase the value of the element $a_j$ by $1$. He can choose the same index $j$ multiple times.

For each $i$ from $0$ to $n$, determine whether Dmitry can make the $\mathrm{MEX}$ of the array equal to exactly $i$. If it is possible, then determine the minimum number of operations to do it.

The $\mathrm{MEX}$ of the array is equal to the minimum non-negative integer that is not in the array. For example, the $\mathrm{MEX}$ of the array $[3, 1, 0]$ is equal to $2$, and the array $[3, 3, 1, 4]$ is equal to $0$.


-----Input-----

The first line of input data contains a single integer $t$ ($1 \le t \le 10^4$) — the number of test cases in the input.

The descriptions of the test cases follow.

The first line of the description of each test case contains a single integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the length of the array $a$.

The second line of the description of each test case contains $n$ integers $a_1, a_2, \dots, a_n$ ($0 \le a_i \le n$) — elements of the array $a$.

It is guaranteed that the sum of the values $n$ over all test cases in the test does not exceed $2\cdot10^5$.


-----Output-----

For each test case, output $n + 1$ integer — $i$-th number is equal to the minimum number of operations for which you can make the array $\mathrm{MEX}$ equal to $i$ ($0 \le i \le n$), or -1 if this cannot be done.


-----Examples-----

Input
5
3
0 1 3
7
0 1 2 3 4 3 2
4
3 0 0 0
7
4 6 2 3 5 0 5
5
4 0 1 0 4
Output
1 1 0 -1 
1 1 2 2 1 0 2 6 
3 0 1 4 3 
1 0 -1 -1 -1 -1 -1 -1 
2 1 0 2 -1 -1


-----Note-----

In the first set of example inputs, $n=3$:

to get $\mathrm{MEX}=0$, it is enough to perform one increment: $a_1$++;

to get $\mathrm{MEX}=1$, it is enough to perform one increment: $a_2$++;

$\mathrm{MEX}=2$ for a given array, so there is no need to perform increments;

it is impossible to get $\mathrm{MEX}=3$ by performing increments.

Difficulty: MEDIUM_HARD

Solutions:
from collections import Counter
T = int(input())
for i in range(T):
	n = int(input())
	s = []
	a = list(map(int, input().strip().split()))
	c = Counter(a)
	ans = [-1] * (n + 1)
	ans[0] = c[0]
	(st, cp) = (0, 0)
	for j in range(n):
		cp += c[j]
		if cp <= j:
			break
		if c[j] == 0:
			st += j - s.pop()
		ans[j + 1] = st + c[j + 1]
		s += [j] * (c[j] - 1)
	for j in range(n + 1):
		print(ans[j], end=' ')
	print('')


from collections import deque
for _ in range(int(input())):
	n = int(input())
	d = {}
	deq = deque()
	a = list(map(int, input().split()))
	flag = 0
	v = [0] * (n + 1)
	for el in a:
		v[el] += 1
	ans = 0
	for i in range(n + 1):
		if v[i]:
			if flag:
				print(-1, end=' ')
			else:
				print(ans + v[i], end=' ')
			for j in range(1, v[i]):
				deq.append(i)
		else:
			if flag:
				print(-1, end=' ')
			else:
				a = 0
				print(ans + v[i], end=' ')
			if len(deq) != 0:
				c = deq.pop()
				ans += abs(c - i)
			else:
				flag = 1
	print()


import sys
import math
import collections
import heapq
dy = [1, 0, -1, 0]
dx = [0, 1, 0, -1]
r = lambda : sys.stdin.readline().rstrip()
MIS = lambda : map(int, r().split())
for _ in range(int(r())):
	N = int(r())
	L = sorted(MIS())
	cnt = [0] * (N + 1)
	visited = [0] * (N + 1)
	row = -1
	for i in L:
		cnt[i] += 1
		if row + 1 == i:
			row = i
	pq = []
	flag = 1
	ans = 0
	for i in range(N + 1):
		if flag == 0:
			print(-1, end=' ')
			continue
		elif row >= i:
			print(cnt[i], end=' ')
			for j in range(cnt[i] - 1):
				heapq.heappush(pq, -i)
			visited[i] = 1
		elif row + 1 == i:
			print(0, end=' ')
			if pq:
				a = -heapq.heappop(pq)
				ans += i - a
			else:
				flag = 0
		else:
			print(ans + cnt[i], end=' ')
			if cnt[i]:
				for j in range(cnt[i] - 1):
					heapq.heappush(pq, -i)
				visited[i] = 1
			elif pq:
				a = -heapq.heappop(pq)
				ans += i - a
			else:
				flag = 0
	print()


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	a.append(10 ** 9)
	less = 0
	equal = 0
	unused = []
	last = 0
	for mex in range(n + 1):
		while a[less + equal] < mex:
			less += 1
		while a[less + equal] == mex:
			equal += 1
		if less < mex or last < 0:
			print('-1 ' * (n + 1 - mex), end='')
			break
		print(equal + last, end=' ')
		if not equal:
			if not unused:
				last = -1
			else:
				last += mex - unused.pop()
		unused.extend([mex] * (equal - 1))
		less += equal
		equal = 0
	print()


eps = 1e-09
t = int(input())
for t in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	a = sorted(a)
	cnt = [0] * (n + 1)
	for x in a:
		cnt[x] += 1
	stk = []
	(j, tot) = (0, 0)
	for i in range(n + 1):
		while j < n and a[j] <= i - 1:
			stk.append(a[j])
			j += 1
		if len(stk) == 0 and i > 0:
			for j in range(i, n + 1):
				print('-1', end=' ')
			break
		if len(stk) > 0:
			tot += i - 1 - stk[-1]
			stk.pop()
		print(tot + cnt[i], end=' ')
	print()


import sys
t = int(input())
for _ in range(t):
	n = int(input())
	d = {i: 0 for i in range(0, n + 1)}
	m = list(map(int, sys.stdin.readline().split()))
	ans = 0
	ev = []
	key = True
	for i in m:
		d[i] += 1
	if d[0] == 0:
		print('0', end=' ')
		key = False
	else:
		print(ans + d[0], end=' ')
		for j in range(d[0] - 1):
			ev.append(0)
	for i in range(1, n + 1):
		if key == True:
			if d[i - 1] > 0:
				if i in d:
					print(ans + d[i], end=' ')
					for j in range(d[i] - 1):
						ev.append(i)
				else:
					print(ans, end=' ')
			elif ev and key == True:
				ans += i - 1 - ev.pop()
				if i in d:
					print(ans + d[i], end=' ')
					for j in range(d[i] - 1):
						ev.append(i)
				else:
					print(ans)
			else:
				print('-1', end=' ')
				key = False
		else:
			print('-1', end=' ')
	print('')


from queue import LifoQueue
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	stack = LifoQueue(maxsize=n + 3)
	kcount = [0 for x in range(n + 1)]
	supporter = [-1 for x in range(n + 1)]
	for i in a:
		kcount[i] += 1
	count = [x for x in kcount]
	for i in range(n - 1, -1, -1):
		if count[i] == 0:
			stack.put(i)
		else:
			while stack.empty() == False and count[i] > 1:
				p = stack.get()
				supporter[p] = i
				count[i] -= 1
	ans = [0 for x in range(n + 1)]
	if stack.empty() == False:
		c = stack.get()
		for i in range(c + 1, n + 1):
			ans[i] = -1
	suffix = [0 for x in range(n + 1)]
	for x in range(n + 1):
		if supporter[x] != -1:
			suffix[x] = x - supporter[x]
	for i in range(1, n + 1):
		suffix[i] = suffix[i - 1] + suffix[i]
	for i in range(0, n + 1):
		if ans[i] == -1:
			break
		elif i != 0:
			ans[i] = suffix[i - 1] + kcount[i]
		else:
			ans[i] = kcount[i]
	for i in ans:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ls = [0] * (n + 1)
	cnt = 0
	for i in a:
		ls[i] += 1
	for i in range(n + 1):
		if ls[i] > 1:
			cnt += ls[i]
			cnt -= 1
		elif ls[i] == 0 and cnt > 0:
			cnt -= 1
		elif ls[i] == 0 and cnt == 0:
			ls[i] = -1
			break
	ind = n + 1
	for i in range(n + 1):
		if ls[i] == -1:
			ind = i
			for j in range(i + 1, n + 1):
				ls[j] = -1
			break
	xx = []
	xxx = {}
	j = 0
	for i in range(ind):
		if ls[i] > 1:
			xx.append([ls[i] - 1, i])
			j += 1
		elif ls[i] == 0:
			xxx[i] = xx[j - 1][1]
			xx[j - 1][0] -= 1
			if xx[j - 1][0] == 0:
				xx.pop()
				j -= 1
	ls[ind] = 0
	ans = 0
	for i in range(n + 1):
		if ls[i] == 0:
			print(ans, end=' ')
			if i != ind:
				ans += i - xxx[i]
				j += 1
		elif ls[i] != -1:
			print(ans + ls[i], end=' ')
		else:
			print(ls[i], end=' ')
	print()


from itertools import permutations as per
from math import factorial as fact
from difflib import SequenceMatcher
import bisect
t = int(input())
for _ in range(t):
	n = int(input())
	a = [0] * (n + 1)
	b = [int(i) for i in input().split()]
	for i in b:
		a[i] += 1
	prev = 0
	s = []
	print(a[0], end=' ')
	while a[0] > 1:
		s.append(0)
		a[0] -= 1
	for i in range(1, n + 1):
		if prev != -1:
			if a[i - 1] == 0:
				if len(s):
					prev += i - 1 - s[-1]
					s.pop()
					print(prev + a[i], end=' ')
				else:
					prev = -1
					print(-1, end=' ')
			else:
				print(prev + a[i], end=' ')
				while a[i - 1] != 1:
					s.append(i - 1)
					a[i - 1] -= 1
		else:
			print(-1, end=' ')
	print()


t = int(input())
out = ''
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	count = [0] * (n + 1)
	for x in arr:
		count[x] += 1
	previous = []
	total = 0
	this_ = 0
	for i in range(n + 1):
		out += str(total + count[i]) + ' '
		for x in range(count[i]):
			previous.append(i)
		if len(previous) == 0:
			while i < n:
				out += '-1 '
				i += 1
			break
		total += i - previous.pop(-1)
	out += '\n'
print(out)


import math
t = int(input())
for test_case in range(t):
	n = int(input())
	array = list(map(int, input().split()))
	freq_array = [0 for i in range(n + 1)]
	for i in array:
		freq_array[i] += 1
	flag = True
	steps_for_mex = 0
	idx = -1
	for i in range(n + 1):
		if flag:
			if freq_array[i] > 0:
				if freq_array[i] > 1:
					idx = i
				print(freq_array[i] + steps_for_mex, end=' ')
			else:
				print(steps_for_mex, end=' ')
				while idx >= 0:
					if freq_array[idx] > 1:
						steps_for_mex += i - idx
						freq_array[idx] -= 1
						break
					else:
						idx -= 1
				if idx == -1:
					flag = False
		else:
			print(-1, end=' ')
	print()


from sys import stdin
input = stdin.readline

def answer():
	d = dict()
	for i in range(n):
		d[a[i]] = d.get(a[i], 0) + 1
	(yes, m, extra) = (False, [], 0)
	for i in range(n + 1):
		if yes == False:
			print(d.get(i, 0) + extra, end=' ')
			for j in range(d.get(i, 1) - 1):
				m.append(i)
		else:
			print(-1, end=' ')
		if d.get(i, 0) == 0:
			if len(m) == 0:
				yes = True
			else:
				extra += i - m.pop()
for T in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	answer()
	print()


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	d = {}
	for item in a:
		if item in d:
			d[item] += 1
		else:
			d[item] = 1
	for i in range(n + 1):
		if i not in d:
			d[i] = 0
	extras = []
	tobeadded = 0
	for i in range(n + 1):
		if d[i] == 0:
			print(0 + tobeadded, end=' ')
			if extras == []:
				break
			k = extras.pop()
			tobeadded += i - k
		else:
			print(d[i] + tobeadded, end=' ')
			if d[i] > 1:
				extras += [i] * (d[i] - 1)
	print('-1 ' * (n - i), end='')
	print()
for _ in range(int(input())):
	solve()