-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path1789.java
47 lines (40 loc) · 1.08 KB
/
1789.java
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
39
40
41
42
43
44
45
46
47
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Locale;
import java.util.Scanner;
/*
*
*/
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int maior=0;
String linha;
while ((linha = br.readLine()) != null) {
int n = Integer.parseInt(linha);
int m = sc.nextInt();
int contador=0;
do {
int k = 0;
k=sc.nextInt();
if(k>maior) {
maior=k;
}
contador++;
}while(contador<m);
if(maior<10) {
System.out.println("1");
}
if(maior>=10 && maior<20) {
System.out.println("2");
}
if(maior>=20) {
System.out.println("3");
}
}
Locale.setDefault(Locale.US);
sc.close();
}
}