# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

# In Queue

By Pranta07 · Limits 1s, 512 MB

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$.

• Students are coming one after another. If $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.
• If $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.

## Input

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$.

## Output

For each test case, on a separate line print $N$ integers, the ID of $N$ students according to the sequence they left the queue.

## Sample

InputOutput
1
8 7
3 1 5 3 7 4 5 2

5 3 7 6 1 4 8 2


### Statistics

75% Solution Ratio

ivanbrEarliest, 1M ago

coderUDFastest, 0.1s

user.455533Lightest, 15 MB

Humayra_037Shortest, 411B