-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
33 lines (28 loc) · 850 Bytes
/
Main.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
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringTokenizer st = new StringTokenizer(br.readLine());
int E = Integer.parseInt(st.nextToken());
int S = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());
int e = 1, s = 1, m = 1;
int ans = 1;
while (e != E || s != S || m != M) {
e++; s++; m++;
ans++;
if (e > 15) e = 1;
if (s > 28) s = 1;
if (m > 19) m = 1;
}
bw.write(ans + "\n");
bw.flush();
bw.close();
br.close();
}
}