-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVaccine2.java
More file actions
26 lines (25 loc) · 1019 Bytes
/
Vaccine2.java
File metadata and controls
26 lines (25 loc) · 1019 Bytes
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
import java.io.*;
import java.util.*;
import java.lang.*;
class Main {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int T = Integer.parseInt(st.nextToken());
for(int i = 0;i<T;i++) {
StringTokenizer st1 = new StringTokenizer(br.readLine());
int critical = 0;
int chill = 0;
int N = Integer.parseInt(st1.nextToken());
int D = Integer.parseInt(st1.nextToken());
StringTokenizer st2 = new StringTokenizer(br.readLine());
for(int j=0;j<N;j++) {
int age = Integer.parseInt(st2.nextToken());
if((age>=80)||(age<=9)) critical ++;
else chill++;
}
System.out.println((critical / D + ((critical % D) == 0 ? 0 : 1)) +
(chill / D + ((chill % D) == 0 ? 0 : 1)));
}
}
}