Score : $400$ points
There is a deck consisting of $N$ face-down cards with an integer from $1$ through $N$ written on them. The integer on the $i$-th card from the top is $P_i$.
Using this deck, you will perform $N$ moves, each consisting of the following steps:
For each card, find which of the $N$ moves eats it. If the card is not eaten until the end, report that fact.
Input is given from Standard Input in the following format:
$N$ $K$ $P_1$ $P_2$ $\dots$ $P_N$
Print $N$ lines.
The $i$-th line ($1 \le i \le N$) should describe the card with the integer $i$ written on it. Specifically,
5 2 3 5 2 1 4
4 3 3 -1 4
In this input, $P=(3,5,2,1,4)$ and $K=2$.
5 1 1 2 3 4 5
1 2 3 4 5
If $K=1$, every card is eaten immediately after put on the table within a single move.
15 3 3 14 15 9 2 6 5 13 1 7 10 11 8 12 4
9 9 9 15 15 6 -1 -1 6 -1 -1 -1 -1 6 15