跪求解答,编程题不会做
Shuffle CardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionA deck of card consists of n cards. Each card is different, numbered from 1 to n. At first, the cards were ordered from 1 to n. We complete the shuffle process in the following way, In each operation, we will draw a card and put it in the position of the first card, and repeat this operation for m times.Please output the order of cards after m operations. InputThe first line of input contains two positive integers n and m.(1<=n,m<=105)The second line of the input file has n Numbers, a sequence of 1 through n.Next there are m rows, each of which has a positive integer si, representing the card number extracted by the i-th operation. OutputPlease output the order of cards after m operations. (There should be one space after each number.) Sample Input5 31 2 3 4 5343 Sample Output3 4 1 2 5