</div> | |
<div align=center id=rollword><marquee scrollamount=2 width=600 scrolldelay=30 onMouseOver="javascript:this.stop();" onMouseOut="javascript:this.start();"><b style="margin-right:20px"><a class="hot" href="/viewnotify.php?cid=706&id=3">1009:answer mod 10^9+7,题目中已修改,已加粗。请各位选手注意。</a></b><a href="/notification.php?cid=706">More...</a></marquee></div><div style="width:980px;padding:0;margin:0"><tr><td align=center><h1 style='color:#1A5CC8;margin-top: 20px'>Teacher Bo</h1><font face=Arial><b><span style='font-size:12px;color:green'>Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)<br>Total Submission(s): 1532 Accepted Submission(s): 593<br></span></b></font><br><br><div class=panel_title align=left>Problem Description</div><div class=panel_content> 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.<br><br> If there exists such tetrad,print "YES",else print "NO".</div><div class=panel_bottom> </div><br><div class=panel_title align=left>Input</div><div class=panel_content>First line, an integer $T$. There are $T$ test cases.$(T\leq 50)$<br><br> 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)$.<br><br> 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)$.</div><div class=panel_bottom> </div><br><div class=panel_title align=left>Output</div><div class=panel_content>$T$ lines, each line is "YES" or "NO".</div><div class=panel_bottom> </div><br><div class=panel_title align=left>Sample Input</div><div class=panel_content><pre><div style="word-wrap:break-word;White-space:Pre-wrap;width:inherit;font-family:Courier New,Courier,monospace;white-space:pre;">2 | |
3 10 | |
1 1 | |
2 2 | |
3 3 | |
4 10 | |
8 8 | |
2 3 | |
3 3 | |
4 4</div></pre></div><div class=panel_bottom> </div><br><div class=panel_title align=left>Sample Output</div><div class=panel_content><pre><div style="word-wrap:break-word;White-space:Pre-wrap;width:inherit;font-family:Courier New,Courier,monospace;white-space:pre;">YES | |
NO</div></pre></div><div class=panel_bottom> </div><br><center style='font-size:15px;font-family:Arial;font-weight:bold;color:#1A5CC8'><a href='contest_statistic.php?cid=706&pid=1011'>Statistic</a> | <a href='contest_submit.php?cid=706&pid=1011'>Submit</a> | <a href='contest_listtopic.php?cid=706'>Clarifications</a> | <a href='contest_show.php?cid=706'>Back</A></center><br></td></tr></div> |