#T623. 期末成绩
期末成绩
Description
It's the end of the semester again, and Xiao Ming is facing another round of final exams.
After the exams, Xiao Ming received the class score sheet, which is sorted in order of student IDs. Xiao Ming wants to know how many classmates scored higher than him. Now, please help him count the number of students whose scores are higher than his.
Input Format
The first line of input is a positive integer T, representing the number of test cases. This is followed by T test cases.
Each test case consists of two lines.
The first line contains two positive integers N and K (0 < N < 1000, 0 < K <= N), representing the total number of students on the score sheet and Xiao Ming's student ID, respectively.
The second line contains N integers Xi (0 <= Xi <= 100), representing the scores of each student in ascending order of student IDs. The first student has an ID of 1.
Output Format
For each test case, output a single line indicating the number of students in the class whose scores are higher than Xiao Ming's.
```input1 1 3 2 81 72 63 ``` ```output1 1 ``` ## 译文CodesOnline