-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathp1476.java
More file actions
35 lines (35 loc) · 946 Bytes
/
p1476.java
File metadata and controls
35 lines (35 loc) · 946 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
import java.io.*;
import java.util.*;
public class p1476 {
static int E, S, M, result;
static BufferedReader br;
static StringTokenizer st;
public static void main(String[] args) throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
st = new StringTokenizer(br.readLine());
E = Integer.parseInt(st.nextToken());
S = Integer.parseInt(st.nextToken());
M = Integer.parseInt(st.nextToken());
int e = 0, s = 0, m = 0;
result = 0;
while(true) {
if (E == e && S == s && M == m) {
break;
}
e++;
s++;
m++;
if (e == 16) {
e = 1;
}
if (s == 29) {
s = 1;
}
if (m == 20) {
m = 1;
}
result++;
}
System.out.println(result);
}
}