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.util.*;
  import java.io.*;
  
  ////***************************************************************************
   /* public class E_Gardener_and_Tree implements Runnable{
  
         public static void main(String[] args) throws Exception {
          new Thread(null, new E_Gardener_and_Tree(), "E_Gardener_and_Tree", 1<<28).start();
         }
      public void run(){
           WRITE YOUR CODE HERE!!!!
           JUST WRITE EVERYTHING HERE WHICH YOU WRITE IN MAIN!!!
         }
  
    }
  */
  /////**************************************************************************
  
  
  public class E_MEX_and_Increments{
      public static void main(String[] args) {
          FastScanner s= new FastScanner();
          //PrintWriter out=new PrintWriter(System.out);
          //end of program
          //out.println(answer);
          //out.close();
          StringBuilder res = new StringBuilder();
          int t=s.nextInt();
          int p=0;
          while(p<t){
          int n=s.nextInt();
          long array[]= new long[n];
          HashMap<Long,Long> map = new  HashMap<Long,Long>();
          ArrayList<Long> nice = new ArrayList<Long>();
          for(int i=0;i<n;i++){
              array[i]=s.nextLong();
              if(!map.containsKey(array[i])){
                  map.put(array[i],(long)1);
                  nice.add(array[i]);
  
              }
              else{
                  long a=map.get(array[i]);
                  a++;
                  map.remove(array[i]);
                  map.put(array[i],a);
  
              }
          }
          Collections.sort(nice);
          long ans[]= new long[n+1];
          for(int i=0;i<=n;i++){
              ans[i]=-1;
          }
          int yo=0;
          Stack<Long> well = new Stack<Long>();
          int check=0;
          long yoyo=0;
          for(int i=0;i<nice.size();i++){
              long num=nice.get(i);
              while(yo<=num){
                  if(yo<num){
                      long a1=0;
                      if(map.containsKey((long)yo)){
                           a1=map.get((long)yo);
                      }
                     if(a1>0){
                        long hh=a1;
                        hh+=yoyo;
                        ans[yo]=hh;
                     }
                     else{
                          long hh=a1;
                          hh+=yoyo;
                          ans[yo]=hh;
                          if(well.size()>0){
                              long jj=well.pop();
                              long m=yo-jj;
                              yoyo+=m;
                          }
                          else{
                              check=1;
                              break;
                          }
  
                     }
  
                  }
                  else{
  
                      ///
  
                      long a1=0;
                      if(map.containsKey((long)yo)){
                           a1=map.get((long)yo);
                      }
                      if(a1>0){
                         long hh=a1;
                         hh+=yoyo;
                         ans[yo]=hh;
                      }
                      else{
                           long hh=a1;
                           hh+=yoyo;
                           ans[yo]=hh;
                           if(well.size()>0){
                               long jj=well.pop();
                               long m=yo-jj;
                               yoyo+=m;
                           }
                           else{
                               check=1;
                               break;
                           }
   
                      }
  
  
  
                      ///
                      int l=0;
                      while(l<(a1-1)){
                          well.add(num);
                          l++;
                      }
  
  
                  }
                  yo++;
              }
              
              if(check==1){
                  break;
              }
  
          }
          if(check==0){
              while(yo<=n){
                  ///
                  long a1=0;
                  if(map.containsKey((long)yo)){
                       a1=map.get((long)yo);
                  }
                  if(a1>0){
                     long hh=a1;
                     hh+=yoyo;
                     ans[yo]=hh;
                  }
                  else{
                       long hh=a1;
                       hh+=yoyo;
                       ans[yo]=hh;
                       if(well.size()>0){
                           long jj=well.pop();
                           long m=yo-jj;
                           yoyo+=m;
                       }
                       else{
                           check=1;
                           break;
                       }
  
                  }
  
  
  
                  ///
                  yo++;
  
              }
          }
          for(int i=0;i<=n;i++){
              res.append(ans[i]+" ");
          }
          res.append(" \n");
          p++;
      }
      System.out.println(res);
      }
      static class FastScanner {
  		BufferedReader br;
  		StringTokenizer st;
   
  		public FastScanner(String s) {
  			try {
  				br = new BufferedReader(new FileReader(s));
  			} catch (FileNotFoundException e) {
  				// TODO Auto-generated catch block
  				e.printStackTrace();
  			}
  		}
   
  		public FastScanner() {
  			br = new BufferedReader(new InputStreamReader(System.in));
  		}
   
  		String nextToken() {
  			while (st == null || !st.hasMoreElements()) {
  				try {
  					st = new StringTokenizer(br.readLine());
  				} catch (IOException e) {
  					// TODO Auto-generated catch block
  					e.printStackTrace();
  				}
  			}
  			return st.nextToken();
  		}
   
  		int nextInt() {
  			return Integer.parseInt(nextToken());
  		}
   
  		long nextLong() {
  			return Long.parseLong(nextToken());
  		}
   
  		double nextDouble() {
  			return Double.parseDouble(nextToken());
  		}
  	}
  
  
      static long modpower(long x, long y, long p)
       {
        long res = 1; // Initialize result
     
        x = x % p; // Update x if it is more than or
        // equal to p
     
        if (x == 0)
          return 0; // In case x is divisible by p;
     
        while (y > 0)
        {
     
          // If y is odd, multiply x with result
          if ((y & 1) != 0)
            res = (res * x) % p;
     
          // y must be even now
          y = y >> 1; // y = y/2
          x = (x * x) % p;
        }
        return res;
      }
  
    
     // SIMPLE POWER FUNCTION=>
  
  
        static long power(long x, long y)
          {
              long res = 1;     // Initialize result
          
              while (y > 0)
              {
              
                  // If y is odd, multiply x with result
                  if ((y & 1) != 0)
                      res = res * x;
          
                  // y must be even now
                  y = y >> 1; // y = y/2
                  x = x * x;  // Change x to x^2
              }
              return res;
          }
  
  
  
  
  
  }