-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
27 lines (24 loc) · 799 Bytes
/
Main.java
File metadata and controls
27 lines (24 loc) · 799 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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
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());
int E_MAX = 15;
int S_MAX = 28;
int M_MAX = 19;
int year=e;
while (true){
if((year-s)%S_MAX ==0 && (year-m)%M_MAX==0){
break;
}
year+=E_MAX;
}
System.out.println(year);
}
}