QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#20731#1779. Hiring HelpThe_Nobody#AC ✓157ms28188kbC++143.2kb2022-02-17 19:25:532022-05-03 11:18:30

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-03 11:18:30]
  • 评测
  • 测评结果:AC
  • 用时:157ms
  • 内存:28188kb
  • [2022-02-17 19:25:53]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define Il inline
#define Re register
#define mem(u,v) memset(u,v,sizeof(u))
#define rep(i,a,b) for(Re ll i=(a),KKK##i=(b);i<=KKK##i;i++)
#define drep(i,a,b) for(Re ll i=(a),KKK##i=(b);i>=KKK##i;i--)
#define go(u) for(ll i=head[u],v=e[i].to;i;i=e[i].nxt,v=e[i].to)
#define _go(u) for(ll i=Head[u],v=E[i].to;i;i=E[i].nxt,v=E[i].to)
#define __go(u) for(ll i=Head[u],v=e[i].to;i;i=e[i].nxt,v=e[i].to)
#define writesp(x) write(x),putchar(' ')
#define writeln(x) write(x),puts("")
using namespace std;
Il ll read(){ll sum=0,f=0;char ch=getchar();for(;!isdigit(ch);ch=getchar())f|=(ch=='-');for(;isdigit(ch);ch=getchar())sum=((sum<<1)+(sum<<3)+(ch^48));return f?-sum:sum;}
void write(const ll x){if(x<0){putchar('-');write(-x);return;}if(x>9)write(x/10);putchar(x%10+'0');}
char getc(){char c=getchar();while(!isalpha(c))c=getchar();return c;}
#define N 220000
ll n,x[N],y[N],z[N],m,X[N],Y[N];bool flag[N],ans[N];char opt[N];
long double eps=1e-6,inf=1e9,mxy,mxx;
#define MP make_pair
#define E(x) ((x)*(x))
#define fi first
#define se second
#define pii pair<long double,long double>
#define spi set<pii>::iterator
set<pii>s; 
set<pii>::iterator it,_it;
long double dis(pii a,pii b){return sqrt(E(a.fi-b.fi)+E(a.se-b.se));}
long double slope(pii a,pii b){/*cout<<"CAO"<<(a.se-b.se)<<' '<<(a.fi-b.fi)<<endl;*/if(a.se<b.se)swap(a,b);return (a.se-b.se)/(a.fi-b.fi);}
void pr();
void INS(ll x,ll y){
//	cout<<x<<' '<<y<<endl;
	pii tmp=MP(x,y);
	it=s.lower_bound(tmp);
	_it=it;_it--;
	if(slope(*it,*_it)<slope(*it,tmp))return;
	if(y>mxy)mxy=y,mxx=x;
	else if(y==mxy&&x>mxx)mxx=x;
	it--;
	if(it!=s.begin()){
		_it=it;_it--;
		while(slope(*_it,*it)<slope(tmp,*it)){
			s.erase(it);it=_it;
			if(it==s.begin())break;
			_it--;
		}
	}
	it=s.lower_bound(tmp);_it=it;_it++;
	if(_it!=s.end()){
		while(slope(*_it,*it)>slope(*_it,tmp)){
			s.erase(it);it=_it;_it++;
			if(_it==s.end())break;
		}
	}
	s.insert(tmp);
}
void pr(){
	cout<<"pr: ";
	for(auto it=s.begin();it!=s.end();++it) cout<<"("<<(*it).first<<","<<(*it).second<<")"<<" ";
	cout<<endl;
}
int main(){
	n=read();rep(i,1,n)X[i]=read(),Y[i]=read();
	m=read();rep(i,1,m){
		opt[i]=getc();
		x[i]=read();
		if(opt[i]=='c')y[i]=read(),z[i]=read();
		else flag[x[i]]=1;
	}
	s.insert(MP(-inf,-inf*inf));s.insert(MP(inf,-inf*inf));
	rep(i,1,n)if(!flag[i]){
		INS(X[i],Y[i]);
//		pr();
	}
//	pr();
	drep(i,m,1){
		if(opt[i]=='c'){
			long double t=x[i];
			long double xx=1.0*y[i]/t,yy=1.0*z[i]/t;pii tmp=MP(xx,yy);
//			cout<<"DE"<<xx<<' '<<yy<<endl;
			if(xx<=mxx&&yy<=mxy)ans[i]=1;//,cout<<111111<<endl;
			else{
				it=s.upper_bound(tmp);it--;_it=s.lower_bound(tmp);
//				cout<<(*it).fi<<" "<<(*_it).fi<<endl;
//				cout<<(*it).se<<" "<<(*_it).se<<endl;
//				cout<<tmp.fi<<" "<<tmp.se<<endl;
//				cout<<slope(*it,*_it)<<' '<<slope(tmp,*_it)<<endl;
				if(*it==tmp)ans[i]=1;
				else if(slope(*it,*_it)<=slope(tmp,*_it))ans[i]=1;//,cout<<222222222<<endl;
				else ans[i]=0;
			}
		}
		else INS(X[x[i]],Y[x[i]]);
	}
	rep(i,1,m)if(opt[i]=='c')puts(ans[i]?"no":"yes");
}
/*
7
14753 9853
9888 10114
28934 12555
30496 24169
24737 9714
4252 24376
19530 11351
1
c 1 9723 16321


*/

詳細信息

Test #1:

score: 100
Accepted
time: 18ms
memory: 11180kb

input:

100000
24918 58686
96255 76925
38665 85048
91042 64321
62547 31597
87801 37026
57520 72333
94587 18469
41973 43371
13985 2042
4977 41343
21561 77619
17755 63377
54048 20485
77255 35133
77842 63322
30664 72902
3040 21356
5385 63807
72373 41221
47942 34296
93340 84775
80765 71904
22255 13930
58981 713...

output:

no
yes
yes
no
no
yes
yes
yes
no
yes
yes
no
yes
no
no
yes
no
yes
yes
no
yes
no
yes
yes
no
no
yes
yes
yes
yes
no
no
yes
no
no
yes
yes
yes
no
no
yes
no
yes
no
no
yes
no
yes
yes
no
yes
yes
yes
no
no
no
no
no
yes
yes
no
yes
no
no
yes
no
yes
no
yes
yes
yes
no
no
no
no
yes
yes
no
no
no
no
no
no
no
yes
no
y...

result:

ok 50047 lines

Test #2:

score: 0
Accepted
time: 36ms
memory: 11868kb

input:

100000
73477 20228
42547 43102
88300 34271
62447 24067
67857 60970
65951 99710
67448 38290
94825 85187
67892 96711
25235 93677
88408 83208
38123 66103
8959 31729
67304 56275
33320 25842
79418 57254
61457 28453
34524 81640
20375 87950
96453 16073
61354 68755
60765 62917
91424 54600
66789 49276
35585 ...

output:

no
no
yes
no
yes
no
no
yes
no
yes
no
no
no
no
no
no
no
yes
no
no
no
no
no
yes
no
yes
no
no
no
yes
no
no
no
yes
yes
yes
yes
yes
no
yes
no
no
yes
yes
no
yes
no
yes
no
yes
yes
no
yes
yes
no
no
yes
yes
yes
no
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
no
no
yes
yes
no
no
no
yes
yes
no
no
yes
yes
yes
yes...

result:

ok 50133 lines

Test #3:

score: 0
Accepted
time: 28ms
memory: 12392kb

input:

100000
91576 85406
99167 11608
77067 69947
75936 60175
53878 5457
62701 59924
62260 68200
46517 51814
58402 10372
29639 29498
84999 21315
88489 63570
68653 7384
99709 44722
51557 52642
8837 43673
5850 11230
87326 59910
49887 95639
33001 44068
35226 72441
19769 3380
49031 830
63160 51086
84129 34000
...

output:

yes
yes
yes
yes
yes
no
no
no
no
no
yes
yes
yes
no
no
no
yes
yes
no
yes
no
no
no
no
yes
no
no
yes
no
no
yes
yes
yes
no
no
yes
yes
yes
no
yes
yes
no
yes
yes
no
no
no
no
no
yes
no
no
no
no
yes
yes
yes
yes
yes
yes
no
yes
yes
no
yes
yes
no
yes
yes
yes
yes
no
yes
no
yes
no
no
no
no
yes
no
yes
yes
no
no
no...

result:

ok 50001 lines

Test #4:

score: 0
Accepted
time: 22ms
memory: 11472kb

input:

100000
36216 72581
62993 78197
61679 72756
19842 87024
36890 12249
98711 67799
39378 6852
67527 85511
78175 6541
86890 62395
25720 10252
74887 95875
99127 39931
80452 35536
44143 56489
206 69574
34455 9044
52948 14718
77807 80092
26536 93947
60281 13389
37286 37766
10255 10475
1204 17090
22111 46525...

output:

yes
yes
no
no
yes
no
yes
no
yes
yes
no
yes
yes
no
yes
yes
yes
no
no
no
yes
yes
yes
yes
no
yes
yes
no
yes
no
no
no
no
no
no
yes
no
no
no
no
no
yes
no
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
no
no
no
no
yes
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
no
no
no
no...

result:

ok 49885 lines

Test #5:

score: 0
Accepted
time: 27ms
memory: 11992kb

input:

100000
69654 33554
17935 98709
29282 83754
29832 7573
11624 17342
37634 91360
97586 79570
54557 57302
47774 80015
42953 82956
70562 33068
28469 94829
67659 3796
88868 25643
50574 58936
4285 90568
59958 30366
45537 54072
15455 52496
21350 21932
61139 42987
80351 21232
17187 76717
4348 91372
30485 922...

output:

no
no
no
yes
no
no
no
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
no
yes
yes
yes
no
no
no
yes
no
no
no
no
no
no
yes
no
no
no
yes
no
yes
no
no
yes
yes
no
no
no
yes
yes
yes
yes
yes
yes
no
no
yes
yes
no
no
no
yes
yes
no
no
yes
no
no
yes
no
no
yes
yes
no
no
yes
no
no
yes
yes
yes
yes
yes
no
yes
yes
no
yes...

result:

ok 49805 lines

Test #6:

score: 0
Accepted
time: 18ms
memory: 11920kb

input:

100000
91445 42161
30891 35291
59657 21768
33164 87635
79143 68950
26729 61039
47231 32043
13381 52766
25544 35422
18656 38140
90646 31174
90313 31706
3888 29117
55064 25934
36129 83858
31167 80237
38505 9092
43307 63239
7021 87982
79795 98816
61943 42370
43193 47487
98476 8080
13091 43009
55297 704...

output:

no
no
yes
yes
no
no
no
yes
no
yes
yes
no
yes
no
no
yes
yes
no
yes
no
yes
no
yes
yes
yes
no
no
yes
yes
yes
no
yes
yes
yes
yes
no
yes
no
no
yes
yes
yes
no
no
yes
no
yes
no
no
yes
yes
no
yes
no
no
no
no
no
yes
yes
no
no
no
yes
no
yes
no
no
no
yes
no
no
no
yes
no
no
yes
yes
no
yes
no
no
yes
yes
yes
no
n...

result:

ok 50050 lines

Test #7:

score: 0
Accepted
time: 22ms
memory: 11296kb

input:

100000
17976 12673
28750 66289
91505 1467
49828 45959
87164 42751
51829 54135
57511 46173
59754 8860
28409 51114
53542 67156
66592 17919
53217 21488
21967 92481
36823 88969
50186 7578
22856 55187
53238 81873
3765 22440
20315 48587
33364 46488
15118 86394
96645 83227
11469 13241
91106 88304
43165 843...

output:

yes
yes
no
yes
yes
yes
no
yes
yes
no
yes
yes
no
yes
yes
no
no
yes
yes
yes
yes
no
no
no
yes
no
yes
no
no
no
no
no
no
yes
yes
no
yes
no
yes
no
yes
no
yes
yes
yes
yes
yes
no
no
no
yes
no
no
yes
yes
no
yes
yes
no
yes
no
no
no
yes
yes
no
no
yes
yes
no
no
yes
yes
yes
no
yes
no
yes
yes
no
yes
no
yes
yes
ye...

result:

ok 50051 lines

Test #8:

score: 0
Accepted
time: 22ms
memory: 11972kb

input:

100000
94147 79843
53985 71564
79961 67070
72880 52876
2252 27415
91697 86975
72573 10059
72305 17475
18662 71230
33774 42420
56852 29399
36038 36439
8477 17355
97914 70221
98708 98346
45945 37265
43832 93672
92496 6891
45052 6628
16114 32965
17367 77028
36696 91118
76854 89492
47805 19621
40121 738...

output:

yes
yes
yes
no
no
no
no
yes
yes
no
no
yes
yes
yes
yes
no
no
yes
yes
yes
yes
no
no
yes
no
no
yes
yes
no
no
no
yes
yes
yes
no
no
yes
no
no
yes
yes
yes
yes
yes
no
no
yes
no
yes
yes
no
yes
no
no
yes
yes
no
no
no
yes
yes
yes
yes
yes
no
yes
yes
no
yes
yes
no
no
yes
no
no
no
yes
yes
yes
yes
no
no
no
no
no
...

result:

ok 49844 lines

Test #9:

score: 0
Accepted
time: 12ms
memory: 12268kb

input:

100000
55390 30433
53142 28334
22002 51401
95814 47775
57346 10693
16318 87575
12748 64139
20574 81532
73650 24804
13514 43836
20336 9973
70368 62542
3373 76070
25594 79182
92921 8654
86317 98006
76567 19851
42041 90271
45236 75310
41847 26620
3338 13024
35228 67826
75616 65814
15704 78413
82166 377...

output:

no
no
no
no
no
no
yes
no
yes
no
no
no
yes
yes
yes
yes
no
yes
no
yes
no
no
yes
yes
yes
yes
no
no
no
no
yes
no
no
yes
yes
yes
no
no
yes
yes
no
yes
no
no
no
yes
no
yes
no
no
no
yes
yes
no
no
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
yes
no
yes
yes
yes
no
yes
yes
yes
yes
yes
no
no
yes...

result:

ok 50023 lines

Test #10:

score: 0
Accepted
time: 17ms
memory: 12216kb

input:

100000
36174 77832
78263 33563
2189 84447
2358 11475
69787 11597
83018 9383
41772 40978
5813 4406
23897 20145
65440 55385
12244 76207
35245 34688
25004 48172
86611 68230
25733 92441
71872 36924
13358 40191
86957 6122
56443 25064
64542 13824
51086 39308
25653 51801
14197 64998
60972 83415
16610 87415...

output:

yes
no
yes
yes
no
yes
no
no
yes
no
yes
yes
no
no
yes
yes
no
no
yes
no
no
yes
yes
yes
yes
yes
yes
no
no
no
no
no
yes
yes
yes
no
no
no
yes
yes
yes
no
yes
yes
no
no
yes
no
no
yes
no
yes
no
yes
yes
no
no
yes
yes
yes
yes
yes
yes
no
no
no
no
no
no
no
no
no
yes
yes
no
yes
yes
no
yes
no
no
yes
yes
yes
no
no...

result:

ok 49948 lines

Test #11:

score: 0
Accepted
time: 10ms
memory: 12100kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
no
no
no
no
no
no
yes
no
yes
yes
yes
no
yes
yes
yes
no
yes
no
no
yes
no
yes
yes
no
yes
yes
yes
no
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
no
no
yes
no
no
no
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
no
yes
yes
no
yes
yes
yes
yes
yes
no
yes
no...

result:

ok 98586 lines

Test #12:

score: 0
Accepted
time: 13ms
memory: 10440kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

no
yes
no
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
no
yes
yes
no
yes
yes
no
no
no
yes
yes
yes
no
no
yes
no
no
yes
no
yes
yes
yes
yes
yes
yes
no
yes
yes
no
no
yes
yes
yes
no
yes
yes
yes
no
yes
no
yes
yes
no
no
yes
yes
yes
yes
no
no
yes
no
yes
no
no
yes
yes
no
yes
yes
no
yes
yes
yes
yes
yes
yes
y...

result:

ok 98586 lines

Test #13:

score: 0
Accepted
time: 19ms
memory: 10576kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

no
yes
no
yes
no
yes
yes
yes
no
no
no
no
yes
yes
no
yes
yes
no
yes
no
yes
yes
yes
no
yes
yes
yes
yes
yes
no
yes
yes
no
yes
no
no
yes
no
yes
no
yes
no
yes
yes
yes
yes
no
yes
yes
no
yes
yes
yes
yes
no
no
no
no
no
no
yes
no
yes
no
yes
no
no
yes
yes
no
no
no
yes
yes
yes
yes
yes
yes
yes
no
no
yes
yes
no
...

result:

ok 98586 lines

Test #14:

score: 0
Accepted
time: 21ms
memory: 10472kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

no
yes
no
no
no
yes
no
yes
yes
no
yes
yes
yes
no
no
no
yes
yes
no
no
no
yes
no
yes
yes
yes
no
yes
yes
yes
no
no
yes
no
yes
no
yes
no
yes
no
no
yes
yes
no
yes
yes
yes
no
yes
yes
yes
no
yes
yes
yes
yes
no
no
no
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
no
yes
yes
yes
yes
yes
no
yes
no
yes
no
ye...

result:

ok 98586 lines

Test #15:

score: 0
Accepted
time: 13ms
memory: 12068kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

yes
yes
yes
yes
yes
no
yes
no
no
yes
yes
yes
no
no
no
no
yes
yes
yes
no
yes
yes
no
no
no
yes
no
yes
no
no
no
no
no
yes
yes
no
no
yes
yes
yes
no
no
yes
no
no
yes
no
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
no
no
no
no
no
yes
yes
yes
yes
no
yes
yes
yes
no
yes
no
no
no
no
no
yes
yes
no
no
...

result:

ok 98586 lines

Test #16:

score: 0
Accepted
time: 11ms
memory: 11968kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

no
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
no
no
no
yes
yes
yes
yes
no
yes
no
no
yes
no
yes
no
yes
no
no
no
yes
yes
no
yes
no
no
no
yes
no
no
yes
yes
no
yes
no
no
yes
yes
yes
no
no
yes
yes
yes
no
yes
yes
no
yes
no
yes
yes
yes
yes
yes
no
yes
yes
yes
no
no
yes
no
no
yes
y...

result:

ok 98586 lines

Test #17:

score: 0
Accepted
time: 17ms
memory: 10252kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

no
yes
yes
no
yes
no
yes
yes
no
yes
no
yes
yes
no
yes
no
no
no
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
no
no
no
no
yes
yes
no
yes
no
yes
yes
yes
yes
yes
no
yes
yes
no
no
no
no
yes
yes
yes
yes
no
yes
no
no
no
yes
no
no
yes
yes
yes
yes
yes
yes
no
no
no
yes
yes
no
no
no
yes
no
yes
...

result:

ok 98586 lines

Test #18:

score: 0
Accepted
time: 12ms
memory: 12068kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

no
no
no
no
no
yes
yes
no
no
yes
yes
no
yes
yes
yes
no
yes
no
no
yes
yes
yes
no
yes
yes
yes
yes
yes
no
no
yes
no
no
yes
no
no
no
yes
no
yes
yes
no
no
no
no
yes
yes
yes
no
no
yes
no
yes
yes
yes
no
no
yes
no
yes
yes
no
no
yes
no
yes
yes
yes
yes
yes
yes
yes
no
no
no
no
yes
yes
yes
no
yes
yes
yes
no
no
...

result:

ok 98586 lines

Test #19:

score: 0
Accepted
time: 24ms
memory: 12100kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

yes
no
yes
yes
no
no
yes
yes
yes
yes
no
yes
yes
yes
yes
no
yes
yes
yes
no
yes
yes
yes
yes
no
yes
yes
no
yes
yes
yes
yes
no
no
yes
no
no
no
no
yes
yes
no
yes
yes
no
no
no
no
no
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
no
yes
no
yes
yes
yes
yes
yes
yes
no
yes
no
yes
no
yes
no
yes
yes
no
no
yes
no
no
yes...

result:

ok 98586 lines

Test #20:

score: 0
Accepted
time: 10ms
memory: 12088kb

input:

1414
2 1000000
3 999999
4 999997
5 999994
6 999990
7 999985
8 999979
9 999972
10 999964
11 999955
12 999945
13 999934
14 999922
15 999909
16 999895
17 999880
18 999864
19 999847
20 999829
21 999810
22 999790
23 999769
24 999747
25 999724
26 999700
27 999675
28 999649
29 999622
30 999594
31 999565
32...

output:

yes
no
no
yes
no
yes
yes
yes
yes
yes
yes
no
no
yes
no
no
yes
no
no
no
no
no
yes
yes
no
no
yes
yes
no
yes
yes
no
yes
yes
no
no
yes
no
yes
no
yes
yes
yes
no
no
no
yes
yes
yes
yes
no
yes
yes
yes
no
no
no
no
yes
yes
no
yes
yes
yes
yes
no
no
no
no
yes
yes
yes
no
no
no
no
yes
no
yes
yes
yes
yes
yes
no
no
...

result:

ok 98586 lines

Test #21:

score: 0
Accepted
time: 72ms
memory: 12632kb

input:

188608
875370 411180
441632 856111
640141 695970
166430 979502
123602 988617
939162 287455
942390 279717
780259 544911
347159 911285
39564 998680
933172 301312
935544 295899
483205 827514
63224 996898
999142 30818
241750 956940
596199 736592
688666 647729
900347 367860
648888 687550
795435 525896
85...

output:

no
no
no
yes
yes
yes
yes
yes
yes
yes
no
yes
no
yes
yes
yes
yes
yes
yes
yes
no
no
yes
yes
no
no
no
yes
yes
yes
no
yes
no
yes
yes
no
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
no
no
yes
no
yes
yes
yes
yes
no
yes
yes
yes
yes
no
no
no
no
no
yes
yes
no
no
yes
no
no
no
yes
yes
yes
yes
no
ye...

result:

ok 50000 lines

Test #22:

score: 0
Accepted
time: 79ms
memory: 13344kb

input:

188608
174574 977466
6133 999810
815825 499192
270738 946032
764441 564028
836746 470216
954232 249240
214481 966061
534239 788857
486373 825227
969664 202751
560964 767006
879430 404477
598261 734749
947577 266793
102817 992069
46731 998230
705605 630004
446812 852685
118270 989577
515479 803520
99...

output:

yes
no
yes
yes
yes
yes
yes
yes
no
no
no
yes
no
yes
yes
yes
no
no
yes
no
yes
no
no
yes
yes
yes
no
yes
yes
no
yes
yes
yes
no
yes
yes
yes
no
yes
yes
no
yes
no
no
yes
yes
yes
yes
yes
yes
yes
no
no
no
no
yes
no
yes
yes
yes
yes
no
yes
yes
yes
no
yes
yes
yes
no
no
no
no
no
no
yes
yes
yes
yes
no
yes
yes
yes...

result:

ok 50000 lines

Test #23:

score: 0
Accepted
time: 79ms
memory: 12700kb

input:

188608
145953 984198
92845 993508
995411 77637
7002 999806
405952 878544
6428 999805
996140 71027
180314 975980
987750 128297
999041 32958
187847 973941
440161 857061
200629 970287
936069 294692
729464 604136
6907 999804
739070 593390
980687 161529
790409 532266
829531 480399
813875 501813
484048 82...

output:

no
no
yes
no
no
yes
yes
no
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
no
no
yes
yes
no
no
no
yes
yes
no
yes
yes
no
no
no
yes
no
yes
no
yes
no
yes
yes
yes
no
yes
no
yes
no
no
yes
yes
yes
yes
no
yes
no
yes
no
yes
yes
no
yes
no
no
yes
yes
yes
no
yes
no...

result:

ok 50000 lines

Test #24:

score: 0
Accepted
time: 76ms
memory: 12928kb

input:

188608
714942 620009
783160 541320
746831 584574
897690 372718
965239 217121
199603 970591
779933 545303
976053 180033
727130 606718
487894 824145
947335 267424
996295 69457
998654 40101
782531 542119
365261 901774
54084 997695
846641 455836
670070 666661
999485 21618
100631 992410
678851 657798
999...

output:

yes
no
yes
no
yes
no
yes
yes
no
yes
no
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
yes
yes
no
yes
no
no
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
no
no
yes
yes
yes
no
yes
yes
no
no
yes
yes
yes
yes
yes
no
no
no
no
yes
no
no
yes
no
yes
yes
no
no
yes
no
yes
no
no
no
yes
no
yes
no
yes
yes
...

result:

ok 50000 lines

Test #25:

score: 0
Accepted
time: 95ms
memory: 13172kb

input:

188608
439931 857208
911041 347632
793727 528064
827581 483119
383220 891822
687317 649128
676621 660045
855351 442769
998376 44564
590571 741575
833433 474924
562344 765851
231515 960490
85199 994511
318889 925160
482965 827690
989457 118872
675246 661441
599056 734038
949326 262300
485629 825784
5...

output:

yes
yes
yes
yes
no
yes
yes
no
yes
no
yes
no
yes
yes
no
yes
yes
no
yes
yes
yes
yes
yes
yes
no
no
yes
yes
yes
yes
yes
yes
no
yes
no
yes
no
no
yes
no
no
no
no
yes
yes
yes
yes
yes
yes
no
no
no
no
no
yes
yes
no
no
yes
yes
yes
no
no
yes
yes
yes
yes
no
yes
no
yes
yes
no
no
yes
yes
yes
no
yes
no
no
no
no
ye...

result:

ok 50000 lines

Test #26:

score: 0
Accepted
time: 84ms
memory: 13204kb

input:

188608
845752 457151
740657 591611
817775 496576
140309 985388
421079 869255
371142 898563
825774 485619
863602 430056
48447 998107
236704 958717
678018 658642
997298 58859
184191 974942
999314 26567
362889 903040
399123 882615
37788 998788
58385 997340
954326 248968
984355 145202
433745 861240
9979...

output:

no
yes
yes
no
yes
yes
no
yes
no
yes
no
yes
no
yes
no
yes
yes
no
no
yes
yes
no
no
yes
yes
no
yes
yes
yes
yes
yes
yes
no
yes
no
no
yes
yes
yes
no
no
no
yes
yes
no
no
yes
yes
no
no
yes
yes
no
no
yes
no
yes
yes
no
yes
yes
no
no
yes
yes
yes
yes
no
yes
no
no
no
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
y...

result:

ok 50000 lines

Test #27:

score: 0
Accepted
time: 81ms
memory: 12388kb

input:

188608
880626 402465
898043 372080
85196 994508
969805 202268
147771 983807
394739 885181
132701 986915
997255 59278
239196 957838
907289 354864
999395 24414
998568 41638
947324 267452
309351 929580
622966 712203
859084 437065
304782 931632
939397 286908
60516 997146
992050 103019
824009 488067
5163...

output:

yes
no
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
no
yes
no
yes
yes
yes
no
yes
no
yes
yes
yes
yes
no
yes
yes
yes
yes
no
no
yes
yes
no
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
no
no
yes
yes
yes
yes
yes
yes
yes
no
no
yes
no
yes
yes
yes
no
yes
yes
yes
no
no
yes
yes
yes
yes
yes
yes
no
no
yes
no...

result:

ok 50000 lines

Test #28:

score: 0
Accepted
time: 87ms
memory: 12592kb

input:

188608
221961 963679
999734 11372
175349 977272
103709 991935
990695 111558
997835 52263
993315 94221
23386 999429
959707 233803
30144 999168
964829 218366
564031 764444
94345 993299
999671 14760
848439 453157
375584 896116
211548 966980
537914 785920
241847 956892
855134 443124
497352 817192
56933 ...

output:

no
yes
no
yes
no
yes
yes
no
no
yes
yes
no
yes
yes
yes
no
yes
yes
no
yes
yes
yes
yes
no
no
yes
no
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
no
yes
yes
yes
no
yes
no
yes
yes
no
yes
no
no
no
yes
no
no
yes
no
yes
yes
no
yes
no
yes
yes
no
yes
yes
no
no
yes
yes
yes
no
yes
yes
yes
no
yes
no
yes...

result:

ok 50000 lines

Test #29:

score: 0
Accepted
time: 88ms
memory: 12936kb

input:

188608
410046 876057
999808 6029
995375 77893
501565 814062
126203 988139
672926 663790
51589 997882
86738 994306
201377 970078
888901 388344
968331 207202
65334 996698
832819 475785
986486 134896
699666 636292
829447 480538
829346 480648
120741 989131
755214 574897
362337 903342
561780 766326
25146...

output:

yes
yes
yes
no
yes
yes
yes
no
yes
yes
yes
yes
yes
no
no
no
yes
yes
yes
yes
yes
no
yes
no
yes
yes
no
no
no
yes
no
yes
no
yes
yes
no
no
no
no
yes
no
yes
no
yes
no
no
no
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
no
no
no
yes
no
yes
yes
no
no
no
yes
yes
yes
yes
yes
no
yes
yes
yes
no
yes
no
yes
...

result:

ok 50000 lines

Test #30:

score: 0
Accepted
time: 83ms
memory: 12668kb

input:

188608
876447 409433
997607 55155
368160 900193
353426 908058
965064 217632
850873 449532
301550 933084
897481 373125
111505 990706
737716 594929
598365 734639
770003 557390
180953 975798
113080 990456
749606 581375
933916 299629
469904 836959
908927 351730
11970 999737
179837 976106
729255 604378
7...

output:

yes
yes
yes
no
yes
yes
yes
yes
yes
no
yes
yes
no
yes
no
yes
yes
yes
yes
yes
no
yes
yes
yes
no
yes
yes
yes
yes
no
no
no
yes
yes
yes
no
yes
no
yes
yes
yes
yes
yes
no
yes
yes
no
no
yes
no
yes
yes
yes
yes
yes
no
no
yes
yes
no
no
no
yes
no
yes
no
no
yes
yes
no
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
no
no...

result:

ok 50000 lines

Test #31:

score: 0
Accepted
time: 157ms
memory: 27852kb

input:

200000
2 99999893
693 99999892
2760 99999889
3447 99999888
4818 99999886
5502 99999885
8228 99999881
9585 99999879
10938 99999877
12287 99999875
12960 99999874
13632 99999873
14303 99999872
15642 99999870
16310 99999869
17643 99999867
18308 99999866
19635 99999864
22277 99999860
22935 99999859
23592...

output:

no
no
yes
no
no
no
no
no
yes
no
no
yes
yes
no
no
no
no
no
yes
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no...

result:

ok 50000 lines

Test #32:

score: 0
Accepted
time: 147ms
memory: 27148kb

input:

200000
693 99999892
2072 99999890
3447 99999888
4818 99999886
5502 99999885
6185 99999884
6867 99999883
8228 99999881
8907 99999880
9585 99999879
10262 99999878
10938 99999877
11613 99999876
12287 99999875
13632 99999873
14303 99999872
14973 99999871
15642 99999870
16310 99999869
17643 99999867
1830...

output:

no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
yes
no
no
no
no
no
yes
no
no
yes
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
yes
no
no
no
no
no...

result:

ok 20000 lines

Test #33:

score: 0
Accepted
time: 149ms
memory: 27672kb

input:

200000
1 99999893
1383 99999891
2072 99999890
2760 99999889
3447 99999888
4133 99999887
4818 99999886
5502 99999885
6867 99999883
8907 99999880
9585 99999879
10938 99999877
12287 99999875
14303 99999872
14973 99999871
16310 99999869
16977 99999868
18308 99999866
18972 99999865
20297 99999863
21618 9...

output:

no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
yes
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
yes
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
n...

result:

ok 10000 lines

Test #34:

score: 0
Accepted
time: 128ms
memory: 27100kb

input:

200000
1 99999893
693 99999892
2072 99999890
2760 99999889
3447 99999888
4133 99999887
4818 99999886
6867 99999883
8228 99999881
9585 99999879
10262 99999878
10938 99999877
11613 99999876
12960 99999874
13632 99999873
14303 99999872
14973 99999871
15642 99999870
16310 99999869
17643 99999867
18972 9...

output:

yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
yes
no
no
no
yes
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
yes
no
yes
no
yes
no
no
no
no
no
no
no
no
no
no
n...

result:

ok 1000 lines

Test #35:

score: 0
Accepted
time: 135ms
memory: 28188kb

input:

200000
1 99999893
2 99999893
693 99999892
1383 99999891
2760 99999889
3447 99999888
4133 99999887
4818 99999886
5502 99999885
6867 99999883
7548 99999882
8228 99999881
10262 99999878
10938 99999877
14303 99999872
15642 99999870
16310 99999869
16977 99999868
18308 99999866
18972 99999865
20297 999998...

output:

no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
yes
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
yes
no
no
yes
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
yes
no...

result:

ok 100 lines

Test #36:

score: 0
Accepted
time: 118ms
memory: 27888kb

input:

200000
1 99999893
693 99999892
1383 99999891
4818 99999886
6185 99999884
8228 99999881
8907 99999880
9585 99999879
10262 99999878
10938 99999877
13632 99999873
14303 99999872
16977 99999868
17643 99999867
18308 99999866
18972 99999865
19635 99999864
20297 99999863
20958 99999862
21618 99999861
22935...

output:

no
no
no
no
yes
no
no
no
no
no

result:

ok 10 lines

Test #37:

score: 0
Accepted
time: 119ms
memory: 27688kb

input:

200000
1 99999893
2 99999893
2760 99999889
3447 99999888
4133 99999887
7548 99999882
8228 99999881
8907 99999880
9585 99999879
10262 99999878
11613 99999876
12960 99999874
14303 99999872
15642 99999870
16310 99999869
18308 99999866
20297 99999863
20958 99999862
21618 99999861
22935 99999859
23592 99...

output:

no

result:

ok single line: 'no'

Test #38:

score: 0
Accepted
time: 5ms
memory: 11800kb

input:

2
1 26
2 1
2
c 37 55 563
c 38 55 563

output:

yes
no

result:

ok 2 lines

Test #39:

score: 0
Accepted
time: 0ms
memory: 11764kb

input:

2
1 167
29 1
2
c 87 2524 254
c 88 2524 254

output:

yes
no

result:

ok 2 lines

Test #40:

score: 0
Accepted
time: 4ms
memory: 9808kb

input:

2
886025 85546065
66273964 147154
10
c 60 34750720 47778265
c 65 59534508 44022788
c 52 70555649 48639288
c 55 92185557 5987261
c 99 14324519 90752444
c 39 86619940 97587245
c 46 63010899 16434955
c 33 60240274 55231037
c 33 97616024 12426367
c 53 91316502 62763558

output:

no
no
no
no
no
no
no
no
no
no

result:

ok 10 lines

Test #41:

score: 0
Accepted
time: 2ms
memory: 11788kb

input:

2
176910 20170532
82430415 370908
10
c 83 43728493 45859312
c 81 38125464 94387714
c 54 93203585 4859221
c 27 12654197 58040335
c 41 53414673 320336
c 8 25532497 19600569
c 42 97887717 94318181
c 56 69058936 58381565
c 45 3925353 88851139
c 96 61953511 23308735

output:

no
no
no
no
no
no
no
no
no
no

result:

ok 10 lines