-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCF673ABearAndGame.java
More file actions
45 lines (38 loc) · 1020 Bytes
/
CF673ABearAndGame.java
File metadata and controls
45 lines (38 loc) · 1020 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
/**
* See <a href="http://codeforces.com/problemset/problem/673/A">Bear and
* Game</a>
*
* @author Brian Yeicol Restrepo Tangarife
*/
public class CF673ABearAndGame {
static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
static PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) throws IOException {
read();
int[] times = readArray();
int total = 15;
for (int time : times) {
if (time <= total) {
total = time;
} else {
break;
}
total += 15;
}
out.print(total > 90 ? 90 : total);
out.close();
}
private static String read() throws IOException {
return in.readLine();
}
private static int[] readArray() throws IOException {
String[] line = in.readLine().split("\\s");
int[] a = Arrays.stream(line).mapToInt(Integer::parseInt).toArray();
return a;
}
}