Angry Lambda

2.8

22 votes
Very-Easy
Problem

Prof. Lambda has N students in his class. Due to his ignorance his students has gone rogue on him and never comes to class on time. Prof. Lambda has decided to discipline them by canceling the class if fewer than K students are present when class starts.

You are given the arrival time of each student, determine if the class is canceled.

Input Format

The first line contains T, the number of test cases.

Each test case consists of two lines. The first line has N and K, space separated. The second line contains N space separated integers ( a1,a2,...,aN) describing the arrival time for each student.

Note: Non-positive arrival times(ai ≤ 0 ) indicate the student arrived early or on time; Positive arrival time ( ai > 0 ) indicate the student arrived ai minutes late.

If a student arrives on time (ai = 0), the student is considered to have entered before the class started.

Output Format

For each test case, print the word YES if the class is canceled or NO if it is not.

Constraints

1 ≤ T ≤ 10
1 ≤ N ≤ 1000
1 ≤ K ≤ N
-100 ≤ ai ≤ 100, where i ϵ [1,N]

Sample Input
3
3 3
-1 4 2
5 1
-1 2 3 5 0
3 2
-1 4 -1

Sample Output
YES
NO
NO

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?