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 java.io.BufferedReader;
  import java.io.BufferedWriter;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.OutputStreamWriter;
  import java.io.PrintWriter;
  import java.util.*;
  import java.util.concurrent.ThreadLocalRandom;
  
  
  
  public class a729 {
  
  	public static void main(String[] args) throws IOException {
     
  //		try {
  			
  //			System.out.println(printDivisors(1));
  			
  		BufferedWriter out = new BufferedWriter(
  	            new OutputStreamWriter(System.out));
  		BufferedReader br = new BufferedReader(
  		        new InputStreamReader(System.in));
  		PrintWriter pt = new PrintWriter(System.out);
  		FastReader sc = new FastReader();
  
  		int t = sc.nextInt();
  //		int t = Integer.parseInt(br.readLine());
  	
  for(int o = 0 ; o<t;o++){
  int n = sc.nextInt();
  int[] arr = new int[n];
  ArrayList<Integer> al = new ArrayList<Integer>();
  
  HashSet<Integer> set = new HashSet<Integer>();
  TreeMap<Integer,  Integer> tmap = new TreeMap<Integer, Integer>();
  for(int i = 0 ; i<n;i++) {
  	arr[i] = sc.nextInt();
  	if(set.contains(arr[i])) {
  		al.add(arr[i]);
  		if(tmap.containsKey(arr[i])) {
  			tmap.put(arr[i] , tmap.get(arr[i]) +1);
  		}else {
  			tmap.put(arr[i], 1);
  		}
  	}else
  	set.add(arr[i]);
  	
  }
  int mex = Integer.MAX_VALUE;
  for(int i = 0 ; i<=n;i++) {
  	if(!set.contains(i)) {
  		mex = i;
  		break;
  	}
  }
  Arrays.sort(arr);
  HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
  for(int i = 0 ; i<n;i++) {
  	if(map.containsKey(arr[i])) {
  		map.put(arr[i], map.get(arr[i])+1);
  	}else {
  		map.put(arr[i], 1);
  	}
  }
  
  long[] dp = new long[n+1];
  if(map.containsKey(0)) {
  	dp[0] = map.get(0);
  }
  for(int i = 1 ; i<=n;i++) {
  	if(map.containsKey(i)) {
  		dp[i] = map.get(i) + dp[i-1];
  	}else {
  		dp[i] = dp[i-1];
  	}
  	}
  
  //shuffleArray(arr);
  //Arrays.sort(arr);
  
  Collections.sort(al,Collections.reverseOrder());
  long[] ans = new long[n+1];
  //System.out.println(map.get(0));
  for(int i = 0 ; i<=n;i++) {
  	if(i>0) {
  		if(ans[i-1] == -1) {
  			ans[i] = -1;
  			continue;
  		}
  		
  	}
  	if(i<mex) {
  		ans[i] = map.get(i);
  	}else if(i == mex) {
  		ans[i] = 0;
  		}else {
  		if(set.contains(i-1)) {
  			int v = 0;
  			if(map.containsKey(i)){
  				v = map.get(i);
  			}
  			ans[i] = ans[i-1] - (long)map.get(i-1) + (long)v;
  			
  		}else {
  			if(tmap.floorKey(i-1) == null) {
  				ans[i] = -1;
  			}else {
  				int v = 0;
  				if(map.containsKey(i)){
  					v = map.get(i);
  				}
  				ans[i] = ans[i-1] + (long)v + (long)(i-1-tmap.floorKey(i-1));
  				
  //				System.out.println(i + " " + (i-1-tmap.floorKey(i-1)));
  				tmap.put(tmap.floorKey(i-1), tmap.get(tmap.floorKey(i-1)) -1);
  			if(tmap.get(tmap.floorKey(i-1)) ==0) {
  				tmap.remove(tmap.floorKey(i-1));
  				
  			}
  			}
  			
  		}
  	
  		}
  		
  
  }
  
  for(int i = 0 ; i<=n;i++) {
  	System.out.print(ans[i] + " ");
  }
  System.out.println();
  
  }
  //     }catch(Exception e) {
  //    	 return;
  //     }
       }
       
       
  //------------------------------------------------------------------------------------------------------------------------------------------------
  	
  	static int printDivisors(int n)
      {
          int cnt = 0;
  		for (int i=1; i<=Math.sqrt(n); i++)
          {
              if (n%i==0)
              {
                  if (n/i == i)
                  	cnt++;
                  	
                  else 
                  	cnt+=2;
              }
          }
      
      return cnt;
      }
  	
  	
  	public static StringBuilder comp(long n) {
  		StringBuilder x = new StringBuilder("");
  		for(int i = 0 ; i<n;i++) {
  			x.append('b');
  		}
  		return x;
  	}
  	
  	
  	public static long findgcd(long[] arr,int v) {
  		int n = arr.length;
  		long g = arr[v];
  		for(int i = v ; i<n;i+=2) {
  			g = gcd(g, arr[i]);
  		}
  		return g;
  	}
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	public static int count(long x) {
  		int a = 0;
  		while(x>0) {
  			x/=2;
  			a++;
  		}
  		return a;
  		
  	}
  	
  
  	public static long ncr(long[] fac, int n , int r , long m) {
  		return fac[n]*(modInverse(fac[r], m))%m *(modInverse(fac[n-r], m))%m; 
  	}
  	
  	
  	public static void build(int [][] seg,char []arr,int idx, int lo , int hi) {
  	if(lo == hi) {
  //		seg[idx] = arr[lo];
  		seg[idx][(int)arr[lo]-'a'] = 1;
  		
  		return;
  	}
  	int mid = (lo + hi)/2;
  build(seg,arr,2*idx+1, lo, mid);
  build(seg,arr,idx*2+2, mid +1, hi);
  //seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
  for(int i = 0 ; i<27;i++) {
  	seg[idx][i] = seg[2*idx+1][i] + seg[2*idx + 2][i];
  }
  	}
  //for f/inding minimum in range 
  public static void query(int[][]seg,int[]ans,int idx , int lo , int hi , int l , int r) {
  	if(lo>=l && hi<=r) {
  		for(int i = 0 ; i<27;i++) {
  			ans[i]+= seg[idx][i];
  		}
  		return ;
  	}
  if(hi<l || lo>r) {
  	return;
  }
  int mid = (lo + hi)/2;
  query(seg,ans,idx*2 +1, lo, mid, l, r);
  query(seg,ans,idx*2 + 2, mid + 1, hi, l, r);
  //return Math.min(left, right);
  }
  //// for sum
  //
  public static void update(int[][]seg,char[]arr,int idx, int lo , int hi , int node , char val) {
  if(lo == hi) {
  //	seg[idx] += val;
  seg[idx][val-'a']++;
  seg[idx][arr[node]-'a']--;
  
  }else {
  int mid = (lo + hi )/2;
  if(node<=mid && node>=lo) {
  update(seg,arr, idx * 2 +1, lo, mid, node, val);
  }else {
  update(seg,arr, idx*2 + 2, mid + 1, hi, node, val);
  }
  //seg[idx] = seg[idx*2 + 1] + seg[idx*2 + 2];
  for(int i = 0 ; i<27;i++) {
  	seg[idx][i] = seg[2*idx+1][i] + seg[2*idx + 2][i];
  }
  }
  
  }
  	
  	
  	
  	
  	
  	
  	public static int lower_bound(int array[], int low, int high, int key){
  	// Base Case
  	if (low > high) {
  	return low;
  	}
  
  	// Find the middle index
  	int mid = low + (high - low) / 2;
  
  	// If key is lesser than or equal to
  	// array[mid] , then search
  	// in left subarray
  	if (key <= array[mid]) {
  
  	return lower_bound(array, low,
  	            mid - 1, key);
  	}
  
  	// If key is greater than array[mid],
  	// then find in right subarray
  	return lower_bound(array, mid + 1, high,
  	        key);
  	}
  	
  	public static int upper_bound(int arr[], int low,
              int high, int key){
  // Base Case
  if (low > high || low == arr.length)
  return low;
  
  // Find the value of middle index
  int mid = low + (high - low) / 2;
  
  // If key is greater than or equal
  // to array[mid], then find in
  // right subarray
  if (key >= arr[mid]) {
  return upper_bound(arr, mid + 1, high,
                  key);
  }
  
  // If key is less than array[mid],
  // then find in left subarray
  return upper_bound(arr, low, mid - 1,
              key);
  }
  
  //	-----------------------------------------------------------------------------------------------------------------------------------------------
  	public static long gcd(long a, long b){
          if (a == 0)
              return b;
          return gcd(b % a, a);
      }
  //--------------------------------------------------------------------------------------------------------------------------------------------------------
  	public static long modInverse(long a, long m){
          long m0 = m;
          long y = 0, x = 1;
   
          if (m == 1)
              return 0;
   
          while (a > 1) {
              // q is quotient
              long q = a / m;
   
              long t = m;
   
              // m is remainder now, process
              // same as Euclid's algo
              m = a % m;
              a = t;
              t = y;
   
              // Update x and y
              y = x - q * y;
              x = t;
          }
   
          // Make x positive
          if (x < 0)
              x += m0;
   
          return x;
      }
  
  		
  
  //-----------------------------------------------------------------------------------------------------------------------------------
  
  	//segment tree
  	//for finding minimum in range 
  //	public static void build(int [] seg,int []arr,int idx, int lo , int hi) {
  //		if(lo == hi) {
  //			seg[idx] = arr[lo];
  //			return;
  //		}
  //		int mid = (lo + hi)/2;
  //	build(seg,arr,2*idx+1, lo, mid);
  //	build(seg,arr,idx*2+2, mid +1, hi);
  //	seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
  //	}
  ////for finding minimum in range 
  //public static int query(int[]seg,int idx , int lo , int hi , int l , int r) {
  //		if(lo>=l && hi<=r) {
  //			return seg[idx];
  //		}
  //	if(hi<l || lo>r) {
  //		return Integer.MAX_VALUE;
  //	}
  //	int mid = (lo + hi)/2;
  //	int left = query(seg,idx*2 +1, lo, mid, l, r);
  //	int right = query(seg,idx*2 + 2, mid + 1, hi, l, r);
  //	return Math.min(left, right);
  //}
  //	// for sum
  //
  //public static void update(int[]seg,int idx, int lo , int hi , int node , int val) {
  //	if(lo == hi) {
  //		seg[idx] += val;
  //	}else {
  //int mid = (lo + hi )/2;
  //if(node<=mid && node>=lo) {
  //	update(seg, idx * 2 +1, lo, mid, node, val);
  //}else {
  //	update(seg, idx*2 + 2, mid + 1, hi, node, val);
  //}
  //seg[idx] = seg[idx*2 + 1] + seg[idx*2 + 2];
  //
  //}
  
  //}
  //---------------------------------------------------------------------------------------------------------------------------------------
  
  
  	static void shuffleArray(int[] ar)
  	  {
  	    // If running on Java 6 or older, use `new Random()` on RHS here
  	    Random rnd = ThreadLocalRandom.current();
  	    for (int i = ar.length - 1; i > 0; i--)
  	    {
  	      int index = rnd.nextInt(i + 1);
  	      // Simple swap
  	      int a = ar[index];
  	      ar[index] = ar[i];
  	      ar[i] = a;
  	    }
  	  }
  //-----------------------------------------------------------------------------------------------------------------------------------------------------------
  
  }
  
  
  class FastReader {
      BufferedReader br;
      StringTokenizer st;
  
      public FastReader()
      {
          br = new BufferedReader(
              new InputStreamReader(System.in));
      }
  
      String next()
      {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
  
              
              
              
              
              }
              catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
  
      int nextInt() { return Integer.parseInt(next()); }
  
      long nextLong() { return Long.parseLong(next()); }
  
      double nextDouble()
      {
          return Double.parseDouble(next());
      }
  
      String nextLine()
      {
          String str = "";
          try {
              str = br.readLine();
          }
          catch (IOException e) {
              e.printStackTrace();
          }
          return str;
      }
  }
  //------------------------------------------------------------------------------------------------------------------------------------------------------------
  class SegmentTree{
  	
  int n;
  	public SegmentTree(int[] arr,int n) {
  		this.arr = arr;
  		this.n = n;
  	}
  	int[] arr = new int[n];
  //	int n = arr.length;
  	int[] seg = new int[4*n];
  	void build(int idx, int lo , int hi) {
  		if(lo == hi) {
  			seg[idx] = arr[lo];
  			return;
  		}
  		int mid = (lo + hi)/2;
  	build(2*idx+1, lo, mid);
  	build(idx*2+2, mid +1, hi);
  	seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
  	}
  	int query(int idx , int lo , int hi , int l , int r) {
  		if(lo<=l && hi>=r) {
  			return seg[idx];
  		}
  	if(hi<l || lo>r) {
  		return Integer.MAX_VALUE;
  	}
  	int mid = (lo + hi)/2;
  	int left = query(idx*2 +1, lo, mid, l, r);
  	int right = query(idx*2 + 2, mid + 1, hi, l, r);
  	return Math.min(left, right);
  	}
  	
  	
  }
  //-----------------------------------------------------------------------------------------------------------------------------------------------------------
  class coup{
  	char a; 
  	int b;
  	public coup(char a , int b) {
  		this.a = a;
  		this.b = b;
  	}
  }
  
  class trip{
  	int a , b, c;
  	public trip(int a , int b, int c) {
  		this.a = a;
  		this.b = b;
  		this.c = c;
  	}
  }
  //---------------------------------------------------------------------------------------------------------------------------------------------------------------
  