The professor is conducting a course on Discrete Mathematics to a class of N students. He is angry at the lack of their discipline, and he decides to cancel the class if there are fewer than K students present after the class starts.
Given the arrival time of each student, your task is to find out if the class gets cancelled or not.
The first line of the input contains T, the number of test cases. Each test case contains two lines.
The first line of each test case contains two space-separated integers, N and K.
The next line contains N space-separated integers, a1,a2,…,aN, representing the arrival time of each student.
If the arrival time of a given student is a non-positive integer (ai≤0), then the student enters before the class starts. If the arrival time of a given student is a positive integer (ai>0), the student enters after the class has started.
For each testcase, print “YES” (without quotes) if the class gets cancelled and “NO” (without quotes) otherwise.
If a student enters the class exactly when it starts (ai=0), the student is considered to have entered before the class has started.
-1 -3 4 2
0 -1 2 1
static void Main(string args)
int noOfTestCases = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < noOfTestCases; ++i)
int minNoOfStudents = Convert.ToInt32(Console.ReadLine().Split(‘ ‘));
List arrivalTimeList = Console.ReadLine().Split(‘ ‘).Select(x => Convert.ToInt32(x)).ToList();
int noOfArrivedStudents = arrivalTimeList.Count(x => x <= 0);
if (noOfArrivedStudents >= minNoOfStudents)