Drumpf for President!

All submissions for this problem are available.
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 ith 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 ith 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
 1 ≤ N ≤ 100
Example
Input: 2 3 2 2 1 2 2 1 1 2 Output: 1 0
Explanation
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.
Author:  admin2 
Tester:  pushkarmishra 
Editorial  http://discuss.codechef.com/problems/STUDVOTE 
Tags  adhoc, admin2, cakewalk, ltime38 
Date Added:  29072016 
Time Limit:  2 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 