Skip to content

Commit be9733b

Browse files
authored
[20250205] BOJ / 골드2 / Catch-Up / 권혁준
1 parent 78549dc commit be9733b

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
```java
2+
3+
import java.util.*;
4+
import java.io.*;
5+
6+
class Main {
7+
8+
// IO field
9+
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
10+
static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
11+
static StringTokenizer st;
12+
13+
static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());}
14+
static int nextInt() {return Integer.parseInt(st.nextToken());}
15+
static long nextLong() {return Long.parseLong(st.nextToken());}
16+
static void bwEnd() throws Exception {bw.flush();bw.close();}
17+
18+
// Additional field
19+
static int gcd(int a, int b) {
20+
if(a < b) {
21+
int temp = a;
22+
a = b;
23+
b = temp;
24+
}
25+
return a%b==0 ? b : gcd(b,a%b);
26+
}
27+
28+
public static void main(String[] args) throws Exception {
29+
30+
nextLine();
31+
int a = nextInt();
32+
int b = nextInt();
33+
int c = nextInt();
34+
int d = nextInt();
35+
36+
if((b-a)*(d-c) < 0) bw.write("NO");
37+
else if(b==a || c==d) bw.write(b-a == d-c ? "YES":"NO");
38+
else bw.write("YES");
39+
40+
bwEnd();
41+
}
42+
43+
}
44+
45+
```

0 commit comments

Comments
 (0)