From be9733b53795eb232fd86a48746fd2dda520d5a6 Mon Sep 17 00:00:00 2001 From: oncsr Date: Wed, 5 Feb 2025 14:49:45 +0900 Subject: [PATCH] =?UTF-8?q?[20250205]=20BOJ=20/=20=EA=B3=A8=EB=93=9C2=20/?= =?UTF-8?q?=20Catch-Up=20/=20=EA=B6=8C=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- khj20006/202502/05 BOJ G2 Catch-Up.md | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 khj20006/202502/05 BOJ G2 Catch-Up.md diff --git a/khj20006/202502/05 BOJ G2 Catch-Up.md b/khj20006/202502/05 BOJ G2 Catch-Up.md new file mode 100644 index 00000000..fca5eb5b --- /dev/null +++ b/khj20006/202502/05 BOJ G2 Catch-Up.md @@ -0,0 +1,45 @@ +```java + +import java.util.*; +import java.io.*; + +class Main { + + // IO field + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringTokenizer st; + + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + static long nextLong() {return Long.parseLong(st.nextToken());} + static void bwEnd() throws Exception {bw.flush();bw.close();} + + // Additional field + static int gcd(int a, int b) { + if(a < b) { + int temp = a; + a = b; + b = temp; + } + return a%b==0 ? b : gcd(b,a%b); + } + + public static void main(String[] args) throws Exception { + + nextLine(); + int a = nextInt(); + int b = nextInt(); + int c = nextInt(); + int d = nextInt(); + + if((b-a)*(d-c) < 0) bw.write("NO"); + else if(b==a || c==d) bw.write(b-a == d-c ? "YES":"NO"); + else bw.write("YES"); + + bwEnd(); + } + +} + +```