题目描述
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
Donald Drumpf has spent the entire summer lobbying to gather votes for the upcoming student government election. At his University, there are a total of N students. Each student in the university casts a vote. The size of student government is determined by the number of students that get at least K votes.
Each person that receives at least K votes is given a post in the student government. The Dean noticed that every year, there are a few students who vote for themselves. He decided to add a rule to disqualify any such individuals who vote for themselves i.e they cannot be part of the student government.
You are given an array A, where A_{i} denotes the person who the i-th person voted for. Can you compute the size of the student government?
------ Input ------
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
For each test case, first line consists of two space separated integers N, K.
Second line consists of N space separated integers denoting the array A, where i-th integer denotes A_{i}.
------ Output ------
For each test case, output a single line containing an integer corresponding to the size of the student government.
------ Constraints ------
$1 ≤ T ≤ 100$
$1 ≤ K ≤ N$
$1 ≤ A_{i} ≤ N$
------ Subtasks ------
Subtask #1: (30 points)
$1 ≤ N ≤ 3$
Subtask #2: (70 points)
$1 ≤ N ≤ 100$
----- Sample Input 1 ------
2
3 2
2 1 2
2 1
1 2
----- Sample Output 1 ------
1
0
----- explanation 1 ------
In first test case, there are 3 students. A student must receive at least 2
votes to be part of the student government. Student 1 votes for student 2, student 2 votes for student 1 and student 3 votes for student 2. Thus, Student 2 receives 2 votes and is the only one eligible for student government.
In second test case, although both students receive the required amount of votes, they are both disqualified as they had voted for themselves. Thus, size of the student
government is 0.
输入格式
见题面
输出格式
见题面