Pancho was given a permutation$$$^{\text{∗}}$$$ $$$p_1, p_2, \ldots, p_n$$$ as a gift when he was a child. He made many fond memories with his permutation, but the day he turned $$$18$$$, he realized to his horror that some of the elements of the permutation may have been erased.
Pancho was never great at remembering long sequences of numbers, but he recalls two of its properties:
Your task is to help Pancho by outputting the $$$k$$$-th smallest permutation in lexicographical order$$$^{\text{†}}$$$ that matches the information he remembers or reporting that there is no such permutation.
$$$^{\text{∗}}$$$A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).
$$$^{\text{†}}$$$An array $$$a$$$ is lexicographically smaller than an array $$$b$$$ if and only if one of the following holds:
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 100$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$2 \leq n \leq 10^6$$$ and $$$1 \leq k \leq 10^{18}$$$) — the length of the permutation and the index of the one you must construct.
The second line of each test case contains $$$n$$$ integers $$$p_1,p_2,\dots,p_n$$$ (if $$$p_i$$$ is known, then $$$1 \leq p_i \leq n$$$; otherwise, $$$p_i=-1$$$) — the information provided about the original permutation.
It is guaranteed that the known values $$$p_i$$$ (those with $$$p_i \neq -1$$$) are pairwise distinct.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^6$$$.
Print a line for each test case. Print $$$-1$$$ if there are fewer than $$$k$$$ valid permutations. Otherwise, print $$$n$$$ integers representing the requested permutation.
45 11 2 3 4 56 69-1 -1 -1 -1 -1 -14 2-1 -1 -1 -110 105 3 9 -1 -1 10 -1 2 -1 -1
-13 4 1 6 2 53 1 4 25 3 9 1 6 10 7 2 8 4
In the first test case, the first two elements of the given information are $$$1$$$ and $$$2$$$. Since these two numbers are precisely the elements of a permutation of length $$$2$$$, there are no valid permutations.
In the third test case, there are exactly $$$2$$$ valid permutations (listed in lexicographical order), $$$[2, 4, 1, 3]$$$ and $$$[3, 1, 4, 2]$$$.
The answer is the second one, as requested.
| Name |
|---|


