-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay27.java
More file actions
38 lines (35 loc) · 1.18 KB
/
Copy pathDay27.java
File metadata and controls
38 lines (35 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
System.out.println(5);
System.out.println("4 3"); //yes
System.out.println("0 -3 4 0");
System.out.println("5 2"); //no
System.out.println("0 1 4 2 2");
System.out.println("3 3"); //yes
System.out.println("0 -3 -4");
System.out.println("7 2"); //no
System.out.println("0 1 1 1 1 1 1");
System.out.println("6 3"); //yes
System.out.println("0 0 0 2 1 1");
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int j = 0; j < t; j++){
int n = sc.nextInt();
int k = sc.nextInt();
int count=0;
int[] a = new int[n];
for(int i = 0;i < n;i++){
a[i] = sc.nextInt();
if(a[i]<=0)
count++;
}
if(count>=k)
System.out.println("NO");
else
System.out.println("YES");
}
}
}