Score | |
---|---|
Problem A | 462 |
Problem B | 693 |
Problem C | 1155 |
Problem D | 1386 |
Problem E | 1848 |
Problem F1 | 1386 |
Problem F2 | 924 |
Successful hack | 100 |
Unsuccessful hack | -50 |
Unsuccessful submission | -50 |
Resubmission | -50 |
Mihai has just learned about the MEX concept and since he liked it so much, he decided to use it right away.
Given an array
While
But, since Mihai loves big arrays as much as the MEX concept, he wants the new array
An array
The MEX of a set of non-negative integers is the minimal non-negative integer such that it is not in the set. For example, MEX({
The first line of the input contains a single integer
The first line of each test case contains a single integer
The second line of each test case contains
It is guaranteed that the sum of
For each test case print
6 5 1 0 2 0 3 8 2 2 3 4 0 1 2 0 1 1 5 0 1 2 3 4 4 0 1 1 0 10 0 0 2 1 1 1 0 0 1 1
1 4 2 5 1 1 0 1 5 2 2 2 4 3 2 2 0
In the first test case, the lexicographically maximum array
In the second test case, there are two ways to obtain the maximum array: first selecting
Name | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
No items |