-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathB.java
More file actions
25 lines (21 loc) · 768 Bytes
/
Copy pathB.java
File metadata and controls
25 lines (21 loc) · 768 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
package atcoder.m_solutions;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public final class B {
public static void main(String[] args) {
final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
final int a = in.nextInt();
final int b = in.nextInt();
final int c = in.nextInt();
in.nextLine();
final int k = Integer.parseInt(in.nextLine());
System.out.println(dfs(a, b, c, k) ? "Yes" : "No");
}
private static boolean dfs(int a, int b, int c, int k) {
if (k == 0) {
return c > b && b > a;
}
return dfs(a * 2, b, c, k - 1) || dfs(a, b * 2, c, k - 1) || dfs(a, b, c * 2, k - 1);
}
}