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.*;
  
  import static java.lang.Math.abs;
  
  
  public class Main {
      long M = 1000000007;
      boolean multiCase = true;
  
      private void preparation() {
  
      }
  
      private void solve() throws Exception {
          rf();
          int n = ri();
          rf(); long [] d = readArr2(n);
          sort(d);
          long [] ans = new long[n + 1];
          if(d[0] != 0){
              fill(ans, -1);
              ans[0] = 0;
              addAns(ans);
              return ;
          }
          int idx = 0;
          int pre = -1;
          PriorityQueue<Integer> pq = new PriorityQueue<>((a, b)->{return b - a;});
          HashSet<Integer> set = new HashSet<>();
          long cnt = 0;
          for(int k = 0; k <= n; k++){
              while(idx != n && d[idx] == k){
                  idx++;
              }
  //            if(pre < k - 1){
  //                ans[k] = -1;
  //                continue;
  //            }
  //            print("k = %d, pre= %d, idx = %d%n",k, pre, idx);
              if(set.size() == k){
                  ans[k] = cnt + idx - pre - 1;
              }
  
              if(idx > pre + 1){
                  //k 出现了
                  set.add(k);
              }else{
  //                print("k is not exist, k = %d, pq.size() == %d%n", k, pq.size());
                  // k 没出现， 需要用前面的补
                  if(!pq.isEmpty()){
                      cnt += k - pq.poll();
                      set.add(k);
                  }else{
                      //没法补齐， 后面都G了
                      for(int i = k + 1; i <= n; i++){
                          ans[i] = -1;
                      }
                      addAns(ans);
                      return ;
                  }
  
              }
              for(int i = pre + 2; i < idx; i++){
                  pq.add((int) d[i]);
              }
              pre = idx - 1;
          }
  
          addAns(ans);
      }
  
      private void addAns(long[] ans) {
          for(int i = 0; i < ans.length; i++){
              sb.append(ans[i]).append(" ");
          }
          sb.append("\n");
      }
  
      private void clear() {
  
      }
  
      private void run() throws Exception {
  
          int T = 1;
          if (multiCase) {
              rf();
              T = ri();
          }
  
          preparation();
          while (T-- > 0) {
              solve();
              if (T != 0) {
                  clear();
              }
          }
          printAns();
      }
  
      public static void main(String[] args) throws Exception {
          new Main().run();
      }
  
      StringBuilder sb = new StringBuilder();
      BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer strT;
  
      private void addAns(int a) {
          sb.append(a).append("\n");
      }
  
      private void addAns(long a) {
          sb.append(a).append("\n");
      }
  
      private void addAns(String s) {
          sb.append(s).append("\n");
      }
  
      private void rf() throws IOException {
          strT = new StringTokenizer(infile.readLine());
      }
  
      private int ri() {
          return Integer.parseInt(strT.nextToken());
      }
  
      private long rl() {
          return Long.parseLong(strT.nextToken());
      }
  
      private char[] rs2c() {
          return strT.nextToken().toCharArray();
      }
  
      private String rs() {
          return strT.nextToken();
      }
  
  
      private int[] readArr(int N) {
          int[] arr = new int[N];
          for (int i = 0; i < N; i++) {
              arr[i] = Integer.parseInt(strT.nextToken());
          }
          return arr;
      }
  
      private long[] readArr2(int N) {
          long[] arr = new long[N];
          for (int i = 0; i < N; i++) {
              arr[i] = Long.parseLong(strT.nextToken());
          }
          return arr;
      }
  
      public boolean PRINT_FUNCTION;
  
      private void print(String format, Object... args) {
          System.out.printf((format), args);
      }
  
      // for interactive problem. flush output after print. need with tail %n if print Line Separator
      private void iprint(String format, Object... args) {
          System.out.printf((format), args);
          System.out.flush();
      }
  
      private void print(int[] arr, int x) {
          //for debugging only
          for (int i = 0; i < min(arr.length, x); i++) {
              System.out.print(arr[i] + " ");
          }
          System.out.println();
      }
  
      private void print(long[] arr, int x) {
          //for debugging only
          for (int i = 0; i < min(arr.length, x); i++) {
              System.out.print(arr[i] + " ");
          }
          System.out.println();
      }
  
      private void printAns() {
          System.out.print(sb);
      }
  
      public boolean ADD_WITH_MOD_FUNCTION;
  
      public int add(int a, int b) {
          return (int) add((long) a, (long) b);
      }
  
      public int add(int a, int b, int c) {
          return (int) add((long) a, (long) b, (long) c);
      }
  
      public int add(int a, int b, int c, int d) {
          return (int) add((long) a, (long) b, (long) c, (long) d);
      }
  
      public long add(long a, long b) {
          return (a % M + b % M) % M;
      }
  
      public long add(long a, long b, long c) {
          return (a % M + add(b, c)) % M;
      }
  
      public long add(long a, long b, long c, long d) {
          return (a % M + add(b, c, d)) % M;
      }
  
      private long mod(long x) {
          return (x % M + M) % M;
      }
  
      private int mod(int x) {
          return (int) (((x % M) + M) % M);
      }
  
      public boolean ELEMENT_COUNT_TO_MAP_FUNCTION;
  
      private HashMap<Integer, Integer> hash(int[] A) {
          HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
          for (int i : A) {
              if (map.containsKey(i)) {
                  map.put(i, map.get(i) + 1);
              } else {
                  map.put(i, 1);
              }
          }
          return map;
      }
  
      private HashMap<Long, Integer> hash(long[] A) {
          HashMap<Long, Integer> map = new HashMap<Long, Integer>();
          for (long i : A) {
              if (map.containsKey(i)) {
                  map.put(i, map.get(i) + 1);
              } else {
                  map.put(i, 1);
              }
          }
          return map;
      }
  
      private TreeMap<Integer, Integer> tree(int[] A) {
          TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>();
          for (int i : A) {
              if (map.containsKey(i)) {
                  map.put(i, map.get(i) + 1);
              } else {
                  map.put(i, 1);
              }
          }
          return map;
      }
  
      private TreeMap<Long, Integer> tree(long[] A) {
          TreeMap<Long, Integer> map = new TreeMap<Long, Integer>();
          for (long i : A) {
              if (map.containsKey(i)) {
                  map.put(i, map.get(i) + 1);
              } else {
                  map.put(i, 1);
              }
          }
          return map;
      }
  
      public boolean SORT_FUNCTION;
  
      private void sort(int[] A) {
          int n = A.length;
          Random rnd = new Random();
          for (int i = 0; i < n; ++i) {
              int tmp = A[i];
              int randomPos = i + rnd.nextInt(n - i);
              A[i] = A[randomPos];
              A[randomPos] = tmp;
          }
          Arrays.sort(A);
      }
  
      private void sort(long[] A) {
          int n = A.length;
          Random rnd = new Random();
          for (int i = 0; i < n; ++i) {
              long tmp = A[i];
              int randomPos = i + rnd.nextInt(n - i);
              A[i] = A[randomPos];
              A[randomPos] = tmp;
          }
          Arrays.sort(A);
      }
  
      private String sort(String s) {
          Character[] ch = new Character[s.length()];
          for (int i = 0; i < s.length(); i++) {
              ch[i] = s.charAt(i);
          }
          Arrays.sort(ch);
          StringBuilder st = new StringBuilder();
          for (int i = 0; i < s.length(); i++) {
              st.append(ch[i]);
          }
          return st.toString();
      }
  
      public boolean REVERSE_FUNCTION;
  
      private String reverse(String s) {
          StringBuilder p = new StringBuilder(s);
          p.reverse();
          return p.toString();
      }
  
      private long sum(int[] A) {
          long sum = 0;
          for (int i : A) {
              sum += i;
          }
          return sum;
      }
  
      private long sum(long[] A) {
          long sum = 0;
          for (long i : A) {
              sum += i;
          }
          return sum;
      }
  
      private void reverse(long[] A) {
          int n = A.length;
          long[] B = new long[n];
          for (int i = 0; i < n; i++) {
              B[i] = A[n - i - 1];
          }
          System.arraycopy(B, 0, A, 0, n);
  
      }
  
      private void reverse(int[] A) {
          int n = A.length;
          int[] B = new int[n];
          for (int i = 0; i < n; i++) {
              B[i] = A[n - i - 1];
          }
          System.arraycopy(B, 0, A, 0, n);
  
      }
  
  
      private int nextPowerOf2(int n) {
          n--;
          n |= n >> 1;
          n |= n >> 2;
          n |= n >> 4;
          n |= n >> 8;
          n |= n >> 16;
          n++;
  
          return n;
      }
  
      private int highestPowerOf2(int x) {
  
          x |= x >> 1;
          x |= x >> 2;
          x |= x >> 4;
          x |= x >> 8;
          x |= x >> 16;
  
          return x ^ (x >> 1);
  
      }
  
      private long highestPowerOf2(long x) {
  
          x |= x >> 1;
          x |= x >> 2;
          x |= x >> 4;
          x |= x >> 8;
          x |= x >> 16;
          return x ^ (x >> 1);
  
      }
  
      public boolean ARRAY_MAX_MIN_FUNCTION;
  
      private int max(int[] A) {
          int max = Integer.MIN_VALUE;
          for (int j : A) {
              max = Math.max(max, j);
          }
          return max;
      }
  
      private int min(int[] A) {
          int min = Integer.MAX_VALUE;
          for (int j : A) {
              min = Math.min(min, j);
          }
          return min;
      }
  
      private long max(long[] A) {
          long max = Long.MIN_VALUE;
          for (long l : A) {
              max = Math.max(max, l);
          }
          return max;
      }
  
      private long min(long[] A) {
          long min = Long.MAX_VALUE;
          for (long l : A) {
              min = Math.min(min, l);
          }
          return min;
      }
  
      public boolean PREFIX_SUFFIX_FUNCTION;
  
      private long[] prefix(long[] A) {
          long[] p = new long[A.length];
          p[0] = A[0];
          for (int i = 1; i < A.length; i++)
              p[i] = p[i - 1] + A[i];
          return p;
      }
  
      private long[] prefix(int[] A) {
          long[] p = new long[A.length];
          p[0] = A[0];
          for (int i = 1; i < A.length; i++)
              p[i] = p[i - 1] + A[i];
          return p;
      }
  
      private long[] suffix(long[] A) {
          long[] p = new long[A.length];
          p[A.length - 1] = A[A.length - 1];
          for (int i = A.length - 2; i >= 0; i--)
              p[i] = p[i + 1] + A[i];
          return p;
      }
  
      private long[] suffix(int[] A) {
          long[] p = new long[A.length];
          p[A.length - 1] = A[A.length - 1];
          for (int i = A.length - 2; i >= 0; i--)
              p[i] = p[i + 1] + A[i];
          return p;
      }
  
      public boolean FILL_ARRAY_FUNCTION;
  
      private void fill(int[] dp, int v) {
          Arrays.fill(dp, v);
      }
  
      private void fill(int[][] dp, int v) {
          for (int[] ints : dp) {
              Arrays.fill(ints, v);
          }
      }
  
      private void fill(int[][][] dp, int v) {
          for (int i = 0; i < dp.length; i++) {
              for (int j = 0; j < dp[0].length; j++) {
                  Arrays.fill(dp[i][j], v);
              }
          }
      }
  
      private void fill(int[][][][] dp, int v) {
          for (int i = 0; i < dp.length; i++) {
              for (int j = 0; j < dp[0].length; j++) {
                  for (int k = 0; k < dp[0][0].length; k++) {
                      Arrays.fill(dp[i][j][k], v);
                  }
              }
          }
      }
  
      private void fill(long[] dp, long v) {
          Arrays.fill(dp, v);
      }
  
      private void fill(long[][] dp, long v) {
          for (long[] longs : dp) Arrays.fill(longs, v);
      }
  
      private void fill(long[][][] dp, long v) {
          for (long[][] ones : dp) {
              for (long[] two : ones) {
                  Arrays.fill(two, v);
              }
          }
      }
  
      private void fill(long[][][][] dp, long v) {
          for (int i = 0; i < dp.length; i++) {
              for (int j = 0; j < dp[0].length; j++) {
                  for (int k = 0; k < dp[0][0].length; k++) {
                      Arrays.fill(dp[i][j][k], v);
                  }
              }
          }
      }
  
      public boolean MAX_AND_MIN_FUNCTION;
      // max and min for 2 ~ 4 arguments, argument Type int long float double
  
      private int min(int a, int b) {
          return Math.min(a, b);
      }
  
      private long min(long a, long b) {
          return Math.min(a, b);
      }
  
      private float min(float a, float b) {
          return Math.min(a, b);
      }
  
      private double min(double a, double b) {
          return Math.min(a, b);
      }
  
  
      private int min(int a, int b, int c) {
          return Math.min(a, Math.min(b, c));
      }
  
      private float min(float a, float b, float c) {
          return Math.min(a, Math.min(b, c));
      }
  
      private double min(double a, double b, double c) {
          return Math.min(a, Math.min(b, c));
      }
  
      private long min(long a, long b, long c) {
          return Math.min(a, Math.min(b, c));
      }
  
      private int min(int a, int b, int c, int d) {
          return Math.min(Math.min(a, b), Math.min(c, d));
      }
  
      private long min(long a, long b, long c, long d) {
          return Math.min(Math.min(a, b), Math.min(c, d));
      }
  
      private float min(float a, float b, float c, float d) {
          return Math.min(Math.min(a, b), Math.min(c, d));
      }
  
      private double min(double a, double b, double c, double d) {
          return Math.min(Math.min(a, b), Math.min(c, d));
      }
  
      private int max(int a, int b) {
          return Math.max(a, b);
      }
  
      private long max(long a, long b) {
          return Math.max(a, b);
      }
  
      private float max(float a, float b) {
          return Math.max(a, b);
      }
  
      private double max(double a, double b) {
          return Math.max(a, b);
      }
  
      private int max(int a, int b, int c) {
          return Math.max(a, Math.max(b, c));
      }
  
      private float max(float a, float b, float c) {
          return Math.max(a, Math.max(b, c));
      }
  
      private double max(double a, double b, double c) {
          return Math.max(a, Math.max(b, c));
      }
  
      private long max(long a, long b, long c) {
          return Math.max(a, Math.max(b, c));
      }
  
      private int max(int a, int b, int c, int d) {
          return Math.max(Math.max(a, b), Math.max(c, d));
      }
  
      private long max(long a, long b, long c, long d) {
          return Math.max(Math.max(a, b), Math.max(c, d));
      }
  
      private float max(float a, float b, float c, float d) {
          return Math.max(Math.max(a, b), Math.max(c, d));
      }
  
      private double max(double a, double b, double c, double d) {
          return Math.max(Math.max(a, b), Math.max(c, d));
      }
  
  }
  