-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB24313.java
More file actions
33 lines (27 loc) · 904 Bytes
/
B24313.java
File metadata and controls
33 lines (27 loc) · 904 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
package Practice;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class B24313 { //알고리즘 수업 - 점근적 표기 1
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int A1 = Integer.parseInt(st.nextToken()), A2 = Integer.parseInt(st.nextToken()); //정수
int C = Integer.parseInt(br.readLine()), N0 = Integer.parseInt(br.readLine()); //양의 정수
int n = C - A1; //n
if(n < 0) {
System.out.println(0);
return ;
}
if(n == 0) {
if(A2 <= 0) System.out.println(1);
else System.out.println(0);
return ;
}
if(A2 % n != 0) A2 = A2 / n + 1;
else A2 = A2 / n;
if(N0 >= A2) System.out.println(1);
else System.out.println(0);
}
}