-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathA_Balanced_Contest.java
More file actions
23 lines (22 loc) · 884 Bytes
/
Copy pathA_Balanced_Contest.java
File metadata and controls
23 lines (22 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public static void main(String[] args) throws java.lang.Exception
{
FastReader sc = new FastReader();
int t,n,p;
t = sc.nextInt();
while (t-- > 0) {
// Map < Integer, Integer > map = new HashMap < > ();
n=sc.nextInt();
p=sc.nextInt();
int easy=p/2,hard=p/10,temp,hrd=0,ez=0;
for(int i=0;i<n;i++){
temp=sc.nextInt();
if(temp>=easy) ez++;
else if(temp<=hard) hrd++;
}
if((ez==1)&&(hrd==2)) sout("yes");
else sout("no");
}
}
// we need to check the count of easy and hard problems by checking if number of people solving problem is greater than
// reqired easy threshold then we increase the count of easy problem similarly we check for hard count and at last we
// check if easy count is 1 and hard count is 2 then we print yes else print no