Time limit
2s
Memory limit
128 MB
A printer normally prints documents in the order their print requests arrive. When several documents are waiting, they form a queue, and the document that entered first is processed first.
This printer processes documents by the following rules.
For instance, if four documents A B C D have priorities 2 1 4 3 in that order, they are printed in the order C, D, A, B.
Given the number of documents in the queue and each document's priority, determine the print order of one specific document. In the situation above, C is printed 1st and A is printed 3rd.
The first line contains the number of test cases. Each test case consists of two lines.
The first line of a test case contains the number of documents N and the current position M of the document of interest. The leftmost document has position 0, and 0 ≤ M < N.
The second line contains the priorities of the N documents from left to right in the current queue. Each priority is an integer from 1 to 9, and multiple documents may have the same priority.
1 ≤ N ≤ 100For each test case, print one line containing the 1-based order in which the document of interest is printed.