-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCATM.java
35 lines (32 loc) · 807 Bytes
/
CATM.java
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
27
28
29
30
31
32
33
34
35
package ques;
import java.util.Scanner;
public class CATM {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int n=scanner.nextInt();
int m=scanner.nextInt();
int t=scanner.nextInt();
while(t>0){
t--;
int m1=scanner.nextInt();
int m2=scanner.nextInt();
int c1=scanner.nextInt();
int c2=scanner.nextInt();
int d1=scanner.nextInt();
int d2=scanner.nextInt();
if(Math.abs(c1-d1)==Math.abs(c2-d2)){
if(Math.abs(c1-m1)==Math.abs(c2-m2) && Math.abs(d1-m1)==Math.abs(d2-m2)){
if(Math.abs(c1-m1)<=Math.abs(c1-d1) && Math.abs(d1-m1)<=Math.abs(c1-d1)){
System.out.println("NO");
}
else
System.out.println("YES");
}
else
System.out.println("YES");
}
else
System.out.println("YES");
}
}
}