There are $N$
students in a queue with ID $1, 2, 3, ..., N$
respectively. Each student has some coins $C_1, C_2, C_3, ...., C_N$
. Minimum coins required for buying a meal from the canteen is $M$
.
$C_i \geq M$
, the $i$
'th student should buy a meal from the canteen. After buying the meal, he/she will leave the queue.$C_i < M$
then the student should go behind the queue and his/her coins will be increased by exactly $1$
.The above process will repeat till the queue is not empty. Find the sequence of leaving the queue of $N$
students.
The first line contains an integer $T$
$\left(1 \leq T \leq 10^3\right)$
, the number of test cases.
Then $T$
test cases follow $-$
The first line of each test case contains two integers $N$
$\left(1 \leq N \leq 10^6\right)$
and $M$
$\left(1 \leq M \leq 10^9\right)$
. The second line of each test case contains $N$
integers $C_1, C_2 , C_3 , ...., C_N$
$\left( 1 \leq C_i \leq 10^9\right)$
.
It is guaranteed that the sum of $N$
over all test cases does not exceed $10^6$
.
For each test case, on a separate line print $N$
integers, the ID of $N$
students according to the sequence they left the queue.
Input | Output |
---|---|
1 8 7 3 1 5 3 7 4 5 2 | 5 3 7 6 1 4 8 2 |