MINMEX#12382

MINMEX

2 seconds
256 megabytes
Hard

You are given an array of length .

For a fixed integer (1 \le k \le n), define the value as the minimum possible MEX of all subsequences of having length exactly .

Recall that the MEX (Minimum Excluded Value) of a sequence is the smallest non-negative integer that does not appear in the sequence. For example:

Your task is to compute for all values of from to .

Input

The first line contains a single integer (1 \le t \le 10^5) — the number of test cases.

The first line of each test case contains a single integer (1 \le n \le 5 \cdot 10^5) — the length of the array.

The second line contains integers a_1, a_2, \dots, a_n (0 \le a_i \le 10^9).

It is guaranteed that the sum of over all test cases does not exceed 5 \cdot 10^5.

Output

For each test case, output integers: f(1), f(2), \dots, f(n), where denotes the minimum possible MEX among all subsequences of length .

Examples

Example 1

Loading
Loading

Scoring

  1. Subtask ( points): a_i \le 2.

  2. Subtask ( points): a_i \le 100.

  3. Subtask ( points): a_1 = a_2 = a_3 = a_4 = \dots.

  4. Subtask ( points): \sum n \le 2000 over all test cases.

  5. Subtask ( points): No additional constraints.