-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBAEKJOON_1476_2
More file actions
50 lines (42 loc) · 1.24 KB
/
BAEKJOON_1476_2
File metadata and controls
50 lines (42 loc) · 1.24 KB
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
48
49
50
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
// 1 <= E <= 15
// 1 <= S <= 28
// 1 <= M <= 19
//입력은 E S M
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());
if(E==1 && S==1 && M==1){
bw.write("1");
bw.flush(); bw.close();
System.exit(0);
}
int e1=1; int s1=1; int m1=1;
int year=1;
while(true){
if(e1 > 15){
e1 = 1;
}
if(s1 > 28){
s1 = 1;
}
if(m1 > 19){
m1 = 1;
}
if(e1==E && s1==S && m1==M){
bw.write(String.valueOf(year));
bw.newLine();bw.flush();
break;
}
e1++; s1++; m1++;
year++;
}
bw.close();
}
}