HDU hosts sporting meeting every year.One of the most exciti
HDU hosts sporting meeting every year.One of the most exciting events is the 10000M-running.During the match many students are running on the track.So,how about the rank list now?
As we know,in a running ,we rank the player according to the length everyone has passed .So if one player run 400M(one lap) farther than another player ,it looks like they are running at the same position on the track ,but the rank of the former is much better than the latter.Now given everyone’s position on the track ,and one rank list ,can you tell me whether the rank list is possible.
Input
The first line of input gives the number of cases,T (at most 110).the first line of each case has two intergers,n,m.(1 >lap;
cin>>xx>>rr;
if(n==1&&(xx>=lap||rr!=1))
sign=1;
for(i=1;i>x>>r;
if(!(xrr)||(x>=lap))
sign=1;
xx=x,rr=r;
}
if(sign==1)
cout