description: Dmitry has an array of n non-negative integers a_1, a_2, ..., a_n.
  
  In one operation, Dmitry can choose any index j (1 ≤ j ≤ 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 MEX of the array equal to exactly i. If it is possible, then determine the minimum number of operations to do it.
  
  The MEX of the array is equal to the minimum non-negative integer that is not in the array. For example, the 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 ≤ t ≤ 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 ≤ n ≤ 2 ⋅ 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, ..., a_n (0 ≤ a_i ≤ 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⋅10^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 MEX equal to i (0 ≤ i ≤ n), or -1 if this cannot be done.
  
  Example
  
  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 MEX=0, it is enough to perform one increment: a_1++; 
    * to get MEX=1, it is enough to perform one increment: a_2++; 
    * MEX=2 for a given array, so there is no need to perform increments; 
    * it is impossible to get MEX=3 by performing increments. 
solution: import sys
  # from abc import abstractmethod
  # from collections import deque
  import math
  from typing import AnyStr 
  # import heapq
  import random
  # import copy
  # from decimal import Decimal
  # from collections import defaultdict
  # from typing import AnyStr
  
  INF = int(1e15 + 1)
  mod = 1000000007
  
  read = sys.stdin.readline
  sys.setrecursionlimit(10**5)
  dx = [0 , 1, 0, -1]
  dy = [-1, 0, 1, 0]
  seg = []
  
  def power(bottom, up):
      if up == 1:
          return bottom
      elif up == 0:
          return 1
      tmp = power(bottom, int(up // 2))
      if up % 2 == 0:
          return (tmp * tmp) % mod
      else:
          return (tmp * tmp * bottom) % mod
  
  def ccw(p1, p2, p3):
      a = p2[0] - p1[0]
      b = p2[1] - p1[1]
  
      c = p3[0] - p1[0]
      d = p3[1] - p1[1]
  
      tmp = a * d - b * c
  
      if tmp > 0:
          return 1
      elif tmp == 0:
          return 0
      else:
          return -1
  
  def lower_bound(item):
      left =0 
      right = len(queue)
  
      while left < right:
          mid = int((left + right) // 2)
          if queue[mid] > item:
              right = mid
          elif queue[mid] <= item:
              left = mid + 1
  
      return int((left + right)// 2)
  
  def make_seg(left, right, node):
      if left == right:
          seg[node] = arr[left - 1]
          return seg[node]
      
      mid = int((left + right) // 2)
      seg[node] = make_seg(left , mid , node * 2)
      seg[node] += make_seg(mid + 1 , right , node * 2 + 1)
  
      return seg[node]
  
  def seg_replace(left , right, node,index, diff):
      if index < left or index > right:
          return
  
      seg[node] += diff
      if left == right:
          return
      
      mid = (left + right) // 2
      seg_replace(left , mid , node * 2 , index, diff)
      seg_replace(mid + 1 , right , node *2 + 1, index,  diff)
  
  
  def seg_sum(left, right, start , end, node):
      if start <= left and right <= end:
          return seg[node]
  
      if end < left or start > right:
          return 0
  
      mid = (left+right) // 2
  
      return seg_sum(left , mid , start , end, node * 2) + seg_sum(mid + 1 , right , start , end, node * 2 + 1)
  
  def lazy_seg_replace(left, right, node,  start, end , diff):
      if seg_lazy[node] != 0:
          seg[node] += seg_lazy[node] * (right - left + 1)
  
          if left != right:
              seg_lazy[node * 2] += seg_lazy[node]
              seg_lazy[node * 2 + 1] += seg_lazy[node]
          
          seg_lazy[node] = 0
  
      if start<= left and right <= end:
          seg_lazy[node] += diff
          seg[node] += seg_lazy[node] * (right - left + 1)
  
          if left != right:
              seg_lazy[node * 2] += seg_lazy[node]
              seg_lazy[node * 2 + 1] += seg_lazy[node]
          
          seg_lazy[node] = 0
          return seg[node]
      
      if end < left or start > right:
          return seg[node]
      
  
      mid = (left + right) // 2
  
      seg[node] = lazy_seg_replace(left, mid, node * 2 , start , end, diff)
      seg[node] += lazy_seg_replace(mid + 1 , right , node * 2 + 1 , start , end , diff)
  
      return seg[node]
  
  def lazy_seg_sum(left , right, node , start , end):
      # print(left , right , start, end)
      if seg_lazy[node] != 0:
          seg[node] += seg_lazy[node] * (right - left + 1)
  
          if left != right:
              seg_lazy[node * 2] += seg_lazy[node]
              seg_lazy[node * 2 + 1] += seg_lazy[node]
          
          seg_lazy[node] = 0
      
      if start <= left and right <= end:
          tmp = seg[node]
          seg[node] = 0
          return tmp
      
      if end < left or right < start:
          return 0
      
      mid = (left+ right) // 2
      if mid >= end:
          tmp = lazy_seg_sum(left , mid , node * 2 , start , end)
      else:
          tmp = lazy_seg_sum(mid + 1 , right , node * 2  + 1, start , end)
  
      seg[node] -= tmp
      return tmp
      # return lazy_seg_sum(left , mid , node * 2 , start , end) + lazy_seg_sum(mid + 1 , right , node * 2 + 1 , start,  end) 
          
  def seg_index(left , right,  node , idx):
      seg[node] -= 1
      if left == right:
          return left
      mid = (left + right) // 2
      if seg[node * 2] < idx:
          return seg_index(mid + 1 , right , node * 2 + 1 , idx - seg[node * 2])
      else:
          return seg_index(left , mid , node * 2 , idx )
      
  def dp(cnt , idx , shop_li, answer):
      if idx >= num:
          # print(answer)
          return min(answer)
      return_val = 0
      # print("FIRST" , cnt , idx , shop_li , answer)
      for item in arr[idx]:
          # print("HERE" , item[1])
          tmp = answer[idx]
          if item[0] <= return_val:
              continue
          answer[idx] = item[0]
          if shop_li[item[1]] == 1:
              # return_val = min(return_val , item[0])
              return_val = max(return_val , dp(cnt , idx + 1 , shop_li , answer))
          else:
              # print(item , shop_li[item[1]])
              if cnt >= num - 1:
                  # answer[idx] = INF
                  continue
              else:
                  # print("??", item , shop_li[item[1]])
                  shop_li[item[1]] = 1
                  # return_val = min(return_val , item[0])
                  return_val = max(return_val , dp(cnt + 1 , idx + 1 , shop_li , answer))
                  shop_li[item[1]] = 0
      
      return return_val
  
  loop = int(read())
  
  answer_li = []
  
  for _ in range(loop):
      num = int(read())
      answer = []
  
      arr = list(map(int, read().strip().split()))
      dic = {}
  
      for item in arr:
          if item in dic:
              dic[item] += 1
          else:
              dic[item] = 1
      
      cnt = 0
      before = []
      before_num = 0
      before_tmp = -1
      for idx in range(num + 1):
  
          if idx not in dic:
              tmp = 0
          else:
              tmp = dic[idx]
  
          if cnt < idx:
              while len(answer) != num + 1:
                  answer.append(-1)
              break
          
          if before_tmp == 0:
              if before:
                  tmp1 = before.pop()
                  before_num += (idx-1) - tmp1
              else:
                  while len(answer) != num + 1:
                      answer.append(-1)
                  break
          if tmp >= 2:
              before += [idx] * (tmp - 1)
          
          
          cnt += tmp
          before_tmp = tmp
          answer.append(before_num + tmp)
          # print(before)
      
      answer_li.append(" ".join(map(str , answer)))
  
      
  # print(answer_li)
  print("\n".join(answer_li))
  
  