-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathboj_1476.java
More file actions
50 lines (42 loc) · 1.11 KB
/
boj_1476.java
File metadata and controls
50 lines (42 loc) · 1.11 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
package brute_force;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class boj_1476 {
public static void main(String[] args) throws IOException {
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
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){
System.out.println(1);
return;
}
//count할 용도의 변수
int e=1;
int s=1;
int m=1;
int result=1;
while(true){
if(e==E && s==S && m==M){
break;
}
e++;
s++;
m++;
result++;
if(e>15){
e=1;
}
if(s>28){
s=1;
}
if(m>19) {
m = 1;
}
}
System.out.println(result);
}
}