F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Teacher Bo

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 2778    Accepted Submission(s): 1467


Problem Description
Teacher BoBo is a geography teacher in the school.One day in his class,he marked $N$ points in the map,the $i$-th point is at $(X_i,Y_i)$.He wonders,whether there is a tetrad $(A,B,C,D)(A<B,C<D,A\neq C or B\neq D)$ such that the manhattan distance between A and B is equal to the manhattan distance between C and D.

If there exists such tetrad,print "YES",else print "NO".
 

Input
First line, an integer $T$. There are $T$ test cases.$(T\leq 50)$

In each test case,the first line contains two intergers, N, M, means the number of points and the range of the coordinates.$(N,M\leq 10^5)$.

Next N lines, the $i$-th line shows the coordinate of the $i$-th point.$(X_i,Y_i)(0\leq X_i,Y_i\leq M)$.
 

Output
$T$ lines, each line is "YES" or "NO".
 

Sample Input
2 3 10 1 1 2 2 3 3 4 10 8 8 2 3 3 3 4 4
 

Sample Output
YES NO
 

Author
ÉÜÐËÒ»ÖÐ
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 11:11:13, Gzip enabled