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.*;
  
  import java.util.*;
  /*
  
  
  
  
  */
  
   
   public class E{
  	static FastReader sc=null;
  	
  	public static void main(String[] args) {
  		sc=new FastReader();
  		int t=sc.nextInt();
  		PrintWriter out=new PrintWriter(System.out);
  		
  		for(int tt=0;tt<t;tt++) {
  			int n=sc.nextInt();
  			int a[]=sc.readArray(n);
  			
  			int counts[]=new int[n+1],cs[]=new int[n+1];
  			multiset m=new multiset();
  			m.add(-1);
  			for(int e:a) {
  				counts[e]++;
  				m.add(e);
  			}
  			
  			cs[0]=counts[0];
  			for(int i=1;i<=n;i++)cs[i]=cs[i-1]+1;
  			
  			long dp[]=new long[n+1],ans[]=new long[n+1];
  			Arrays.fill(ans, -1);
  			dp[0]=0;
  			ans[0]=counts[0];
  			
  			for(int i=1;i<=n;i++) {
  				dp[i]=dp[i-1];
  				int closest=m.floor(i-1);
  				if(closest==-1)break;
  				else {
  					dp[i]+=i-1-closest;
  					m.remove(closest);
  				}
  				ans[i]=dp[i]+counts[i];
  			}
  			
  			for(long e:ans)out.print(e+" ");
  			out.println();
  		}
  		out.close();
  	}
  	static class multiset{
  		int size=0;
  		Map<Integer,Integer> map=new HashMap<>();
  		TreeSet<Integer> set=new TreeSet<>();
  		
  		//add the correct neutral elements when trying to use the floor or ceiling functions
  		void add(int e){
  			int c=map.getOrDefault(e, 0);
  			map.put(e, ++c);
  			size++;
  			set.add(e);
  		}
  		
  		void remove(int e) {
  			int c=map.getOrDefault(e, 0);
  			if(c==0)throw null;
  			
  			size--;
  			if(c==1) {
  				map.remove(e);
  				set.remove(e);
  				return;
  			}
  			map.put(e, --c);
  		}
  		
  		int max() {
  			return set.last();
  		}
  		
  		int min() {
  			return set.first();
  		}
  		
  		int floor(int e) {
  			return set.floor(e);
  		}
  		
  		int ceiling(int e) {
  			return set.ceiling(e);
  		}
  		
  		boolean isEmpty() {
  			return size==0;
  		}
  	}
  	
  	static int[] ruffleSort(int a[]) {
  		ArrayList<Integer> al=new ArrayList<>();
  		for(int i:a)al.add(i);
  		Collections.sort(al);
  		for(int i=0;i<a.length;i++)a[i]=al.get(i);
  		return a;
  	}
  	
  	static void print(int a[]) {
  		for(int e:a) {
  			System.out.print(e+" ");
  		}
  		System.out.println();
  	}
  	
  	static class FastReader{
  		
  		StringTokenizer st=new StringTokenizer("");
  		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  		
  		String next() {
  			while(!st.hasMoreTokens()) 
  				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());
  		}
  		
  		int[] readArray(int n) {
  			int a[]=new int[n];
  			for(int i=0;i<n;i++)a[i]=sc.nextInt();
  			return a;
  		}
  	}
  	
  	
  }
  