-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA Student's Dream
More file actions
26 lines (20 loc) · 761 Bytes
/
A Student's Dream
File metadata and controls
26 lines (20 loc) · 761 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
import java.io.*;
import java.util.*;
public class Main {
static boolean ok(int g, int b) {
return b >= g - 1 && b <= 2 * g + 2;
}
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int gl = Integer.parseInt(st.nextToken());
int gr = Integer.parseInt(st.nextToken());
st = new StringTokenizer(br.readLine());
int bl = Integer.parseInt(st.nextToken());
int brf = Integer.parseInt(st.nextToken());
boolean possible =
ok(gl, brf) ||
ok(gr, bl);
System.out.print(possible ? "YES" : "NO");
}
}