#d2463. 打饭队伍
打饭队伍
Cafeteria Queue
Problem Description
There are students waiting in line for food. The -th student stands at the -th position from the front. The serving window serves one portion to the student at the front of the queue each time; after receiving the food, that student immediately goes to the back of the queue. The -th student needs portions to be full; once full, he immediately leaves the queue and no longer waits.
Find the state of the queue after a total of portions have been served.
Input Format
The first line contains two integers .
The second line contains integers .
Output Format
If fewer than portions can be served, output -1; otherwise output the indices of the students still in the queue, ordered from front to back, separated by spaces.
Sample Input 1
3 3
1 2 1
Sample Output 1
2
Sample Input 2
4 10
3 3 2 1
Sample Output 2
-1
Sample Input 3
7 10
1 3 3 1 2 3 1
Sample Output 3
6 2 3