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.math.BigInteger;
  import java.util.*;
  import java.util.concurrent.ThreadLocalRandom;
  
  public class Main extends Utils{
      public static void main(String[] args) {
          int t = readInt();
          while (t-- > 0) {
              int n = readInt();
              int[] a = readArrayInt(n);
              int[] min = new int[n + 1];
              Arrays.sort(a);
  
              long[] sum = new long[n + 1];
              int[] count = new int[n + 1];
              int k = 1;
              long sk = a[0];
              int j = a[0] + 1;
              count[a[0]] = 1;
              sum[0] = a[0];
              for (int i = 1; i < n; i++) {
                  count[a[i]]++;
                  sum[i] = sum[i - 1] + a[i];
                  if (a[i] == a[i - 1]) {
                      k++;
                      sk += a[i];
                      while (j <= a[i]) {
                          min[j] = min[j - 1];
                          //sum[j] = sum[j - 1];
                          j++;
                      }
                  }
                  else {
                      min[j] = min[j - 1] + k;
                      //sum[j] = sum[j - 1] + sk;
                      j++;
                      while (j <= a[i]) {
                          min[j] = min[j - 1];
                          j++;
                      }
                      k = 1;
                      sk = a[i];
                  }
              }
  
              if (j <= n) {
                  min[j] = min[j - 1] + k;
                  //sum[j] = sum[j - 1] + sk;
                  j++;
                  while (j <= n) {
                      min[j] = min[j - 1];
                      //sum[j] = sum[j - 1];
                      j++;
                  }
              }
  
              boolean ch = true;
              long s = 0;
              Stack<Integer> st = new Stack<>();
              j = 0;
              for (int i = 0; i <= n; i++) {
                  if (!ch) {
                      print(-1 + " ");
                      continue;
                  }
  
                  if (min[i] < i) {
                      ch = false;
                      print(-1 + " ");
                  } else {
                      print((s + count[i]) + " ");
                      if (count[i] > 0) {
                          j++;
                          while (j < n && a[j] == i)
                              st.push(a[j++]);
                      } else if (i < n) {
                          if (st.isEmpty()) {
                              ch = false;
                              continue;
                          }
                          s += i - st.pop();
                      }
  
                  }
              }
              println();
  
          }
  
          flush();
      }
  }
  
  abstract class Utils {
      static PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
      static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
      static StringTokenizer st = new StringTokenizer("");
  
      static void print(Object s) {
          writer.print(s);
      }
  
      static void println(Object s) {
          writer.println(s);
      }
  
      static void println() {
          writer.println();
      }
  
      static void flush() {
          writer.close();
      }
  
      static String next() {
          while (!st.hasMoreTokens()) {
              try {
                  st = new StringTokenizer(reader.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
  
      static int readInt() {
          return Integer.parseInt(next());
      }
  
      static long readLong() {
          return Long.parseLong(next());
      }
  
      static char[] readStr() {
          return next().toCharArray();
      }
  
      static String readString() {
          return next();
      }
  
      static char readChar() {
          return next().charAt(0);
      }
  
      static int[] readArrayInt(int n) {
          int[] a = new int[n];
          for(int i = 0; i < n; i++)
              a[i] = readInt();
          return a;
      }
  
      static long[] readArrayLong(int n) {
          long[] a = new long[n];
          for(int i = 0; i < n; i++)
              a[i] = readLong();
          return a;
      }
  
      static BigInteger pow(BigInteger a, BigInteger b) {
          if (b.compareTo(BigInteger.valueOf(0)) == 0) return BigInteger.valueOf(1);
          BigInteger rs = pow(a, (b.divide(BigInteger.valueOf(2))));
          return rs.multiply(rs).multiply(b.mod(BigInteger.valueOf(2)).compareTo(BigInteger.ZERO) == 0 ? BigInteger.ONE : a);
      }
  
      static long pow(long a, long b) {
          if (b == 0) return 1;
  
          long rs = pow(a, b / 2);
          return rs * rs * (b % 2 == 0 ? 1 : a);
      }
  
      static long GCD(long a, long b) {
          if (a == 0) return b;
          return GCD(b % a, a);
      }
  
      static long LCM(long a, long b) {
          return (a / GCD(a,b)) * b;
      }
  
      static void shuffle(int[][] a, int from, int to) {
          Random rand = ThreadLocalRandom.current();
          for (int i = to - 1; i >= from; i--) {
              int idx = rand.nextInt(i + 1);
              int[] t = a[idx];
              a[idx] = a[i];
              a[i] = t;
          }
      }
  
      static void swap(int a, int b) {
          int t = a; a = b; b = t;
      }
  }
  
  
  