Score : $200$ points
There are $N$ squares, indexed Square $1$, Square $2$, …, Square $N$, arranged in a row from left to right.
Also, there are $K$ pieces. The $i$-th piece from the left is initially placed on Square $A_i$.
Now, we will perform $Q$ operations against them.
The $i$-th operation is as follows:
Print the index of the square on which the $i$-th piece from the left is after the $Q$ operations have ended, for each $i=1,2,\ldots,K$.
Input is given from Standard Input in the following format:
$N$ $K$ $Q$ $A_1$ $A_2$ $\ldots$ $A_K$ $L_1$ $L_2$ $\ldots$ $L_Q$
Print $K$ integers in one line, with spaces in between. The $i$-th of them should be the index of the square on which the $i$-th piece from the left is after the $Q$ operations have ended.
5 3 5 1 3 4 3 3 1 1 2
2 4 5
At first, the pieces are on Squares $1$, $3$, and $4$. The operations are performed against them as follows:
Thus, after the $Q$ operations have ended, the pieces are on Squares $2$, $4$, and $5$, so $2$, $4$, and $5$ should be printed in this order, with spaces in between.
2 2 2 1 2 1 2
1 2
10 6 9 1 3 5 7 8 9 1 2 3 4 5 6 5 6 2
2 5 6 7 9 10