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.InputStreamReader;
  import java.io.PrintWriter;
  import java.math.BigDecimal;
  import java.math.BigInteger;
  import java.util.*;
  
  public class Main {
  	public static void main(String[] args) {
  		InputReader in = new InputReader();
  		PrintWriter out = new PrintWriter(System.out);
  		solve(in, out);
  
  		out.close();
  	}
  
  	public static void solve(InputReader in, PrintWriter out) {
  		// TODO
  		int t = in.nextInt();
  		while (t-- > 0) {
  			int n = in.nextInt();
  			// 记录每个数出现了多少次
  			Map<Integer, Integer> freq = new HashMap<>();
  			for (int i = 1; i <= n; i++) {
  				int x = in.nextInt();
  				freq.put(x, freq.getOrDefault(x, 0) + 1);
  			}
  
  			long moveCnt = 0, canMoveCnt = 0;
  			Deque<Integer> canMoveDq = new ArrayDeque<>();
  			long[] res = new long[n + 1];
  			Arrays.fill(res, -1L);
  
  			for (int mex = 0; mex <= n; mex++) {
  				int cnt = freq.getOrDefault(mex, 0);
  				if (canMoveCnt >= mex) {
  					res[mex] = moveCnt + cnt;
  				}
  				// 可移动的数目
  				canMoveCnt += cnt;
  
  				if (cnt == 0) {
  					// 需要前面的数填补该空缺
  					// 填补规则: 优先选择离当前位置最近的,这样移动的步数最少
  					while (canMoveDq.size() > 0) {
  						int x = canMoveDq.peekLast();
  						if (freq.getOrDefault(x, 0) < 2) {
  							// 不够填,继续往前看
  							canMoveDq.pollLast();
  						} else {
  							break;
  						}
  					}
  					if (canMoveDq.size() == 0) {
  						break;
  					}
  
  					int last = canMoveDq.peekLast();
  					freq.put(last, freq.getOrDefault(last, 0) - 1);
  					freq.put(mex, freq.getOrDefault(mex, 0) + 1);
  					moveCnt += (mex - last);
  				} else if (cnt >= 2) {
  					// 可以为后面的数填补空缺
  					canMoveDq.offerLast(mex);
  				}
  			}
  
  			for (int mex = 0; mex <= n; mex++) {
  				out.print(res[mex] + " ");
  			}
  			out.println();
  		}
  	}
  }
  
  // ctrl+shsift+p
  class InputReader {
  	BufferedReader buf;
  	StringTokenizer tok;
  
  	InputReader() {
  		buf = new BufferedReader(new InputStreamReader(System.in));
  	}
  
  	boolean hasNext() {
  		while (tok == null || !tok.hasMoreElements()) {
  			try {
  				tok = new StringTokenizer(buf.readLine());
  			} catch (Exception e) {
  				return false;
  			}
  		}
  		return true;
  	}
  
  	String next() {
  		if (hasNext()) return tok.nextToken();
  		return null;
  	}
  
  	int nextInt() {
  		return Integer.parseInt(next());
  	}
  
  	long nextLong() {
  		return Long.parseLong(next());
  	}
  
  	double nextDouble() {
  		return Double.parseDouble(next());
  	}
  
  	BigInteger nextBigInteger() {
  		return new BigInteger(next());
  	}
  
  	BigDecimal nextBigDecimal() {
  		return new BigDecimal(next());
  	}
  }