| Codeforces Round 1034 (Div. 3) |
|---|
| Finished |
Define the $$$\mathrm{MEX}$$$ (minimum excluded value) of an array to be the smallest nonnegative integer not present in the array. For example,
You are given an array $$$a$$$ of size $$$n$$$ of nonnegative integers.
For all $$$k$$$ ($$$0\leq k \leq n$$$), count the number of possible values of $$$\mathrm{MEX}(a)$$$ after removing exactly $$$k$$$ values from $$$a$$$.
The first line contains an integer $$$t$$$ ($$$1\leq t\leq 10^4$$$) — the number of test cases.
The first line of each test case contains one integer $$$n$$$ ($$$1\leq n\leq 2\cdot 10^5$$$) — the size of the array $$$a$$$.
The second line of each test case contains $$$n$$$ integers, $$$a_1,a_2,\dots,a_n$$$ ($$$0\leq a_i\leq n$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\cdot 10^5$$$.
For each test case, output a single line containing $$$n+1$$$ integers — the number of possible values of $$$\mathrm{MEX}(a)$$$ after removing exactly $$$k$$$ values, for $$$k=0,1,\dots,n$$$.
551 0 0 1 263 2 0 4 5 161 2 0 1 3 240 3 4 150 0 0 0 0
1 2 4 3 2 1 1 6 5 4 3 2 1 1 3 5 4 3 2 1 1 3 3 2 1 1 1 1 1 1 1
In the first sample, consider $$$k=1$$$. If you remove a $$$0$$$, then you get the following array:
| 1 | 0 | 1 | 2 |
| 1 | 0 | 0 | 1 |
| Name |
|---|


