File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments