QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#832351#8908. Яблоки по корзинамFesdrer100 ✓166ms8420kbC++171.5kb2024-12-25 20:42:562024-12-25 20:42:56

Judging History

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

  • [2024-12-25 20:42:56]
  • 评测
  • 测评结果:100
  • 用时:166ms
  • 内存:8420kb
  • [2024-12-25 20:42:56]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using i64=long long;
const int N=3e5+5;
const i64 INF=1e18;
int n,q,z;
i64 a[N],sum[N],num0;
struct Node{i64 x,y;i64 ty(){return y-x;}};
vector<Node> s;
void init(){
	int st=1;num0=INF;
	while(st<=n&&2*a[st]<sum[st-1]+3)	st++;
	if(st==n+1)	return;
	if(sum[st-1]-a[st]+1<0){
		s.push_back((Node){0,sum[st-1]}),num0=sum[st-1];
		return;
	}
	s.push_back((Node){sum[st-1]-a[st]+1,sum[st-1]});
	for(int i=st+1;i<=n;i++){
		if(a[i]>=sum[i-1]-s.back().x+2){
			if(sum[i-1]-a[i]+1<0){
				s.push_back((Node){0,sum[i-1]}),num0=sum[i-1];
				return;
			}
			else	s.push_back((Node){sum[i-1]-a[i]+1,sum[i-1]});
		}
	}
}
bool solve(i64 kk,i64 x,i64 y){
	int k=upper_bound(a+1,a+n+1,kk)-a-1;
	if(x>y)	swap(x,y);
	if(x==0)	return y<=min(num0,sum[k]);
	int endid=upper_bound(s.begin(),s.end(),(Node){0,sum[k]},
		[&](const Node &x,const Node &y){return x.y<y.y;})-s.begin();
	int id=upper_bound(s.begin(),s.begin()+endid,(Node){x,0},
		[&](const Node &x,const Node &y){return x.x>y.x;})-s.begin();
	if(id==endid)	return y<=sum[k]-x;
	return y<=s[id].ty()-(x-s[id].x);
}
int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin>>n>>q;
	for(int i=1;i<=n;i++)	cin>>a[i];
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++)	sum[i]=a[i]+sum[i-1];
	init();
	cin>>z;
	i64 anscnt=0;
	for(int _=1;_<=q;_++){
		i64 k,x,y;
		cin>>k>>x>>y;
		k-=anscnt*z,x-=anscnt*z,y-=anscnt*z;
		if(solve(k,x,y))	anscnt+=_,cout<<"Yes\n";
		else	cout<<"No\n";
	}
	return 0;
}

詳細信息

Subtask #1:

score: 9
Accepted

Test #1:

score: 9
Accepted
time: 1ms
memory: 5704kb

input:

10 10
29 1 11 5 2 48 1 3 3 34
0
1 1 1
7 2 4
11 3 1
7 474806183402 402698617390
33 11 9
4 6 12
1 381289675359 214925415209
185155993984802945 938648034 198717259526
3 392824146657 607496224237
376222456758244760 12 15

output:

Yes
Yes
Yes
No
No
No
No
No
No
No

result:

ok 10 token(s): yes count is 3, no count is 7

Test #2:

score: 9
Accepted
time: 1ms
memory: 5756kb

input:

10 10
5 24 30 10 1 1 3 1 2 1
0
3 8 0
3 495612370552 92914514259
0 0 0
5 18 10
0 0 0
0 0 0
0 0 0
3 349560494250 974680644611
4 4 0
26 403289572581 640544723444

output:

Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No

result:

ok 10 token(s): yes count is 6, no count is 4

Test #3:

score: 9
Accepted
time: 1ms
memory: 5708kb

input:

10 10
1 1 1 1 2 1 1 3 3 1
0
1 7 6
1 442476885652 309995768094
1 261016119655 768884465441
1 9 5
1 3 1
2 9 4
1 314252593183 582851158743
1 991424319093 825593682835
1 5 1
1 515214410209 615318691137

output:

No
No
No
No
Yes
No
No
No
Yes
No

result:

ok 10 token(s): yes count is 2, no count is 8

Test #4:

score: 9
Accepted
time: 1ms
memory: 5776kb

input:

10 10
11 2 1 1 40 1 1 25 3 5
0
4 0 7
1 4 1
7 1 14
1 4 1
33 24 2
1 3 3
2 6 1
1 69 19
2 0 5
1 32 25

output:

Yes
No
No
No
No
No
No
No
Yes
No

result:

ok 10 token(s): yes count is 2, no count is 8

Test #5:

score: 9
Accepted
time: 1ms
memory: 5688kb

input:

10 10
32 4 13 1 1 2 5 5 3 62
0
37 63 1
4 11 0
3 5 0
3 26 57
3 3 6
0 1 0
0 0 1
3 24 74
0 2 0
3 7 2

output:

Yes
Yes
Yes
No
No
No
No
No
No
No

result:

ok 10 token(s): yes count is 3, no count is 7

Test #6:

score: 9
Accepted
time: 1ms
memory: 5700kb

input:

10 10
1 1 3 1 2 1 3 1 1 1
0
2 0 9
2 1 9
2 0 10
2 11 0
2 9 1
2 6 4
2 2 8
2 2 8
488054629211857911 6 9
2 4 6

output:

Yes
No
No
No
No
No
No
No
Yes
No

result:

ok 10 token(s): yes count is 2, no count is 8

Test #7:

score: 9
Accepted
time: 1ms
memory: 5684kb

input:

10 10
29 1 11 5 2 48 1 3 3 34
0
30 26 0
1 96 43
39 7 10
0 0 2
1 1 2
3 4 6
2 1 3
0 1 0
2 0 3
0 0 0

output:

Yes
No
No
No
No
Yes
Yes
No
Yes
Yes

result:

ok 10 token(s): yes count is 5, no count is 5

Test #8:

score: 9
Accepted
time: 1ms
memory: 5700kb

input:

10 10
5 24 30 10 1 1 3 1 2 1
0
2 0 6
2 0 7
0 0 0
28 0 23
433901037994672569 77 1
2 1 5
337468024409031829 19 5
2 1 5
2 5 0
2 28 29

output:

Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No

result:

ok 10 token(s): yes count is 8, no count is 2

Test #9:

score: 9
Accepted
time: 1ms
memory: 5640kb

input:

10 10
1 1 1 1 2 1 1 3 3 1
0
0 2 0
0 3 0
0 0 8
0 4 0
323648449030956491 5 10
0 0 3
316521079352084537 6 10
2 10 0
0 0 2
0 0 0

output:

No
No
No
No
Yes
No
No
No
No
Yes

result:

ok 10 token(s): yes count is 2, no count is 8

Test #10:

score: 9
Accepted
time: 1ms
memory: 5644kb

input:

10 10
29 1 11 5 2 48 1 3 3 34
0
1 1 1
1 0 2
1 588468908706 369984748605
8 14 0
7 888680396610 537158373236
1 0 2
1 106998823490 927322317897
1 2 2
9 818234776303 467027909096
29 10 7

output:

Yes
Yes
No
Yes
No
Yes
No
No
No
No

result:

ok 10 token(s): yes count is 4, no count is 6

Test #11:

score: 9
Accepted
time: 1ms
memory: 5736kb

input:

10 10
5 24 30 10 1 1 3 1 2 1
0
367052111828626923 20 3
0 0 0
1 2 4
27 98314360001 537188804313
0 0 1
281924945782239868 0 22
0 1 0
29 49745566226 973770594354
256526835801997286 23 2
2 1 2

output:

Yes
Yes
No
No
No
Yes
No
No
No
Yes

result:

ok 10 token(s): yes count is 4, no count is 6

Test #12:

score: 9
Accepted
time: 1ms
memory: 5644kb

input:

10 10
1 1 1 1 2 1 1 3 3 1
0
0 691483532824 688839640789
2 98111337069 594849571592
0 0 0
2 6 11
2 158484274058 293835133240
0 0 0
361120138249048961 636537708086 947938756921
2 7 9
0 2 0
0 0 1

output:

No
No
Yes
No
No
Yes
No
No
No
No

result:

ok 10 token(s): yes count is 2, no count is 8

Subtask #2:

score: 6
Accepted

Test #13:

score: 6
Accepted
time: 57ms
memory: 5736kb

input:

100 300000
52783 3774 52984 939 32 2 2 33 73819 52875 99903 29 2 47 30 53369 2 52846 99900 2 52804 52752 34 35 2 52756 1 26375 31 53165 52755 34 1882 56287 3767 40 53236 64681 3766 99900 52754 52754 99900 52754 2 44 99935 52752 4 3766 27 68268 33 52753 52765 6 99900 2 52754 52771 52753 52761 52754 3...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #14:

score: 6
Accepted
time: 58ms
memory: 5656kb

input:

100 300000
1 460 269 99900 241 241 1 1 99900 1 240 258 1 1 99900 261 1 289 288 1 1 1 1 278 1 1 4 1 1 99911 99901 1 99935 99927 99904 1 1 1 1 242 1 99920 1 1 1 24702 241 1 99905 99914 24701 1 1 12349 99941 1 1 24700 2 119 240 1 99909 99909 1 60 99912 1 1 262 1 381 1 99902 29 1 276 1 1 6173 99908 242 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #15:

score: 6
Accepted
time: 54ms
memory: 5712kb

input:

100 300000
15 14 24 20 21 17 20 14 15 14 14 20 14 14 14 18 14 15 17 18 16 15 14 23 14 26 22 16 15 14 15 17 24 14 21 16 1 18 23 14 22 27 15 16 18 19 16 18 14 14 14 25 15 15 18 14 20 17 20 21 22 18 14 18 18 14 15 15 15 27 22 14 26 14 20 25 19 16 16 14 17 16 20 14 19 4 25 16 19 15 16 15 25 14 22 18 7 1...

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
Yes
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
No
No
Yes
...

result:

ok 300000 token(s): yes count is 6650, no count is 293350

Test #16:

score: 6
Accepted
time: 50ms
memory: 5644kb

input:

100 300000
99900 6 1 6 99900 671 4 1 7 778 99900 787 167 5 2 99900 1 4 5 4 4 56307 4 4 1 710 99909 684 5 672 12 99900 4 99900 7 99900 6 6 6 671 674 671 11 99900 671 5 99900 671 6 7 99900 4 4 99900 4 4 5 5 4 671 4 694 708 5 5 5 776 5 12 4 99900 4 4 6 28137 99900 6 7 769 689 5 3 9 4 5 4 8 5 731 4 8 67...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #17:

score: 6
Accepted
time: 50ms
memory: 5640kb

input:

100 300000
41 9244 9246 99915 99957 568 1 561 9309 99990 99900 2 564 13849 9245 41 9302 9330 99903 99900 561 99926 51 41 9246 13108 9325 99908 14678 99904 41 9399 10429 99925 9253 99914 9286 99900 9357 11643 9286 9282 9648 52 9252 11927 99900 9501 9250 9245 9244 16477 4622 5 99904 41 9245 99912 3 99...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #18:

score: 6
Accepted
time: 57ms
memory: 5708kb

input:

100 300000
19 14 14 15 12 13 13 12 14 14 13 12 12 15 12 15 16 12 12 22 12 12 12 20 12 14 17 15 23 14 14 13 14 21 12 12 14 13 18 17 6 12 19 19 17 13 12 3 16 19 14 22 12 12 15 14 12 22 12 15 15 16 17 17 15 16 14 13 12 21 13 16 16 12 22 12 17 17 12 13 13 15 18 14 15 12 1 12 12 12 2 15 15 22 18 16 12 18...

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
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
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
N...

result:

ok 300000 token(s): yes count is 5828, no count is 294172

Test #19:

score: 6
Accepted
time: 57ms
memory: 5652kb

input:

100 300000
2 2 2 2 2 2 2 9900 1 2 337 2 2 9900 2 2 1 2 9900 9900 2 2 2 1 9900 2 2 9920 2 2 9900 2 1 1 2682 9900 2 2 2 2 2 2 332 2 65 2 2681 2 9900 9900 2 2 2 1 1 1340 2686 2 2680 2 2 1 2 1 2 1 2 2 1 1 2 9900 2 2 2 112 2 334 2 2 2 2 2 9900 2 1 2 2 109 9900 9934 9900 1 2 1 2 2 2 2 9900
0
1000000000000...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #20:

score: 6
Accepted
time: 57ms
memory: 5684kb

input:

100 300000
153 149 1 142 1 9908 1 9936 9926 1 9901 1 9906 9914 1 1 6 9909 9902 62 1 1 1 9901 1 9902 1 1 9984 1 127 151 9914 9970 1 1 9906 1 1 9974 1 9919 125 9937 9903 30 1 9969 9970 9941 9926 9919 9900 9950 134 1 9900 206 1 1 9906 9906 1 1 9900 1 9907 1 9909 1 3671 2 1 1833 1 1 1 1 1 1 1 125 1 1 99...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #21:

score: 6
Accepted
time: 57ms
memory: 5648kb

input:

100 300000
7 10 12 8 7 9 10 7 8 7 11 8 11 7 7 7 13 7 10 7 1 10 12 9 7 9 10 1 2 12 8 11 7 8 11 13 8 10 8 8 9 4 7 8 7 13 8 7 7 13 12 13 7 7 7 7 11 11 10 10 10 8 9 13 13 8 7 7 7 9 10 10 9 9 7 8 11 7 12 9 9 8 7 12 11 13 7 7 7 8 8 8 3 8 9 9 12 7 9 10
0
1000000000000000000 77765 0
1000000000000000000 9989...

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
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
...

result:

ok 300000 token(s): yes count is 3635, no count is 296365

Test #22:

score: 6
Accepted
time: 54ms
memory: 5716kb

input:

100 300000
2 1 2 1 900 1 2 2 2 900 2 2 2 2 900 4 2 1 2 2 926 900 2 2 900 2 2 2 900 224 1 2 2 1 2 1 2 2 900 900 2 2 1 900 2 2 2 2 1 2 2 2 2 2 900 2 2 914 2 2 2 900 2 2 2 2 2 2 2 2 2 900 2 1 900 2 1 75 2 1 2 1 2 900 449 75 1 2 2 910 2 2 2 2 2 2 2 2 2 2
0
1000000000000000000 68593 0
1000000000000000000...

output:

No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
Yes
No
No
Yes
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No
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
Yes
Yes
No
No
No
No
No
No
Yes
No
No
No
Yes...

result:

ok 300000 token(s): yes count is 53011, no count is 246989

Test #23:

score: 6
Accepted
time: 55ms
memory: 5764kb

input:

100 300000
899 776 1 1 718 1 1 1 716 717 1 715 1 1 888 759 734 783 1 717 86 716 718 881 1 1 1 1 1 1 716 1 1 1 1 904 1 726 837 1 2 715 722 1 724 811 1 1 729 740 1 1 757 2 1 745 1 1 716 728 715 173 715 1 716 722 1 1 769 794 353 1 1 853 1 26 828 1 3 935 43 883 788 813 746 764 719 1 1 1 1 1 891 715 1 81...

output:

No
No
No
No
Yes
No
No
No
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
Yes
No
No
No
Yes
No
Yes
Yes
No
No
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
No
No...

result:

ok 300000 token(s): yes count is 113380, no count is 186620

Test #24:

score: 6
Accepted
time: 58ms
memory: 5656kb

input:

100 300000
16 20 16 23 26 21 23 17 1 15 22 15 2 16 18 15 16 24 23 15 1 7 22 15 15 16 28 22 17 26 17 28 1 15 16 16 20 22 21 23 18 15 1 16 15 15 19 17 15 15 15 17 29 27 25 16 28 16 18 1 4 16 18 23 16 15 20 16 23 15 1 15 28 23 15 15 21 21 18 15 15 17 18 1 18 16 19 17 17 15 19 15 19 25 21 21 18 15 17 20...

output:

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
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
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
No
No
No
No
No
No
...

result:

ok 300000 token(s): yes count is 6702, no count is 293298

Test #25:

score: 6
Accepted
time: 57ms
memory: 5712kb

input:

100 300000
16 73052 59 92290 7 41 94900 16430 135 45731 62 29 99740 119 99866 111 95393 98372 96858 69391 182 97883 94433 99806 97959 98381 181 191 25 31925 36 56634 34852 99279 194 93106 14 181 90 36 97840 97002 94007 85 28 99842 165 52 50950 77142 98290 74730 175 103 166 60 1 98 155 49 69827 96338...

output:

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
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
No
No
No
N...

result:

ok 300000 token(s): yes count is 31432, no count is 268568

Test #26:

score: 6
Accepted
time: 57ms
memory: 5780kb

input:

100 300000
85853 201 99916 66260 103 8855 139 60703 99475 23 99780 135 66411 55 95738 38 95276 81860 99891 268 72578 176 123 259 98378 133 22476 158 99893 137 71 76614 99976 76263 202 99969 250 21 6643 82 99940 98 97512 112 168 199 238 99400 3 215 30959 150 37838 99784 98115 118 99645 73 2 98408 146...

output:

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
Yes
No
No
Yes
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
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...

result:

ok 300000 token(s): yes count is 23166, no count is 276834

Test #27:

score: 6
Accepted
time: 58ms
memory: 5644kb

input:

100 300000
189 335 315 134 355 324 99 250 25 16 153 20566 144 131 234 131 87 13 326 113 460 394 411 284 177 366 4 309 60 306 423 112 169 238 154 289 352 433 245 5 101 93 199 1 274 54 106 453 425 199 45 420 43902 159 321 402 107 14 96 344 39 85258 144 294 299 257 157 1 284 446 217 322 390 240 122 289...

output:

Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
No
No
No
No
No
No
Yes
No
Yes
Yes
No
No
No
Yes
No
Yes
No
No...

result:

ok 300000 token(s): yes count is 65426, no count is 234574

Subtask #3:

score: 3
Accepted

Dependency #2:

100%
Accepted

Test #28:

score: 3
Accepted
time: 104ms
memory: 8284kb

input:

300000 300000
999999700006 999999770898 999999701005 999999709476 999999700060 999999700000 999999700000 999999700286 999999700000 999999700000 999999700000 999999700000 999999700000 376961301645 999999700000 999999700000 999999700000 999999700000 311 999999700000 999999700000 999999700401 999999700...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #29:

score: 3
Accepted
time: 113ms
memory: 8412kb

input:

300000 300000
999999808789 999999725959 999999703995 999999700037 999999726780 999999823439 999999934001 999999700007 329 999999710902 450 999999848087 999999720586 999999701089 999999701689 999999702917 999999700000 999999700670 999999700002 999999700467 999999700003 999999711998 999999700023 99999...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #30:

score: 3
Accepted
time: 112ms
memory: 8344kb

input:

300000 300000
650787868285 43 650787341596 650790889570 650787341595 650787342336 650787476642 651190477662 650787342840 43 74 650787341631 651345493963 46 47 650789858793 46 650787342037 650787341596 44 66 650788199191 650787342876 650787341646 49 650787342820 650787341838 650787341599 73 659503599...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #31:

score: 3
Accepted
time: 106ms
memory: 8360kb

input:

300000 300000
8002370006 2 2 999999700011 999999700000 9315427108 999999700917 999999700000 2 999999700332 2 999999810729 999999703630 111472 2 999999810383 7631730450 2 2 2 999999706283 7631763195 999999700004 999999700000 7631722240 999999700000 999999700000 999999997760 7634382572 2 999999744930 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #32:

score: 3
Accepted
time: 109ms
memory: 8364kb

input:

300000 300000
999999796951 999999707698 999999700001 999999700097 999999700008 999999700044 999999701282 999999786728 999999991169 999999700023 999999700000 999999700092 999999700036 999999700023 999999700728 999999700014 999999947014 999999700686 999999700000 999999701757 999999835088 999999700003 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #33:

score: 3
Accepted
time: 104ms
memory: 8404kb

input:

300000 300000
6 39325106867 46061146184 7 39325781209 39327615634 57601114407 39453882969 39325087601 7 39325988745 41090773402 40227772410 39325087529 39327366053 39333111980 39325092986 39325787212 45576060206 5 56634443052 39418683084 39358721588 39325094980 39406838334 39325087871 54816862419 39...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #34:

score: 3
Accepted
time: 106ms
memory: 8288kb

input:

300000 300000
398239 751001 690343 292541 288572 12751 542264 600499 99774 1000000000000 999991175043 1000000000000 133547 236506 74871 805949 1000000000000 1000000000000 782688 1000000000000 497831 819549 288216 1000000000000 106065 59281 1000000000000 1000000000000 410012 1000000000000 10000000000...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #35:

score: 3
Accepted
time: 109ms
memory: 8280kb

input:

300000 300000
1320501 920333 1306004 69274 48840 554547 797341 101299 1118390 979306 1131343 5980 1000000000000 900306 1158788 823711 1265895 745834 707645 845900 1326964 380006 1000000000000 862283 288569 512237 597962 941132 1244495 1260251 424636 1239574 1213737 322235 317080 1000000000000 742354...

output:

No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
No
No
Yes
No
No
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No
No
Yes...

result:

ok 300000 token(s): yes count is 135080, no count is 164920

Test #36:

score: 3
Accepted
time: 101ms
memory: 8284kb

input:

300000 300000
1000000000000 1000000000000 169836 517059 268226 1000000000000 1000000000000 397895 585007 1000000000000 626814 1000000000000 1000000000000 340062 137887 797737 16667 708737 1000000000000 1000000000000 1000000000000 1000000000000 518139 1000000000000 337693 66684 12186 464774 650838 78...

output:

Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
No
Yes
No
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
...

result:

ok 300000 token(s): yes count is 134242, no count is 165758

Subtask #4:

score: 6
Accepted

Test #37:

score: 6
Accepted
time: 1ms
memory: 5640kb

input:

100 100
2 2 2 1 1 205 1 200 200 2 55 200 2 2 200 200 2 2 1 1 200 55 2 200 1 2 2 55 2 59 2 2 200 200 2 2 200 1 55 200 2 229 1 2 2 2 2 1 2 200 1 2 2 1 1 2 1 2 2 1 1 2 200 200 1 2 2 200 1 200 2 214 2 200 2 200 200 2 200 1 200 2 2 2 200 1 200 200 200 1 2 1 2 2 2 205 2 2 1 1
0
1000000000000000000 9 299
1...

output:

Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
No
N...

result:

ok 100 token(s): yes count is 81, no count is 19

Test #38:

score: 6
Accepted
time: 1ms
memory: 5684kb

input:

100 100
226 257 3 214 208 269 1 228 210 205 1 273 12 288 207 5 251 203 246 209 225 207 234 200 203 20 2 202 208 113 203 249 213 201 212 202 245 268 200 200 248 201 218 208 227 244 223 245 267 251 200 200 203 205 254 279 248 200 203 200 297 224 229 202 240 202 206 265 262 231 1 14 238 200 247 255 218...

output:

No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Ye...

result:

ok 100 token(s): yes count is 79, no count is 21

Test #39:

score: 6
Accepted
time: 1ms
memory: 5644kb

input:

100 100
21 22 26 22 20 20 27 27 34 29 32 19 19 24 19 1 22 28 27 21 20 24 26 19 21 28 31 21 29 32 27 19 21 23 5 26 21 22 30 28 29 26 21 19 30 25 20 20 19 1 27 20 25 29 29 23 23 24 19 29 19 1 1 19 23 25 21 23 30 1 25 34 24 27 10 20 35 22 31 34 1 20 28 19 19 36 32 19 32 20 22 34 21 31 2 25 20 1 22 19
0...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
...

result:

ok 100 token(s): yes count is 73, no count is 27

Test #40:

score: 6
Accepted
time: 1ms
memory: 5760kb

input:

100 100
201 200 4 200 200 200 200 232 200 4 200 5 3 200 200 200 6 230 202 5 1 6 219 200 4 4 200 5 200 2 6 4 6 200 200 200 200 200 200 200 5 200 4 200 200 4 4 200 4 200 4 200 4 200 200 200 200 200 5 200 200 200 6 4 5 200 6 4 200 200 4 4 200 200 5 4 4 95 200 4 200 4 200 200 4 6 4 95 200 200 98 1 6 200...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 100 token(s): yes count is 100, no count is 0

Test #41:

score: 6
Accepted
time: 1ms
memory: 5724kb

input:

100 100
1 203 206 211 205 1 201 205 242 152 37 12 247 1 203 224 1 238 207 208 203 1 1 240 204 217 275 1 1 206 208 200 204 238 1 204 237 232 200 202 200 1 1 223 1 1 200 247 201 2 271 75 205 226 231 205 205 216 200 202 298 202 252 280 205 201 208 1 206 200 223 207 224 223 1 201 204 228 1 261 288 1 19 ...

output:

Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
...

result:

ok 100 token(s): yes count is 71, no count is 29

Test #42:

score: 6
Accepted
time: 1ms
memory: 5716kb

input:

100 100
18 16 16 17 1 27 18 3 1 16 29 1 18 16 17 17 16 19 16 30 18 16 20 19 18 17 29 24 17 17 17 19 16 16 30 16 30 17 1 2 16 1 18 23 16 22 31 28 18 16 16 18 6 21 26 16 16 17 20 18 24 28 28 16 1 16 16 18 24 20 16 17 16 17 16 18 28 16 23 17 16 24 26 18 1 29 20 19 16 16 20 16 24 16 16 29 22 18 16 25
0
...

output:

Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
N...

result:

ok 100 token(s): yes count is 66, no count is 34

Test #43:

score: 6
Accepted
time: 1ms
memory: 5644kb

input:

100 100
5 2 8 6 5 6 5 1 6 2 4 5 1 210 1 1 200 1 200 8 8 8 2 1 8 1 8 230 1 5 1 7 200 2 3 5 1 3 4 1 4 1 1 200 4 2 6 1 1 5 202 4 7 8 5 5 5 200 3 203 1 1 8 5 2 5 200 7 5 1 1 2 1 222 7 2 1 1 1 2 200 1 8 1 173 8 3 3 1 1 5 2 6 3 5 8 8 5 3 200
0
1000000000000000000 300 300
1000000000000000000 300 300
100000...

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
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

result:

ok 100 token(s): yes count is 0, no count is 100

Test #44:

score: 6
Accepted
time: 1ms
memory: 5644kb

input:

100 100
210 260 207 4 205 258 202 206 253 1 200 296 207 214 200 201 201 254 229 263 204 200 1 268 242 232 209 206 215 250 223 201 246 203 205 221 205 200 26 200 207 200 234 202 261 295 203 239 212 260 252 206 203 26 205 232 13 291 201 231 200 285 200 107 219 204 229 200 218 1 277 203 208 2 265 5 1 2...

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
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

result:

ok 100 token(s): yes count is 0, no count is 100

Test #45:

score: 6
Accepted
time: 1ms
memory: 5632kb

input:

100 100
28 28 29 28 29 28 30 28 28 46 33 45 28 2 31 53 39 46 30 30 31 28 31 31 29 31 1 35 35 32 29 28 1 31 1 31 41 30 6 1 37 35 38 28 28 31 29 41 53 30 36 31 28 28 1 29 1 29 35 28 32 47 33 28 34 45 29 31 28 29 47 30 28 31 30 28 50 1 40 31 41 29 28 28 28 28 29 29 28 28 29 38 28 53 28 28 13 37 28 54
0...

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
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

result:

ok 100 token(s): yes count is 0, no count is 100

Subtask #5:

score: 6
Accepted

Dependency #4:

100%
Accepted

Test #46:

score: 6
Accepted
time: 61ms
memory: 5644kb

input:

100 300000
2 2 2 1 1 205 1 200 200 2 55 200 2 2 200 200 2 2 1 1 200 55 2 200 1 2 2 55 2 59 2 2 200 200 2 2 200 1 55 200 2 229 1 2 2 2 2 1 2 200 1 2 2 1 1 2 1 2 2 1 1 2 200 200 1 2 2 200 1 200 2 214 2 200 2 200 200 2 200 1 200 2 2 2 200 1 200 200 200 1 2 1 2 2 2 205 2 2 1 1
0
1000000000000000000 61 9...

output:

Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Ye...

result:

ok 300000 token(s): yes count is 249984, no count is 50016

Test #47:

score: 6
Accepted
time: 58ms
memory: 5708kb

input:

100 300000
226 257 3 214 208 269 1 228 210 205 1 273 12 288 207 5 251 203 246 209 225 207 234 200 203 20 2 202 208 113 203 249 213 201 212 202 245 268 200 200 248 201 218 208 227 244 223 245 267 251 200 200 203 205 254 279 248 200 203 200 297 224 229 202 240 202 206 265 262 231 1 14 238 200 247 255 ...

output:

Yes
No
Yes
Yes
Yes
No
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
No
Yes
Yes
No
Yes
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
No
Yes
Yes...

result:

ok 300000 token(s): yes count is 156656, no count is 143344

Test #48:

score: 6
Accepted
time: 62ms
memory: 5648kb

input:

100 300000
21 22 26 22 20 20 27 27 34 29 32 19 19 24 19 1 22 28 27 21 20 24 26 19 21 28 31 21 29 32 27 19 21 23 5 26 21 22 30 28 29 26 21 19 30 25 20 20 19 1 27 20 25 29 29 23 23 24 19 29 19 1 1 19 23 25 21 23 30 1 25 34 24 27 10 20 35 22 31 34 1 20 28 19 19 36 32 19 32 20 22 34 21 31 2 25 20 1 22 1...

output:

No
No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
No
Yes
No
No
No...

result:

ok 300000 token(s): yes count is 118187, no count is 181813

Test #49:

score: 6
Accepted
time: 51ms
memory: 5644kb

input:

100 300000
201 200 4 200 200 200 200 232 200 4 200 5 3 200 200 200 6 230 202 5 1 6 219 200 4 4 200 5 200 2 6 4 6 200 200 200 200 200 200 200 5 200 4 200 200 4 4 200 4 200 4 200 4 200 200 200 200 200 5 200 200 200 6 4 5 200 6 4 200 200 4 4 200 200 5 4 4 95 200 4 200 4 200 200 4 6 4 95 200 200 98 1 6 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #50:

score: 6
Accepted
time: 62ms
memory: 5656kb

input:

100 300000
1 203 206 211 205 1 201 205 242 152 37 12 247 1 203 224 1 238 207 208 203 1 1 240 204 217 275 1 1 206 208 200 204 238 1 204 237 232 200 202 200 1 1 223 1 1 200 247 201 2 271 75 205 226 231 205 205 216 200 202 298 202 252 280 205 201 208 1 206 200 223 207 224 223 1 201 204 228 1 261 288 1 ...

output:

Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
No
No
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Y...

result:

ok 300000 token(s): yes count is 156220, no count is 143780

Test #51:

score: 6
Accepted
time: 57ms
memory: 5772kb

input:

100 300000
18 16 16 17 1 27 18 3 1 16 29 1 18 16 17 17 16 19 16 30 18 16 20 19 18 17 29 24 17 17 17 19 16 16 30 16 30 17 1 2 16 1 18 23 16 22 31 28 18 16 16 18 6 21 26 16 16 17 20 18 24 28 28 16 1 16 16 18 24 20 16 17 16 17 16 18 28 16 23 17 16 24 26 18 1 29 20 19 16 16 20 16 24 16 16 29 22 18 16 25...

output:

No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
Yes
Yes
No
No
No
No
No
No
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Y...

result:

ok 300000 token(s): yes count is 78736, no count is 221264

Test #52:

score: 6
Accepted
time: 61ms
memory: 5728kb

input:

100 300000
5 2 8 6 5 6 5 1 6 2 4 5 1 210 1 1 200 1 200 8 8 8 2 1 8 1 8 230 1 5 1 7 200 2 3 5 1 3 4 1 4 1 1 200 4 2 6 1 1 5 202 4 7 8 5 5 5 200 3 203 1 1 8 5 2 5 200 7 5 1 1 2 1 222 7 2 1 1 1 2 200 1 8 1 173 8 3 3 1 1 5 2 6 3 5 8 8 5 3 200
0
1000000000000000000 300 300
1000000000000000000 300 300
100...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #53:

score: 6
Accepted
time: 61ms
memory: 5784kb

input:

100 300000
210 260 207 4 205 258 202 206 253 1 200 296 207 214 200 201 201 254 229 263 204 200 1 268 242 232 209 206 215 250 223 201 246 203 205 221 205 200 26 200 207 200 234 202 261 295 203 239 212 260 252 206 203 26 205 232 13 291 201 231 200 285 200 107 219 204 229 200 218 1 277 203 208 2 265 5 ...

output:

Yes
Yes
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
...

result:

ok 300000 token(s): yes count is 96903, no count is 203097

Test #54:

score: 6
Accepted
time: 58ms
memory: 5652kb

input:

100 300000
28 28 29 28 29 28 30 28 28 46 33 45 28 2 31 53 39 46 30 30 31 28 31 31 29 31 1 35 35 32 29 28 1 31 1 31 41 30 6 1 37 35 38 28 28 31 29 41 53 30 36 31 28 28 1 29 1 29 35 28 32 47 33 28 34 45 29 31 28 29 47 30 28 31 30 28 50 1 40 31 41 29 28 28 28 28 29 29 28 28 29 38 28 53 28 28 13 37 28 5...

output:

No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
No
No
No
No
No
No
No
Yes
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
No
Yes
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
Yes
No
No
No
Yes
...

result:

ok 300000 token(s): yes count is 30229, no count is 269771

Subtask #6:

score: 2
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #55:

score: 2
Accepted
time: 63ms
memory: 5660kb

input:

1500 300000
750 1 764 1 750 895 750 750 1 1 1 1 1 750 851 750 750 750 750 805 1 750 750 901 1 1 750 750 1 1 750 1 754 764 750 1 750 750 750 1 1 750 750 991 750 1 750 756 750 1 750 750 758 750 1 1 1 750 750 919 759 750 1 750 1 1 767 750 750 397 750 1 750 1 1 1 1 1 1 1 1 750 1 1 1 750 1 750 750 1 1 79...

output:

Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
No
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
No
Yes
...

result:

ok 300000 token(s): yes count is 205660, no count is 94340

Test #56:

score: 2
Accepted
time: 55ms
memory: 5720kb

input:

1500 300000
779 1119 753 956 767 803 756 1357 754 825 750 750 838 750 891 820 959 766 1032 754 750 756 768 762 752 1054 757 789 871 904 1030 756 1451 752 754 1404 775 798 1201 802 796 751 1059 756 781 1029 796 778 772 753 750 755 754 770 757 878 762 769 789 920 761 835 753 761 750 895 949 1409 808 7...

output:

No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
No
Yes
No
No
Yes
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
Yes
No
No
Yes
No
Yes
No
No
No
No
Yes
No
No
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
Yes
No
...

result:

ok 300000 token(s): yes count is 74346, no count is 225654

Test #57:

score: 2
Accepted
time: 63ms
memory: 5664kb

input:

1500 300000
16 20 16 27 14 14 23 20 15 16 25 16 23 14 26 25 16 17 17 23 24 16 17 15 14 15 26 16 14 14 14 17 18 14 16 14 26 14 22 20 14 20 17 23 16 16 19 16 15 19 17 14 19 16 23 14 19 14 16 15 20 27 15 15 14 15 16 14 14 15 16 15 23 16 14 23 21 19 24 20 15 18 16 20 21 14 16 14 25 19 15 15 15 1 20 14 1...

output:

No
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
No
No
No
Yes
No
Yes
No
No
No
Yes
No
No
Yes
Yes
Yes
No
No
No
Yes
No
Yes
No
No
No
Yes
Yes
No
Yes
Yes
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
Y...

result:

ok 300000 token(s): yes count is 114205, no count is 185795

Test #58:

score: 2
Accepted
time: 62ms
memory: 5784kb

input:

1500 300000
750 1 1 1 750 6 1 5 1 750 1 5 6 1 1 750 1 750 5 5 1 6 1 1 1 750 750 1 750 750 1 8 750 1 5 750 1 1 750 750 1 1 1 5 5 1 1 1 1 1 1 1 5 6 750 1 1 1 750 1 750 750 6 750 1 1 1 6 1 1 1 1 750 1 750 750 1 6 750 1 1 1 7 750 6 1 1 750 1 1 1 1 1 1 1 7 1 1 1 1 3 5 1 2 5 5 750 1 750 1 1 1 7 1 750 1 1 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #59:

score: 2
Accepted
time: 59ms
memory: 5744kb

input:

1500 300000
767 753 1458 829 849 782 752 1169 816 751 750 897 751 755 1123 768 751 753 809 959 1227 750 789 839 751 1117 767 1108 750 961 772 767 799 750 1144 1066 751 1205 756 1041 754 751 776 750 766 751 1104 750 750 758 757 812 760 1306 790 759 778 750 754 800 788 754 750 751 1426 805 1119 866 11...

output:

No
No
Yes
No
No
Yes
No
Yes
No
No
No
No
Yes
No
No
Yes
Yes
Yes
No
No
No
No
No
No
No
No
No
Yes
No
Yes
Yes
No
Yes
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
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
No
N...

result:

ok 300000 token(s): yes count is 73061, no count is 226939

Test #60:

score: 2
Accepted
time: 61ms
memory: 5728kb

input:

1500 300000
15 11 14 12 11 14 13 14 16 13 11 11 13 11 16 13 12 15 21 16 17 21 13 11 16 11 13 15 17 11 16 14 11 13 13 15 21 15 12 11 12 13 12 16 14 11 11 11 17 11 15 12 12 21 12 11 11 13 19 12 14 15 14 18 12 15 12 11 11 12 14 17 13 11 11 14 20 14 14 11 11 18 11 11 12 14 11 15 13 21 11 11 14 12 12 18 ...

output:

Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
No
Yes
No
Yes
Yes
...

result:

ok 300000 token(s): yes count is 109182, no count is 190818

Test #61:

score: 2
Accepted
time: 58ms
memory: 5720kb

input:

1500 300000
771 750 750 1305 750 750 808 820 750 750 760 750 750 753 882 750 764 750 750 750 750 917 758 750 750 750 763 750 750 750 750 750 750 750 750 750 756 750 750 750 750 750 750 750 750 750 750 750 760 750 750 750 772 750 750 750 750 755 750 750 750 750 29 750 750 750 750 750 750 760 750 750 ...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #62:

score: 2
Accepted
time: 59ms
memory: 5704kb

input:

1500 300000
750 753 837 750 926 750 772 751 753 1138 752 1247 750 753 751 927 770 1309 751 750 755 1033 750 752 842 750 847 761 781 1277 753 126 1127 885 1068 781 752 758 834 755 1176 753 818 752 751 774 784 750 753 876 753 750 1248 759 937 793 752 752 859 1031 880 990 769 750 752 820 802 752 2 766 ...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #63:

score: 2
Accepted
time: 62ms
memory: 5644kb

input:

1500 300000
8 14 11 8 10 8 9 10 8 8 8 12 13 13 14 9 14 11 9 15 8 8 14 11 8 9 8 8 14 10 9 9 15 12 9 8 14 9 12 13 10 11 11 10 14 15 9 10 14 13 13 10 13 12 10 9 9 11 12 14 10 8 13 15 12 8 15 13 13 9 15 12 8 13 14 9 12 8 12 15 9 10 13 8 14 9 8 8 10 14 12 12 9 11 8 10 12 8 8 8 8 8 8 8 15 9 12 9 1 13 15 1...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Subtask #7:

score: 6
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Test #64:

score: 6
Accepted
time: 61ms
memory: 5744kb

input:

5000 300000
990 2500 2500 989 2500 5 2500 1007 1689 2500 993 996 1502 2500 2500 989 2500 1253 994 5 5 992 1337 1045 2500 2500 2500 2500 1002 990 2500 2500 992 2500 2500 2500 1021 1051 1160 989 2500 992 991 1158 989 1291 2500 2500 1019 1310 989 993 1039 1013 1 2500 989 993 1091 2500 1180 2500 2500 5 ...

output:

Yes
Yes
Yes
No
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
No
Yes
No
...

result:

ok 300000 token(s): yes count is 204996, no count is 95004

Test #65:

score: 6
Accepted
time: 62ms
memory: 5684kb

input:

5000 300000
2573 2500 3377 3834 2510 3456 4334 2514 2577 2511 2551 2501 2500 2502 2519 2674 2546 2586 2512 2501 2543 2735 2529 3136 2528 2501 2567 2711 2660 3066 2840 2500 2555 2500 2918 2500 3832 4328 2707 2551 2527 2583 2611 2552 2533 2513 2501 2507 2507 4914 2921 2735 2946 2894 2534 2722 2512 250...

output:

No
No
No
No
No
No
No
No
Yes
Yes
No
Yes
No
Yes
No
No
Yes
No
Yes
No
No
No
Yes
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
Yes
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
Yes
Yes
No
No
Yes
No
No
No
No
No
No
No
...

result:

ok 300000 token(s): yes count is 52000, no count is 248000

Test #66:

score: 6
Accepted
time: 47ms
memory: 5732kb

input:

5000 300000
17 16 18 19 16 25 17 20 15 15 29 17 25 15 29 15 22 17 26 21 28 20 25 15 26 18 25 17 22 20 21 16 24 19 23 15 15 22 28 18 24 18 27 18 16 16 27 20 17 17 15 15 19 18 21 16 17 15 16 18 28 15 17 16 16 15 18 26 24 20 15 29 16 15 15 15 23 15 24 17 18 17 23 19 20 17 27 16 23 15 20 16 16 25 19 16 ...

output:

No
No
Yes
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
No
Yes
No
No
No
No
No
No
Yes
No
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
No
No
No
Yes
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
No
N...

result:

ok 300000 token(s): yes count is 113378, no count is 186622

Test #67:

score: 6
Accepted
time: 62ms
memory: 5676kb

input:

5000 300000
2531 4 7 2 3 2694 4 3784 2511 3 3 4 8 4 3 2 2549 4 2 3 6 3198 3 2500 3 2500 3 2500 2500 2500 3 2503 2534 4 2545 2500 2855 3 2 3 3 2679 2737 3 2576 3 3086 2508 2501 2685 3 4 3 2 2500 2 5 4 3 2500 2 2500 3 3045 3 1 2624 2500 4 2529 3 3 2501 2500 3 3 3 8 3 2611 3 3 2504 4 6 3 2672 4 3 3 413...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 300000, no count is 0

Test #68:

score: 6
Accepted
time: 66ms
memory: 5748kb

input:

5000 300000
2529 2925 4468 2501 3366 2506 2795 2500 2729 2514 3193 2501 2648 2534 2580 2512 2544 2551 2505 2609 192 3308 4859 2504 2780 4843 3213 2541 2507 2678 4384 2560 2520 2504 2518 2651 4450 2696 2545 2531 2526 3516 4718 3582 2500 2508 4087 2505 2972 3085 4294 2501 3767 4942 3042 2501 3026 2538...

output:

No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
Yes
No
Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
No
No
Yes
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
N...

result:

ok 300000 token(s): yes count is 44473, no count is 255527

Test #69:

score: 6
Accepted
time: 64ms
memory: 5684kb

input:

5000 300000
17 28 18 17 25 20 28 18 18 16 28 21 16 27 19 29 19 23 21 18 17 25 17 18 26 21 17 17 21 22 19 20 26 16 16 21 17 17 17 18 16 29 26 19 19 16 17 30 22 19 30 17 16 23 18 17 31 25 16 18 21 27 16 16 26 21 16 18 27 16 16 16 16 26 16 16 20 18 19 17 29 16 24 31 27 16 25 16 24 29 16 16 19 25 17 16 ...

output:

No
Yes
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
No
No
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
No
No
No
No
No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
No
No
Yes
No
No
Yes
No
No
Yes
Yes
No
No
Yes
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
No
No
Yes
No
No
No
No
No
No
Yes
Yes
No
No
No
...

result:

ok 300000 token(s): yes count is 113362, no count is 186638

Test #70:

score: 6
Accepted
time: 54ms
memory: 7740kb

input:

5000 300000
2 2 2500 2 2919 2743 2524 2505 2595 2808 3516 2508 2532 4710 2501 2510 2556 2606 4374 2754 2500 4166 2502 3131 2567 2560 2500 2531 2868 2 2 3255 2500 2501 2888 2513 2510 3115 2544 2501 2674 3089 3890 2504 2693 2502 2 2511 2500 2514 2625 2835 2515 2530 2505 2537 2909 2567 2527 2513 3230 2...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #71:

score: 6
Accepted
time: 52ms
memory: 5744kb

input:

5000 300000
2728 3659 2613 2521 2512 2505 2772 2505 2513 2525 2996 2539 2556 2684 2501 2864 4850 2502 2850 2552 2506 2689 2627 4509 2509 2511 2500 2536 2520 2509 2655 2532 2511 2643 2514 3221 4209 2501 2549 3237 3709 2509 2563 4410 2502 2580 2505 3466 3736 2511 2502 2501 2501 2514 3841 3583 2537 447...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #72:

score: 6
Accepted
time: 59ms
memory: 5748kb

input:

5000 300000
15 14 16 22 18 14 22 27 24 14 20 16 14 14 21 14 14 22 17 17 19 27 14 16 14 15 17 21 14 27 14 26 16 14 25 15 17 19 22 21 23 19 14 17 14 18 21 15 15 16 15 14 14 14 17 25 21 14 14 23 14 23 14 22 18 17 14 17 17 15 23 23 21 25 21 18 14 24 17 26 18 17 14 15 19 26 21 16 23 14 21 17 14 19 14 15 ...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Subtask #8:

score: 2
Accepted

Dependency #2:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Test #73:

score: 2
Accepted
time: 82ms
memory: 8408kb

input:

300000 300000
100000 117510 100000 48 100000 100000 100007 100000 100000 100000 101486 100000 100000 172437 100000 38 100000 103992 100000 100000 100000 100000 100371 100000 100000 100002 100000 100000 100000 100000 102342 100160 100000 47 100007 123867 100000 100029 41 100000 100000 104652 100001 5...

output:

No
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
No
No
No
No
No
Yes
No
Yes
No
Yes
Yes
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
...

result:

ok 300000 token(s): yes count is 135751, no count is 164249

Test #74:

score: 2
Accepted
time: 86ms
memory: 8372kb

input:

300000 300000
100000 100005 100005 119294 100004 193033 101203 120957 100010 115106 100000 100001 100000 164741 100000 100406 101581 100014 100040 103069 101325 113768 100025 100007 100009 100019 100000 100003 100051 100005 100038 104699 102284 100043 101866 195063 100001 100793 100001 100108 100000...

output:

Yes
No
No
No
No
No
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
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
Yes
No
No
No
Yes
No
N...

result:

ok 300000 token(s): yes count is 45156, no count is 254844

Test #75:

score: 2
Accepted
time: 100ms
memory: 8368kb

input:

300000 300000
100011 100324 100043 100016 132586 109078 100051 100711 112035 100060 100553 100000 101265 101900 134175 100009 100017 115239 111746 100029 126717 100031 106384 100004 100023 100804 100029 103586 15 101044 107110 102489 100021 100299 100664 100006 134425 100001 106251 100567 9 9 104957...

output:

Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
No
No
No
No
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes...

result:

ok 300000 token(s): yes count is 200032, no count is 99968

Test #76:

score: 2
Accepted
time: 89ms
memory: 8364kb

input:

300000 300000
100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100179 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000...

output:

No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
No
Yes
No
No
Yes
Yes
Yes
No
No
No
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
No
No
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Y...

result:

ok 300000 token(s): yes count is 190550, no count is 109450

Test #77:

score: 2
Accepted
time: 102ms
memory: 8408kb

input:

300000 300000
108366 100158 159216 100917 133264 100352 195508 100046 100038 100237 107270 123609 100096 100077 140870 100000 100199 100118 101052 100278 105697 100031 100008 102694 100040 100004 100167 100642 100002 100189 100030 100002 150895 152345 102025 100000 100089 100000 100180 157844 100005...

output:

Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
N...

result:

ok 300000 token(s): yes count is 127693, no count is 172307

Test #78:

score: 2
Accepted
time: 97ms
memory: 8404kb

input:

300000 300000
100147 102722 114137 135827 101131 100793 100075 100826 103396 101938 107440 101625 100001 115135 104709 100023 136935 101818 101814 107741 10 104365 106177 100000 100001 100001 128779 100001 100194 102288 100103 108446 194467 100007 109368 198932 108182 101170 192367 100217 107024 100...

output:

Yes
Yes
No
No
No
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 190797, no count is 109203

Subtask #9:

score: 9
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Test #79:

score: 9
Accepted
time: 109ms
memory: 8352kb

input:

300000 300000
999999700006 999999770898 999999701005 999999709476 999999700060 999999700000 999999700000 999999700286 999999700000 999999700000 999999700000 999999700000 999999700000 376961301645 999999700000 999999700000 999999700000 999999700000 311 999999700000 999999700000 999999700401 999999700...

output:

No
No
No
No
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
Yes
No
No
...

result:

ok 300000 token(s): yes count is 142050, no count is 157950

Test #80:

score: 9
Accepted
time: 120ms
memory: 8344kb

input:

300000 300000
999999808789 999999725959 999999703995 999999700037 999999726780 999999823439 999999934001 999999700007 329 999999710902 450 999999848087 999999720586 999999701089 999999701689 999999702917 999999700000 999999700670 999999700002 999999700467 999999700003 999999711998 999999700023 99999...

output:

No
No
No
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
No
No
Yes
No
No
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
N...

result:

ok 300000 token(s): yes count is 156870, no count is 143130

Test #81:

score: 9
Accepted
time: 124ms
memory: 8360kb

input:

300000 300000
650787868285 43 650787341596 650790889570 650787341595 650787342336 650787476642 651190477662 650787342840 43 74 650787341631 651345493963 46 47 650789858793 46 650787342037 650787341596 44 66 650788199191 650787342876 650787341646 49 650787342820 650787341838 650787341599 73 659503599...

output:

Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
N...

result:

ok 300000 token(s): yes count is 156327, no count is 143673

Test #82:

score: 9
Accepted
time: 113ms
memory: 8328kb

input:

300000 300000
8002370006 2 2 999999700011 999999700000 9315427108 999999700917 999999700000 2 999999700332 2 999999810729 999999703630 111472 2 999999810383 7631730450 2 2 2 999999706283 7631763195 999999700004 999999700000 7631722240 999999700000 999999700000 999999997760 7634382572 2 999999744930 ...

output:

Yes
Yes
Yes
No
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
Yes
Yes
No
No
No
Yes
No
No
No
Yes
No
No
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
...

result:

ok 300000 token(s): yes count is 142124, no count is 157876

Test #83:

score: 9
Accepted
time: 118ms
memory: 8348kb

input:

300000 300000
999999796951 999999707698 999999700001 999999700097 999999700008 999999700044 999999701282 999999786728 999999991169 999999700023 999999700000 999999700092 999999700036 999999700023 999999700728 999999700014 999999947014 999999700686 999999700000 999999701757 999999835088 999999700003 ...

output:

No
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
No
No
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
No
No
Yes
No
No
No
Yes
No
Yes
N...

result:

ok 300000 token(s): yes count is 129847, no count is 170153

Test #84:

score: 9
Accepted
time: 115ms
memory: 8284kb

input:

300000 300000
6 39325106867 46061146184 7 39325781209 39327615634 57601114407 39453882969 39325087601 7 39325988745 41090773402 40227772410 39325087529 39327366053 39333111980 39325092986 39325787212 45576060206 5 56634443052 39418683084 39358721588 39325094980 39406838334 39325087871 54816862419 39...

output:

No
No
Yes
Yes
Yes
No
No
No
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
No
No
No
Yes
Yes
Yes
No...

result:

ok 300000 token(s): yes count is 151829, no count is 148171

Test #85:

score: 9
Accepted
time: 113ms
memory: 8344kb

input:

300000 300000
999999700000 264712 999999700000 999999700000 999999700000 149073 151779 999999700528 999999700000 150870 999999700000 999999700000 999999700000 999999700000 999999700000 999999700001 999999700000 999999840670 999999700042 999999700000 999999766100 7 999999700000 999999700000 999999700...

output:

Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
No
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
Yes
No
No
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
Yes...

result:

ok 300000 token(s): yes count is 145376, no count is 154624

Test #86:

score: 9
Accepted
time: 100ms
memory: 8288kb

input:

300000 300000
999999700003 1 1 1 1 1 1 1 999999700178 1 1 1 1 1 1 1 1 999999700419 1 1 1 1 1 1 1 1 1 1 1 999999702275 999999704762 1 1 1 1 1 1 1 999999702964 1 1 1 1 1 1 1 1 999999700477 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 999999700023 1 1 1 1 999999709341...

output:

Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
Yes
No
No
Yes
No
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
No...

result:

ok 300000 token(s): yes count is 150418, no count is 149582

Test #87:

score: 9
Accepted
time: 117ms
memory: 8328kb

input:

300000 300000
93081544015 91340529310 8 104557569973 91418169391 91339254281 91339281502 91339261040 6 91339257444 91343674718 91339254281 95076476403 91339256196 91339261638 6 91339292915 9 91339256049 91341654130 91339254935 91339254305 91342063907 6 91339386121 91339254518 91401656733 91365286363...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
No
...

result:

ok 300000 token(s): yes count is 149666, no count is 150334

Test #88:

score: 9
Accepted
time: 112ms
memory: 8348kb

input:

300000 300000
27446271672 999999700000 999999700019 20732833958 999999700000 999999700002 999999700000 999999700000 999999761881 999999700002 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 20958487561 999999700000 999999700000 999999700000 999...

output:

No
No
Yes
No
Yes
No
No
Yes
No
Yes
No
No
Yes
No
Yes
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
Yes
Yes
No
No
Yes
Yes
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
Yes
Yes
No
No
N...

result:

ok 300000 token(s): yes count is 121837, no count is 178163

Test #89:

score: 9
Accepted
time: 108ms
memory: 8292kb

input:

300000 300000
999999728222 999999700259 999999737124 999999814790 999999700006 999999703929 999999700039 999999700565 999999700539 999999705073 999999778132 999999700003 999999700010 999999737664 999999700260 999999700621 999999700444 999999700000 999999893395 999999700015 999999700000 999999700076 ...

output:

No
No
No
No
No
No
No
Yes
No
No
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
No
No
Yes
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
No
Yes
Yes
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
Yes
Yes
No
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
No
No
Yes
No
No
No
No
Yes
No...

result:

ok 300000 token(s): yes count is 101283, no count is 198717

Test #90:

score: 9
Accepted
time: 124ms
memory: 8372kb

input:

300000 300000
488841521370 488848787974 40 488841401569 488854951290 488841407381 30 488841401571 488843616460 488841435868 488842298705 488841401574 488942970059 43 488841401570 500132849821 488841401570 488843291347 556356807013 488876469531 488847588561 488846952279 30 488841409515 43 48884140177...

output:

No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
No
No
No
No
Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
N...

result:

ok 300000 token(s): yes count is 156629, no count is 143371

Subtask #10:

score: 3
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #91:

score: 3
Accepted
time: 121ms
memory: 8332kb

input:

300000 300000
999999700006 999999770898 999999701005 999999709476 999999700060 999999700000 999999700000 999999700286 999999700000 999999700000 999999700000 999999700000 999999700000 376961301645 999999700000 999999700000 999999700000 999999700000 311 999999700000 999999700000 999999700401 999999700...

output:

No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
...

result:

ok 300000 token(s): yes count is 180283, no count is 119717

Test #92:

score: 3
Accepted
time: 135ms
memory: 8344kb

input:

300000 300000
999999808789 999999725959 999999703995 999999700037 999999726780 999999823439 999999934001 999999700007 329 999999710902 450 999999848087 999999720586 999999701089 999999701689 999999702917 999999700000 999999700670 999999700002 999999700467 999999700003 999999711998 999999700023 99999...

output:

Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
No
Ye...

result:

ok 300000 token(s): yes count is 184027, no count is 115973

Test #93:

score: 3
Accepted
time: 138ms
memory: 8368kb

input:

300000 300000
650787868285 43 650787341596 650790889570 650787341595 650787342336 650787476642 651190477662 650787342840 43 74 650787341631 651345493963 46 47 650789858793 46 650787342037 650787341596 44 66 650788199191 650787342876 650787341646 49 650787342820 650787341838 650787341599 73 659503599...

output:

No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
Yes
No
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No...

result:

ok 300000 token(s): yes count is 181200, no count is 118800

Test #94:

score: 3
Accepted
time: 132ms
memory: 8288kb

input:

300000 300000
8002370006 2 2 999999700011 999999700000 9315427108 999999700917 999999700000 2 999999700332 2 999999810729 999999703630 111472 2 999999810383 7631730450 2 2 2 999999706283 7631763195 999999700004 999999700000 7631722240 999999700000 999999700000 999999997760 7634382572 2 999999744930 ...

output:

No
Yes
No
No
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes...

result:

ok 300000 token(s): yes count is 173672, no count is 126328

Test #95:

score: 3
Accepted
time: 130ms
memory: 8352kb

input:

300000 300000
999999796951 999999707698 999999700001 999999700097 999999700008 999999700044 999999701282 999999786728 999999991169 999999700023 999999700000 999999700092 999999700036 999999700023 999999700728 999999700014 999999947014 999999700686 999999700000 999999701757 999999835088 999999700003 ...

output:

Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
No
No
Yes
Yes
Yes
No
No
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
No
No
...

result:

ok 300000 token(s): yes count is 183189, no count is 116811

Test #96:

score: 3
Accepted
time: 131ms
memory: 8288kb

input:

300000 300000
6 39325106867 46061146184 7 39325781209 39327615634 57601114407 39453882969 39325087601 7 39325988745 41090773402 40227772410 39325087529 39327366053 39333111980 39325092986 39325787212 45576060206 5 56634443052 39418683084 39358721588 39325094980 39406838334 39325087871 54816862419 39...

output:

Yes
Yes
No
No
No
No
Yes
No
Yes
No
Yes
Yes
No
Yes
No
No
No
No
No
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
...

result:

ok 300000 token(s): yes count is 180537, no count is 119463

Test #97:

score: 3
Accepted
time: 121ms
memory: 8420kb

input:

300000 300000
398239 751001 690343 292541 288572 12751 542264 600499 99774 1000000000000 999991175043 1000000000000 133547 236506 74871 805949 1000000000000 1000000000000 782688 1000000000000 497831 819549 288216 1000000000000 106065 59281 1000000000000 1000000000000 410012 1000000000000 10000000000...

output:

Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
...

result:

ok 300000 token(s): yes count is 160794, no count is 139206

Test #98:

score: 3
Accepted
time: 119ms
memory: 8288kb

input:

300000 300000
1320501 920333 1306004 69274 48840 554547 797341 101299 1118390 979306 1131343 5980 1000000000000 900306 1158788 823711 1265895 745834 707645 845900 1326964 380006 1000000000000 862283 288569 512237 597962 941132 1244495 1260251 424636 1239574 1213737 322235 317080 1000000000000 742354...

output:

Yes
No
No
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
N...

result:

ok 300000 token(s): yes count is 161983, no count is 138017

Test #99:

score: 3
Accepted
time: 111ms
memory: 8352kb

input:

300000 300000
1000000000000 1000000000000 169836 517059 268226 1000000000000 1000000000000 397895 585007 1000000000000 626814 1000000000000 1000000000000 340062 137887 797737 16667 708737 1000000000000 1000000000000 1000000000000 1000000000000 518139 1000000000000 337693 66684 12186 464774 650838 78...

output:

No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Y...

result:

ok 300000 token(s): yes count is 160907, no count is 139093

Subtask #11:

score: 6
Accepted

Dependency #4:

100%
Accepted

Test #100:

score: 6
Accepted
time: 0ms
memory: 5720kb

input:

100 100
2 2 2 1 1 205 1 200 200 2 55 200 2 2 200 200 2 2 1 1 200 55 2 200 1 2 2 55 2 59 2 2 200 200 2 2 200 1 55 200 2 229 1 2 2 2 2 1 2 200 1 2 2 1 1 2 1 2 2 1 1 2 200 200 1 2 2 200 1 200 2 214 2 200 2 200 200 2 200 1 200 2 2 2 200 1 200 200 200 1 2 1 2 2 2 205 2 2 1 1
0
207 187 272
0 1 0
281188836...

output:

Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes...

result:

ok 100 token(s): yes count is 69, no count is 31

Test #101:

score: 6
Accepted
time: 1ms
memory: 5704kb

input:

100 100
226 257 3 214 208 269 1 228 210 205 1 273 12 288 207 5 251 203 246 209 225 207 234 200 203 20 2 202 208 113 203 249 213 201 212 202 245 268 200 200 248 201 218 208 227 244 223 245 267 251 200 200 203 205 254 279 248 200 203 200 297 224 229 202 240 202 206 265 262 231 1 14 238 200 247 255 218...

output:

Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
...

result:

ok 100 token(s): yes count is 72, no count is 28

Test #102:

score: 6
Accepted
time: 0ms
memory: 5640kb

input:

100 100
21 22 26 22 20 20 27 27 34 29 32 19 19 24 19 1 22 28 27 21 20 24 26 19 21 28 31 21 29 32 27 19 21 23 5 26 21 22 30 28 29 26 21 19 30 25 20 20 19 1 27 20 25 29 29 23 23 24 19 29 19 1 1 19 23 25 21 23 30 1 25 34 24 27 10 20 35 22 31 34 1 20 28 19 19 36 32 19 32 20 22 34 21 31 2 25 20 1 22 19
0...

output:

No
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes...

result:

ok 100 token(s): yes count is 60, no count is 40

Test #103:

score: 6
Accepted
time: 1ms
memory: 5728kb

input:

100 100
201 200 4 200 200 200 200 232 200 4 200 5 3 200 200 200 6 230 202 5 1 6 219 200 4 4 200 5 200 2 6 4 6 200 200 200 200 200 200 200 5 200 4 200 200 4 4 200 4 200 4 200 4 200 200 200 200 200 5 200 200 200 6 4 5 200 6 4 200 200 4 4 200 200 5 4 4 95 200 4 200 4 200 200 4 6 4 95 200 200 98 1 6 200...

output:

Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
...

result:

ok 100 token(s): yes count is 85, no count is 15

Test #104:

score: 6
Accepted
time: 1ms
memory: 5700kb

input:

100 100
1 203 206 211 205 1 201 205 242 152 37 12 247 1 203 224 1 238 207 208 203 1 1 240 204 217 275 1 1 206 208 200 204 238 1 204 237 232 200 202 200 1 1 223 1 1 200 247 201 2 271 75 205 226 231 205 205 216 200 202 298 202 252 280 205 201 208 1 206 200 223 207 224 223 1 201 204 228 1 261 288 1 19 ...

output:

Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
...

result:

ok 100 token(s): yes count is 67, no count is 33

Test #105:

score: 6
Accepted
time: 1ms
memory: 5760kb

input:

100 100
18 16 16 17 1 27 18 3 1 16 29 1 18 16 17 17 16 19 16 30 18 16 20 19 18 17 29 24 17 17 17 19 16 16 30 16 30 17 1 2 16 1 18 23 16 22 31 28 18 16 16 18 6 21 26 16 16 17 20 18 24 28 28 16 1 16 16 18 24 20 16 17 16 17 16 18 28 16 23 17 16 24 26 18 1 29 20 19 16 16 20 16 24 16 16 29 22 18 16 25
0
...

output:

Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
No
No
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
...

result:

ok 100 token(s): yes count is 60, no count is 40

Test #106:

score: 6
Accepted
time: 1ms
memory: 5728kb

input:

100 100
5 2 8 6 5 6 5 1 6 2 4 5 1 210 1 1 200 1 200 8 8 8 2 1 8 1 8 230 1 5 1 7 200 2 3 5 1 3 4 1 4 1 1 200 4 2 6 1 1 5 202 4 7 8 5 5 5 200 3 203 1 1 8 5 2 5 200 7 5 1 1 2 1 222 7 2 1 1 1 2 200 1 8 1 173 8 3 3 1 1 5 2 6 3 5 8 8 5 3 200
0
6 300 300
200 300 300
181 300 300
228 300 300
200 300 300
1389...

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
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

result:

ok 100 token(s): yes count is 0, no count is 100

Test #107:

score: 6
Accepted
time: 1ms
memory: 5724kb

input:

100 100
210 260 207 4 205 258 202 206 253 1 200 296 207 214 200 201 201 254 229 263 204 200 1 268 242 232 209 206 215 250 223 201 246 203 205 221 205 200 26 200 207 200 234 202 261 295 203 239 212 260 252 206 203 26 205 232 13 291 201 231 200 285 200 107 219 204 229 200 218 1 277 203 208 2 265 5 1 2...

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
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

result:

ok 100 token(s): yes count is 0, no count is 100

Test #108:

score: 6
Accepted
time: 0ms
memory: 5640kb

input:

100 100
28 28 29 28 29 28 30 28 28 46 33 45 28 2 31 53 39 46 30 30 31 28 31 31 29 31 1 35 35 32 29 28 1 31 1 31 41 30 6 1 37 35 38 28 28 31 29 41 53 30 36 31 28 28 1 29 1 29 35 28 32 47 33 28 34 45 29 31 28 29 47 30 28 31 30 28 50 1 40 31 41 29 28 28 28 28 29 29 28 28 29 38 28 53 28 28 13 37 28 54
0...

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
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

result:

ok 100 token(s): yes count is 0, no count is 100

Subtask #12:

score: 6
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #11:

100%
Accepted

Test #109:

score: 6
Accepted
time: 48ms
memory: 5704kb

input:

100 300000
2 2 2 1 1 205 1 200 200 2 55 200 2 2 200 200 2 2 1 1 200 55 2 200 1 2 2 55 2 59 2 2 200 200 2 2 200 1 55 200 2 229 1 2 2 2 2 1 2 200 1 2 2 1 1 2 1 2 2 1 1 2 200 200 1 2 2 200 1 200 2 214 2 200 2 200 200 2 200 1 200 2 2 2 200 1 200 200 200 1 2 1 2 2 2 205 2 2 1 1
0
4 150 293
209 242 187
21...

output:

No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
No
No
No
Yes
No
No
No
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
No
Yes
Yes
N...

result:

ok 300000 token(s): yes count is 211360, no count is 88640

Test #110:

score: 6
Accepted
time: 46ms
memory: 5728kb

input:

100 300000
226 257 3 214 208 269 1 228 210 205 1 273 12 288 207 5 251 203 246 209 225 207 234 200 203 20 2 202 208 113 203 249 213 201 212 202 245 268 200 200 248 201 218 208 227 244 223 245 267 251 200 200 203 205 254 279 248 200 203 200 297 224 229 202 240 202 206 265 262 231 1 14 238 200 247 255 ...

output:

No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
No
No
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
No
No
No
No
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
No
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No...

result:

ok 300000 token(s): yes count is 152801, no count is 147199

Test #111:

score: 6
Accepted
time: 44ms
memory: 5648kb

input:

100 300000
21 22 26 22 20 20 27 27 34 29 32 19 19 24 19 1 22 28 27 21 20 24 26 19 21 28 31 21 29 32 27 19 21 23 5 26 21 22 30 28 29 26 21 19 30 25 20 20 19 1 27 20 25 29 29 23 23 24 19 29 19 1 1 19 23 25 21 23 30 1 25 34 24 27 10 20 35 22 31 34 1 20 28 19 19 36 32 19 32 20 22 34 21 31 2 25 20 1 22 1...

output:

No
No
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
No
No
No
Yes
No
No
No
Yes
No
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
Yes
No
No
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
No
Yes
No
No...

result:

ok 300000 token(s): yes count is 95207, no count is 204793

Test #112:

score: 6
Accepted
time: 41ms
memory: 5716kb

input:

100 300000
201 200 4 200 200 200 200 232 200 4 200 5 3 200 200 200 6 230 202 5 1 6 219 200 4 4 200 5 200 2 6 4 6 200 200 200 200 200 200 200 5 200 4 200 200 4 4 200 4 200 4 200 4 200 200 200 200 200 5 200 200 200 6 4 5 200 6 4 200 200 4 4 200 200 5 4 4 95 200 4 200 4 200 200 4 6 4 95 200 200 98 1 6 ...

output:

Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
No
Yes
No
No
No
Yes
No
Yes
Yes
No
Yes
No
No
No
No
Yes
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Ye...

result:

ok 300000 token(s): yes count is 165436, no count is 134564

Test #113:

score: 6
Accepted
time: 49ms
memory: 5732kb

input:

100 300000
1 203 206 211 205 1 201 205 242 152 37 12 247 1 203 224 1 238 207 208 203 1 1 240 204 217 275 1 1 206 208 200 204 238 1 204 237 232 200 202 200 1 1 223 1 1 200 247 201 2 271 75 205 226 231 205 205 216 200 202 298 202 252 280 205 201 208 1 206 200 223 207 224 223 1 201 204 228 1 261 288 1 ...

output:

Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
...

result:

ok 300000 token(s): yes count is 160118, no count is 139882

Test #114:

score: 6
Accepted
time: 48ms
memory: 5716kb

input:

100 300000
18 16 16 17 1 27 18 3 1 16 29 1 18 16 17 17 16 19 16 30 18 16 20 19 18 17 29 24 17 17 17 19 16 16 30 16 30 17 1 2 16 1 18 23 16 22 31 28 18 16 16 18 6 21 26 16 16 17 20 18 24 28 28 16 1 16 16 18 24 20 16 17 16 17 16 18 28 16 23 17 16 24 26 18 1 29 20 19 16 16 20 16 24 16 16 29 22 18 16 25...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
Yes
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
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
Yes
No
No
No
Yes
No
Yes
No...

result:

ok 300000 token(s): yes count is 61864, no count is 238136

Test #115:

score: 6
Accepted
time: 41ms
memory: 5644kb

input:

100 300000
5 2 8 6 5 6 5 1 6 2 4 5 1 210 1 1 200 1 200 8 8 8 2 1 8 1 8 230 1 5 1 7 200 2 3 5 1 3 4 1 4 1 1 200 4 2 6 1 1 5 202 4 7 8 5 5 5 200 3 203 1 1 8 5 2 5 200 7 5 1 1 2 1 222 7 2 1 1 1 2 200 1 8 1 173 8 3 3 1 1 5 2 6 3 5 8 8 5 3 200
0
203 300 300
215 300 300
205 300 300
201 300 300
205 300 300...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #116:

score: 6
Accepted
time: 45ms
memory: 5648kb

input:

100 300000
210 260 207 4 205 258 202 206 253 1 200 296 207 214 200 201 201 254 229 263 204 200 1 268 242 232 209 206 215 250 223 201 246 203 205 221 205 200 26 200 207 200 234 202 261 295 203 239 212 260 252 206 203 26 205 232 13 291 201 231 200 285 200 107 219 204 229 200 218 1 277 203 208 2 265 5 ...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #117:

score: 6
Accepted
time: 45ms
memory: 5712kb

input:

100 300000
28 28 29 28 29 28 30 28 28 46 33 45 28 2 31 53 39 46 30 30 31 28 31 31 29 31 1 35 35 32 29 28 1 31 1 31 41 30 6 1 37 35 38 28 28 31 29 41 53 30 36 31 28 28 1 29 1 29 35 28 32 47 33 28 34 45 29 31 28 29 47 30 28 31 30 28 50 1 40 31 41 29 28 28 28 28 29 29 28 28 29 38 28 53 28 28 13 37 28 5...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Subtask #13:

score: 2
Accepted

Dependency #4:

100%
Accepted

Dependency #11:

100%
Accepted

Test #118:

score: 2
Accepted
time: 1ms
memory: 5724kb

input:

1500 1500
750 1 764 1 750 895 750 750 1 1 1 1 1 750 851 750 750 750 750 805 1 750 750 901 1 1 750 750 1 1 750 1 754 764 750 1 750 750 750 1 1 750 750 991 750 1 750 756 750 1 750 750 758 750 1 1 1 750 750 919 759 750 1 750 1 1 767 750 750 397 750 1 750 1 1 1 1 1 1 1 1 750 1 1 1 750 1 750 750 1 1 791 ...

output:

Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
...

result:

ok 1500 token(s): yes count is 1144, no count is 356

Test #119:

score: 2
Accepted
time: 1ms
memory: 5804kb

input:

1500 1500
779 1119 753 956 767 803 756 1357 754 825 750 750 838 750 891 820 959 766 1032 754 750 756 768 762 752 1054 757 789 871 904 1030 756 1451 752 754 1404 775 798 1201 802 796 751 1059 756 781 1029 796 778 772 753 750 755 754 770 757 878 762 769 789 920 761 835 753 761 750 895 949 1409 808 751...

output:

Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes...

result:

ok 1500 token(s): yes count is 922, no count is 578

Test #120:

score: 2
Accepted
time: 1ms
memory: 5656kb

input:

1500 1500
16 20 16 27 14 14 23 20 15 16 25 16 23 14 26 25 16 17 17 23 24 16 17 15 14 15 26 16 14 14 14 17 18 14 16 14 26 14 22 20 14 20 17 23 16 16 19 16 15 19 17 14 19 16 23 14 19 14 16 15 20 27 15 15 14 15 16 14 14 15 16 15 23 16 14 23 21 19 24 20 15 18 16 20 21 14 16 14 25 19 15 15 15 1 20 14 14 ...

output:

Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
N...

result:

ok 1500 token(s): yes count is 971, no count is 529

Test #121:

score: 2
Accepted
time: 1ms
memory: 5784kb

input:

1500 1500
750 1 1 1 750 6 1 5 1 750 1 5 6 1 1 750 1 750 5 5 1 6 1 1 1 750 750 1 750 750 1 8 750 1 5 750 1 1 750 750 1 1 1 5 5 1 1 1 1 1 1 1 5 6 750 1 1 1 750 1 750 750 6 750 1 1 1 6 1 1 1 1 750 1 750 750 1 6 750 1 1 1 7 750 6 1 1 750 1 1 1 1 1 1 1 7 1 1 1 1 3 5 1 2 5 5 750 1 750 1 1 1 7 1 750 1 1 1 ...

output:

Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
Yes
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
No
No
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
...

result:

ok 1500 token(s): yes count is 865, no count is 635

Test #122:

score: 2
Accepted
time: 1ms
memory: 5720kb

input:

1500 1500
767 753 1458 829 849 782 752 1169 816 751 750 897 751 755 1123 768 751 753 809 959 1227 750 789 839 751 1117 767 1108 750 961 772 767 799 750 1144 1066 751 1205 756 1041 754 751 776 750 766 751 1104 750 750 758 757 812 760 1306 790 759 778 750 754 800 788 754 750 751 1426 805 1119 866 1199...

output:

Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes...

result:

ok 1500 token(s): yes count is 914, no count is 586

Test #123:

score: 2
Accepted
time: 1ms
memory: 5784kb

input:

1500 1500
15 11 14 12 11 14 13 14 16 13 11 11 13 11 16 13 12 15 21 16 17 21 13 11 16 11 13 15 17 11 16 14 11 13 13 15 21 15 12 11 12 13 12 16 14 11 11 11 17 11 15 12 12 21 12 11 11 13 19 12 14 15 14 18 12 15 12 11 11 12 14 17 13 11 11 14 20 14 14 11 11 18 11 11 12 14 11 15 13 21 11 11 14 12 12 18 13...

output:

Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
Yes
No
Yes
Yes
No
No
No
No
No
No
Yes
Yes
Yes
No
Y...

result:

ok 1500 token(s): yes count is 826, no count is 674

Test #124:

score: 2
Accepted
time: 1ms
memory: 5724kb

input:

1500 1500
771 750 750 1305 750 750 808 820 750 750 760 750 750 753 882 750 764 750 750 750 750 917 758 750 750 750 763 750 750 750 750 750 750 750 750 750 756 750 750 750 750 750 750 750 750 750 750 750 760 750 750 750 772 750 750 750 750 755 750 750 750 750 29 750 750 750 750 750 750 760 750 750 75...

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
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
...

result:

ok 1500 token(s): yes count is 0, no count is 1500

Test #125:

score: 2
Accepted
time: 1ms
memory: 5748kb

input:

1500 1500
750 753 837 750 926 750 772 751 753 1138 752 1247 750 753 751 927 770 1309 751 750 755 1033 750 752 842 750 847 761 781 1277 753 126 1127 885 1068 781 752 758 834 755 1176 753 818 752 751 774 784 750 753 876 753 750 1248 759 937 793 752 752 859 1031 880 990 769 750 752 820 802 752 2 766 81...

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
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
...

result:

ok 1500 token(s): yes count is 0, no count is 1500

Test #126:

score: 2
Accepted
time: 1ms
memory: 5720kb

input:

1500 1500
8 14 11 8 10 8 9 10 8 8 8 12 13 13 14 9 14 11 9 15 8 8 14 11 8 9 8 8 14 10 9 9 15 12 9 8 14 9 12 13 10 11 11 10 14 15 9 10 14 13 13 10 13 12 10 9 9 11 12 14 10 8 13 15 12 8 15 13 13 9 15 12 8 13 14 9 12 8 12 15 9 10 13 8 14 9 8 8 10 14 12 12 9 11 8 10 12 8 8 8 8 8 8 8 15 9 12 9 1 13 15 12 ...

output:

Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
Yes
No
Yes
Yes
Yes...

result:

ok 1500 token(s): yes count is 762, no count is 738

Subtask #14:

score: 2
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #11:

100%
Accepted

Dependency #12:

100%
Accepted

Dependency #13:

100%
Accepted

Test #127:

score: 2
Accepted
time: 52ms
memory: 5668kb

input:

1500 300000
750 1 764 1 750 895 750 750 1 1 1 1 1 750 851 750 750 750 750 805 1 750 750 901 1 1 750 750 1 1 750 1 754 764 750 1 750 750 750 1 1 750 750 991 750 1 750 756 750 1 750 750 758 750 1 1 1 750 750 919 759 750 1 750 1 1 767 750 750 397 750 1 750 1 1 1 1 1 1 1 1 750 1 1 1 750 1 750 750 1 1 79...

output:

Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
No
Yes
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
No
Y...

result:

ok 300000 token(s): yes count is 219604, no count is 80396

Test #128:

score: 2
Accepted
time: 57ms
memory: 5744kb

input:

1500 300000
779 1119 753 956 767 803 756 1357 754 825 750 750 838 750 891 820 959 766 1032 754 750 756 768 762 752 1054 757 789 871 904 1030 756 1451 752 754 1404 775 798 1201 802 796 751 1059 756 781 1029 796 778 772 753 750 755 754 770 757 878 762 769 789 920 761 835 753 761 750 895 949 1409 808 7...

output:

Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
Yes
Yes
...

result:

ok 300000 token(s): yes count is 141421, no count is 158579

Test #129:

score: 2
Accepted
time: 44ms
memory: 5656kb

input:

1500 300000
16 20 16 27 14 14 23 20 15 16 25 16 23 14 26 25 16 17 17 23 24 16 17 15 14 15 26 16 14 14 14 17 18 14 16 14 26 14 22 20 14 20 17 23 16 16 19 16 15 19 17 14 19 16 23 14 19 14 16 15 20 27 15 15 14 15 16 14 14 15 16 15 23 16 14 23 21 19 24 20 15 18 16 20 21 14 16 14 25 19 15 15 15 1 20 14 1...

output:

No
No
No
Yes
Yes
No
No
Yes
No
No
No
No
No
Yes
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
No
Yes
No
Yes
No
Yes
No
No
No
Yes
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
Yes
No
No
No
Yes
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
No
...

result:

ok 300000 token(s): yes count is 96649, no count is 203351

Test #130:

score: 2
Accepted
time: 40ms
memory: 5784kb

input:

1500 300000
750 1 1 1 750 6 1 5 1 750 1 5 6 1 1 750 1 750 5 5 1 6 1 1 1 750 750 1 750 750 1 8 750 1 5 750 1 1 750 750 1 1 1 5 5 1 1 1 1 1 1 1 5 6 750 1 1 1 750 1 750 750 6 750 1 1 1 6 1 1 1 1 750 1 750 750 1 6 750 1 1 1 7 750 6 1 1 750 1 1 1 1 1 1 1 7 1 1 1 1 3 5 1 2 5 5 750 1 750 1 1 1 7 1 750 1 1 ...

output:

No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
No
Yes
No
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Ye...

result:

ok 300000 token(s): yes count is 191304, no count is 108696

Test #131:

score: 2
Accepted
time: 54ms
memory: 5668kb

input:

1500 300000
767 753 1458 829 849 782 752 1169 816 751 750 897 751 755 1123 768 751 753 809 959 1227 750 789 839 751 1117 767 1108 750 961 772 767 799 750 1144 1066 751 1205 756 1041 754 751 776 750 766 751 1104 750 750 758 757 812 760 1306 790 759 778 750 754 800 788 754 750 751 1426 805 1119 866 11...

output:

Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
No
Yes
No
No
No
Yes
No
Yes
No
No
Yes
No
No
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
...

result:

ok 300000 token(s): yes count is 150176, no count is 149824

Test #132:

score: 2
Accepted
time: 50ms
memory: 5656kb

input:

1500 300000
15 11 14 12 11 14 13 14 16 13 11 11 13 11 16 13 12 15 21 16 17 21 13 11 16 11 13 15 17 11 16 14 11 13 13 15 21 15 12 11 12 13 12 16 14 11 11 11 17 11 15 12 12 21 12 11 11 13 19 12 14 15 14 18 12 15 12 11 11 12 14 17 13 11 11 14 20 14 14 11 11 18 11 11 12 14 11 15 13 21 11 11 14 12 12 18 ...

output:

Yes
Yes
No
No
No
Yes
No
No
No
No
Yes
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
No
No
No
Yes
No
No
Yes
Yes
Yes
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
Yes
Yes
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
N...

result:

ok 300000 token(s): yes count is 83365, no count is 216635

Test #133:

score: 2
Accepted
time: 46ms
memory: 5668kb

input:

1500 300000
771 750 750 1305 750 750 808 820 750 750 760 750 750 753 882 750 764 750 750 750 750 917 758 750 750 750 763 750 750 750 750 750 750 750 750 750 756 750 750 750 750 750 750 750 750 750 750 750 760 750 750 750 772 750 750 750 750 755 750 750 750 750 29 750 750 750 750 750 750 760 750 750 ...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #134:

score: 2
Accepted
time: 50ms
memory: 5784kb

input:

1500 300000
750 753 837 750 926 750 772 751 753 1138 752 1247 750 753 751 927 770 1309 751 750 755 1033 750 752 842 750 847 761 781 1277 753 126 1127 885 1068 781 752 758 834 755 1176 753 818 752 751 774 784 750 753 876 753 750 1248 759 937 793 752 752 859 1031 880 990 769 750 752 820 802 752 2 766 ...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #135:

score: 2
Accepted
time: 42ms
memory: 5708kb

input:

1500 300000
8 14 11 8 10 8 9 10 8 8 8 12 13 13 14 9 14 11 9 15 8 8 14 11 8 9 8 8 14 10 9 9 15 12 9 8 14 9 12 13 10 11 11 10 14 15 9 10 14 13 13 10 13 12 10 9 9 11 12 14 10 8 13 15 12 8 15 13 13 9 15 12 8 13 14 9 12 8 12 15 9 10 13 8 14 9 8 8 10 14 12 12 9 11 8 10 12 8 8 8 8 8 8 8 15 9 12 9 1 13 15 1...

output:

Yes
No
Yes
No
No
No
Yes
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Ye...

result:

ok 300000 token(s): yes count is 194074, no count is 105926

Subtask #15:

score: 6
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #11:

100%
Accepted

Dependency #12:

100%
Accepted

Dependency #13:

100%
Accepted

Dependency #14:

100%
Accepted

Test #136:

score: 6
Accepted
time: 53ms
memory: 5768kb

input:

5000 300000
990 2500 2500 989 2500 5 2500 1007 1689 2500 993 996 1502 2500 2500 989 2500 1253 994 5 5 992 1337 1045 2500 2500 2500 2500 1002 990 2500 2500 992 2500 2500 2500 1021 1051 1160 989 2500 992 991 1158 989 1291 2500 2500 1019 1310 989 993 1039 1013 1 2500 989 993 1091 2500 1180 2500 2500 5 ...

output:

No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
No
...

result:

ok 300000 token(s): yes count is 222867, no count is 77133

Test #137:

score: 6
Accepted
time: 63ms
memory: 5660kb

input:

5000 300000
2573 2500 3377 3834 2510 3456 4334 2514 2577 2511 2551 2501 2500 2502 2519 2674 2546 2586 2512 2501 2543 2735 2529 3136 2528 2501 2567 2711 2660 3066 2840 2500 2555 2500 2918 2500 3832 4328 2707 2551 2527 2583 2611 2552 2533 2513 2501 2507 2507 4914 2921 2735 2946 2894 2534 2722 2512 250...

output:

No
Yes
Yes
No
No
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No...

result:

ok 300000 token(s): yes count is 167173, no count is 132827

Test #138:

score: 6
Accepted
time: 49ms
memory: 5768kb

input:

5000 300000
17 16 18 19 16 25 17 20 15 15 29 17 25 15 29 15 22 17 26 21 28 20 25 15 26 18 25 17 22 20 21 16 24 19 23 15 15 22 28 18 24 18 27 18 16 16 27 20 17 17 15 15 19 18 21 16 17 15 16 18 28 15 17 16 16 15 18 26 24 20 15 29 16 15 15 15 23 15 24 17 18 17 23 19 20 17 27 16 23 15 20 16 16 25 19 16 ...

output:

No
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
No
Yes
No
No
Yes
No
No
Yes
No
Yes
No
Yes
No
No
Yes
No
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
No
No
Yes
No
No
No
No
No
No
Yes
No
No
No
No
Yes
Yes
No
Yes
No
Yes
No
N...

result:

ok 300000 token(s): yes count is 103558, no count is 196442

Test #139:

score: 6
Accepted
time: 55ms
memory: 5764kb

input:

5000 300000
2531 4 7 2 3 2694 4 3784 2511 3 3 4 8 4 3 2 2549 4 2 3 6 3198 3 2500 3 2500 3 2500 2500 2500 3 2503 2534 4 2545 2500 2855 3 2 3 3 2679 2737 3 2576 3 3086 2508 2501 2685 3 4 3 2 2500 2 5 4 3 2500 2 2500 3 3045 3 1 2624 2500 4 2529 3 3 2501 2500 3 3 3 8 3 2611 3 3 2504 4 6 3 2672 4 3 3 413...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 300000 token(s): yes count is 298831, no count is 1169

Test #140:

score: 6
Accepted
time: 63ms
memory: 5772kb

input:

5000 300000
2529 2925 4468 2501 3366 2506 2795 2500 2729 2514 3193 2501 2648 2534 2580 2512 2544 2551 2505 2609 192 3308 4859 2504 2780 4843 3213 2541 2507 2678 4384 2560 2520 2504 2518 2651 4450 2696 2545 2531 2526 3516 4718 3582 2500 2508 4087 2505 2972 3085 4294 2501 3767 4942 3042 2501 3026 2538...

output:

Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
Yes
No
No
No
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
No
No
No
Ye...

result:

ok 300000 token(s): yes count is 148127, no count is 151873

Test #141:

score: 6
Accepted
time: 48ms
memory: 5792kb

input:

5000 300000
17 28 18 17 25 20 28 18 18 16 28 21 16 27 19 29 19 23 21 18 17 25 17 18 26 21 17 17 21 22 19 20 26 16 16 21 17 17 17 18 16 29 26 19 19 16 17 30 22 19 30 17 16 23 18 17 31 25 16 18 21 27 16 16 26 21 16 18 27 16 16 16 16 26 16 16 20 18 19 17 29 16 24 31 27 16 25 16 24 29 16 16 19 25 17 16 ...

output:

Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
Yes
No
No
Yes
No
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
No
Yes
No
No
No
No
No
Yes
No
No
Yes
No
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
N...

result:

ok 300000 token(s): yes count is 98229, no count is 201771

Test #142:

score: 6
Accepted
time: 51ms
memory: 7784kb

input:

5000 300000
2 2 2500 2 2919 2743 2524 2505 2595 2808 3516 2508 2532 4710 2501 2510 2556 2606 4374 2754 2500 4166 2502 3131 2567 2560 2500 2531 2868 2 2 3255 2500 2501 2888 2513 2510 3115 2544 2501 2674 3089 3890 2504 2693 2502 2 2511 2500 2514 2625 2835 2515 2530 2505 2537 2909 2567 2527 2513 3230 2...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #143:

score: 6
Accepted
time: 48ms
memory: 5816kb

input:

5000 300000
2728 3659 2613 2521 2512 2505 2772 2505 2513 2525 2996 2539 2556 2684 2501 2864 4850 2502 2850 2552 2506 2689 2627 4509 2509 2511 2500 2536 2520 2509 2655 2532 2511 2643 2514 3221 4209 2501 2549 3237 3709 2509 2563 4410 2502 2580 2505 3466 3736 2511 2502 2501 2501 2514 3841 3583 2537 447...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Test #144:

score: 6
Accepted
time: 43ms
memory: 5728kb

input:

5000 300000
15 14 16 22 18 14 22 27 24 14 20 16 14 14 21 14 14 22 17 17 19 27 14 16 14 15 17 21 14 27 14 26 16 14 25 15 17 19 22 21 23 19 14 17 14 18 21 15 15 16 15 14 14 14 17 25 21 14 14 23 14 23 14 22 18 17 14 17 17 15 23 23 21 25 21 18 14 24 17 26 18 17 14 15 19 26 21 16 23 14 21 17 14 19 14 15 ...

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
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
...

result:

ok 300000 token(s): yes count is 0, no count is 300000

Subtask #16:

score: 2
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Dependency #11:

100%
Accepted

Dependency #12:

100%
Accepted

Dependency #13:

100%
Accepted

Dependency #14:

100%
Accepted

Dependency #15:

100%
Accepted

Test #145:

score: 2
Accepted
time: 96ms
memory: 8292kb

input:

300000 300000
100000 117510 100000 48 100000 100000 100007 100000 100000 100000 101486 100000 100000 172437 100000 38 100000 103992 100000 100000 100000 100000 100371 100000 100000 100002 100000 100000 100000 100000 102342 100160 100000 47 100007 123867 100000 100029 41 100000 100000 104652 100001 5...

output:

No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Y...

result:

ok 300000 token(s): yes count is 214596, no count is 85404

Test #146:

score: 2
Accepted
time: 113ms
memory: 8288kb

input:

300000 300000
100000 100005 100005 119294 100004 193033 101203 120957 100010 115106 100000 100001 100000 164741 100000 100406 101581 100014 100040 103069 101325 113768 100025 100007 100009 100019 100000 100003 100051 100005 100038 104699 102284 100043 101866 195063 100001 100793 100001 100108 100000...

output:

No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
Yes
No
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
No
Yes
Yes
No...

result:

ok 300000 token(s): yes count is 167746, no count is 132254

Test #147:

score: 2
Accepted
time: 113ms
memory: 8284kb

input:

300000 300000
100011 100324 100043 100016 132586 109078 100051 100711 112035 100060 100553 100000 101265 101900 134175 100009 100017 115239 111746 100029 126717 100031 106384 100004 100023 100804 100029 103586 15 101044 107110 102489 100021 100299 100664 100006 134425 100001 106251 100567 9 9 104957...

output:

Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Y...

result:

ok 300000 token(s): yes count is 205324, no count is 94676

Test #148:

score: 2
Accepted
time: 88ms
memory: 8372kb

input:

300000 300000
100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100179 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000...

output:

Yes
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Y...

result:

ok 300000 token(s): yes count is 214101, no count is 85899

Test #149:

score: 2
Accepted
time: 104ms
memory: 8284kb

input:

300000 300000
108366 100158 159216 100917 133264 100352 195508 100046 100038 100237 107270 123609 100096 100077 140870 100000 100199 100118 101052 100278 105697 100031 100008 102694 100040 100004 100167 100642 100002 100189 100030 100002 150895 152345 102025 100000 100089 100000 100180 157844 100005...

output:

Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No...

result:

ok 300000 token(s): yes count is 171170, no count is 128830

Test #150:

score: 2
Accepted
time: 107ms
memory: 8272kb

input:

300000 300000
100147 102722 114137 135827 101131 100793 100075 100826 103396 101938 107440 101625 100001 115135 104709 100023 136935 101818 101814 107741 10 104365 106177 100000 100001 100001 128779 100001 100194 102288 100103 108446 194467 100007 109368 198932 108182 101170 192367 100217 107024 100...

output:

Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes...

result:

ok 300000 token(s): yes count is 196672, no count is 103328

Subtask #17:

score: 6
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Dependency #9:

100%
Accepted

Dependency #10:

100%
Accepted

Dependency #11:

100%
Accepted

Dependency #12:

100%
Accepted

Dependency #13:

100%
Accepted

Dependency #14:

100%
Accepted

Dependency #15:

100%
Accepted

Dependency #16:

100%
Accepted

Test #151:

score: 6
Accepted
time: 130ms
memory: 8404kb

input:

300000 300000
999999700006 999999770898 999999701005 999999709476 999999700060 999999700000 999999700000 999999700286 999999700000 999999700000 999999700000 999999700000 999999700000 376961301645 999999700000 999999700000 999999700000 999999700000 311 999999700000 999999700000 999999700401 999999700...

output:

No
No
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Ye...

result:

ok 300000 token(s): yes count is 152890, no count is 147110

Test #152:

score: 6
Accepted
time: 143ms
memory: 8400kb

input:

300000 300000
999999808789 999999725959 999999703995 999999700037 999999726780 999999823439 999999934001 999999700007 329 999999710902 450 999999848087 999999720586 999999701089 999999701689 999999702917 999999700000 999999700670 999999700002 999999700467 999999700003 999999711998 999999700023 99999...

output:

Yes
No
No
No
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
No
Yes
No
Yes
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
No
Yes
Yes
...

result:

ok 300000 token(s): yes count is 161414, no count is 138586

Test #153:

score: 6
Accepted
time: 147ms
memory: 8264kb

input:

300000 300000
650787868285 43 650787341596 650790889570 650787341595 650787342336 650787476642 651190477662 650787342840 43 74 650787341631 651345493963 46 47 650789858793 46 650787342037 650787341596 44 66 650788199191 650787342876 650787341646 49 650787342820 650787341838 650787341599 73 659503599...

output:

No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
N...

result:

ok 300000 token(s): yes count is 161634, no count is 138366

Test #154:

score: 6
Accepted
time: 137ms
memory: 8344kb

input:

300000 300000
8002370006 2 2 999999700011 999999700000 9315427108 999999700917 999999700000 2 999999700332 2 999999810729 999999703630 111472 2 999999810383 7631730450 2 2 2 999999706283 7631763195 999999700004 999999700000 7631722240 999999700000 999999700000 999999997760 7634382572 2 999999744930 ...

output:

No
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
No...

result:

ok 300000 token(s): yes count is 161300, no count is 138700

Test #155:

score: 6
Accepted
time: 141ms
memory: 8360kb

input:

300000 300000
999999796951 999999707698 999999700001 999999700097 999999700008 999999700044 999999701282 999999786728 999999991169 999999700023 999999700000 999999700092 999999700036 999999700023 999999700728 999999700014 999999947014 999999700686 999999700000 999999701757 999999835088 999999700003 ...

output:

Yes
Yes
No
Yes
Yes
Yes
No
No
No
No
No
Yes
No
No
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
N...

result:

ok 300000 token(s): yes count is 161906, no count is 138094

Test #156:

score: 6
Accepted
time: 142ms
memory: 8288kb

input:

300000 300000
6 39325106867 46061146184 7 39325781209 39327615634 57601114407 39453882969 39325087601 7 39325988745 41090773402 40227772410 39325087529 39327366053 39333111980 39325092986 39325787212 45576060206 5 56634443052 39418683084 39358721588 39325094980 39406838334 39325087871 54816862419 39...

output:

No
No
No
Yes
No
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
No
No
No
No
Yes
...

result:

ok 300000 token(s): yes count is 161867, no count is 138133

Test #157:

score: 6
Accepted
time: 123ms
memory: 8376kb

input:

300000 300000
999999700000 264712 999999700000 999999700000 999999700000 149073 151779 999999700528 999999700000 150870 999999700000 999999700000 999999700000 999999700000 999999700000 999999700001 999999700000 999999840670 999999700042 999999700000 999999766100 7 999999700000 999999700000 999999700...

output:

Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
No
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
...

result:

ok 300000 token(s): yes count is 160502, no count is 139498

Test #158:

score: 6
Accepted
time: 107ms
memory: 8288kb

input:

300000 300000
999999700003 1 1 1 1 1 1 1 999999700178 1 1 1 1 1 1 1 1 999999700419 1 1 1 1 1 1 1 1 1 1 1 999999702275 999999704762 1 1 1 1 1 1 1 999999702964 1 1 1 1 1 1 1 1 999999700477 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 999999700023 1 1 1 1 999999709341...

output:

No
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
No
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes...

result:

ok 300000 token(s): yes count is 161654, no count is 138346

Test #159:

score: 6
Accepted
time: 128ms
memory: 8408kb

input:

300000 300000
93081544015 91340529310 8 104557569973 91418169391 91339254281 91339281502 91339261040 6 91339257444 91343674718 91339254281 95076476403 91339256196 91339261638 6 91339292915 9 91339256049 91341654130 91339254935 91339254305 91342063907 6 91339386121 91339254518 91401656733 91365286363...

output:

No
Yes
No
No
Yes
No
No
No
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
No
No
No
Yes
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
No
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
No...

result:

ok 300000 token(s): yes count is 161911, no count is 138089

Test #160:

score: 6
Accepted
time: 127ms
memory: 8368kb

input:

300000 300000
27446271672 999999700000 999999700019 20732833958 999999700000 999999700002 999999700000 999999700000 999999761881 999999700002 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 20958487561 999999700000 999999700000 999999700000 999...

output:

Yes
No
No
Yes
No
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
...

result:

ok 300000 token(s): yes count is 161111, no count is 138889

Test #161:

score: 6
Accepted
time: 139ms
memory: 8280kb

input:

300000 300000
999999728222 999999700259 999999737124 999999814790 999999700006 999999703929 999999700039 999999700565 999999700539 999999705073 999999778132 999999700003 999999700010 999999737664 999999700260 999999700621 999999700444 999999700000 999999893395 999999700015 999999700000 999999700076 ...

output:

No
No
No
Yes
No
No
No
Yes
No
Yes
Yes
No
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Ye...

result:

ok 300000 token(s): yes count is 142835, no count is 157165

Test #162:

score: 6
Accepted
time: 148ms
memory: 8344kb

input:

300000 300000
488841521370 488848787974 40 488841401569 488854951290 488841407381 30 488841401571 488843616460 488841435868 488842298705 488841401574 488942970059 43 488841401570 500132849821 488841401570 488843291347 556356807013 488876469531 488847588561 488846952279 30 488841409515 43 48884140177...

output:

Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
No
No
Yes
No
Yes
Yes
No
No
No
Yes
No
No
No
No
Yes
No
Yes
Yes
Yes
No
No
No
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
No
Yes
No
Yes
Yes
...

result:

ok 300000 token(s): yes count is 161209, no count is 138791

Subtask #18:

score: 18
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Dependency #9:

100%
Accepted

Dependency #10:

100%
Accepted

Dependency #11:

100%
Accepted

Dependency #12:

100%
Accepted

Dependency #13:

100%
Accepted

Dependency #14:

100%
Accepted

Dependency #15:

100%
Accepted

Dependency #16:

100%
Accepted

Dependency #17:

100%
Accepted

Test #163:

score: 18
Accepted
time: 144ms
memory: 8348kb

input:

300000 300000
999999700006 999999770898 999999701005 999999709476 999999700060 999999700000 999999700000 999999700286 999999700000 999999700000 999999700000 999999700000 999999700000 376961301645 999999700000 999999700000 999999700000 999999700000 311 999999700000 999999700000 999999700401 999999700...

output:

No
No
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
Yes
N...

result:

ok 300000 token(s): yes count is 152419, no count is 147581

Test #164:

score: 18
Accepted
time: 166ms
memory: 8364kb

input:

300000 300000
999999808789 999999725959 999999703995 999999700037 999999726780 999999823439 999999934001 999999700007 329 999999710902 450 999999848087 999999720586 999999701089 999999701689 999999702917 999999700000 999999700670 999999700002 999999700467 999999700003 999999711998 999999700023 99999...

output:

Yes
No
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
No...

result:

ok 300000 token(s): yes count is 161052, no count is 138948

Test #165:

score: 18
Accepted
time: 152ms
memory: 8368kb

input:

300000 300000
650787868285 43 650787341596 650790889570 650787341595 650787342336 650787476642 651190477662 650787342840 43 74 650787341631 651345493963 46 47 650789858793 46 650787342037 650787341596 44 66 650788199191 650787342876 650787341646 49 650787342820 650787341838 650787341599 73 659503599...

output:

No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
No
No
No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
No
No
No
No
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
No
No
Yes
No
No
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Y...

result:

ok 300000 token(s): yes count is 161938, no count is 138062

Test #166:

score: 18
Accepted
time: 155ms
memory: 8336kb

input:

300000 300000
8002370006 2 2 999999700011 999999700000 9315427108 999999700917 999999700000 2 999999700332 2 999999810729 999999703630 111472 2 999999810383 7631730450 2 2 2 999999706283 7631763195 999999700004 999999700000 7631722240 999999700000 999999700000 999999997760 7634382572 2 999999744930 ...

output:

No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Ye...

result:

ok 300000 token(s): yes count is 161164, no count is 138836

Test #167:

score: 18
Accepted
time: 158ms
memory: 8352kb

input:

300000 300000
999999796951 999999707698 999999700001 999999700097 999999700008 999999700044 999999701282 999999786728 999999991169 999999700023 999999700000 999999700092 999999700036 999999700023 999999700728 999999700014 999999947014 999999700686 999999700000 999999701757 999999835088 999999700003 ...

output:

Yes
Yes
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
No
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
No
Yes
No
Yes
No
No
No
No
No
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
No
No
Yes
No
No
Yes...

result:

ok 300000 token(s): yes count is 161562, no count is 138438

Test #168:

score: 18
Accepted
time: 146ms
memory: 8420kb

input:

300000 300000
6 39325106867 46061146184 7 39325781209 39327615634 57601114407 39453882969 39325087601 7 39325988745 41090773402 40227772410 39325087529 39327366053 39333111980 39325092986 39325787212 45576060206 5 56634443052 39418683084 39358721588 39325094980 39406838334 39325087871 54816862419 39...

output:

Yes
No
No
No
Yes
No
Yes
No
Yes
No
No
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
No
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
No
Y...

result:

ok 300000 token(s): yes count is 161419, no count is 138581

Test #169:

score: 18
Accepted
time: 151ms
memory: 8284kb

input:

300000 300000
999999700000 264712 999999700000 999999700000 999999700000 149073 151779 999999700528 999999700000 150870 999999700000 999999700000 999999700000 999999700000 999999700000 999999700001 999999700000 999999840670 999999700042 999999700000 999999766100 7 999999700000 999999700000 999999700...

output:

No
No
No
No
Yes
Yes
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
No
No
Yes
No
No
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Y...

result:

ok 300000 token(s): yes count is 160915, no count is 139085

Test #170:

score: 18
Accepted
time: 127ms
memory: 8244kb

input:

300000 300000
999999700003 1 1 1 1 1 1 1 999999700178 1 1 1 1 1 1 1 1 999999700419 1 1 1 1 1 1 1 1 1 1 1 999999702275 999999704762 1 1 1 1 1 1 1 999999702964 1 1 1 1 1 1 1 1 999999700477 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 999999700023 1 1 1 1 999999709341...

output:

No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
No...

result:

ok 300000 token(s): yes count is 161723, no count is 138277

Test #171:

score: 18
Accepted
time: 153ms
memory: 8336kb

input:

300000 300000
93081544015 91340529310 8 104557569973 91418169391 91339254281 91339281502 91339261040 6 91339257444 91343674718 91339254281 95076476403 91339256196 91339261638 6 91339292915 9 91339256049 91341654130 91339254935 91339254305 91342063907 6 91339386121 91339254518 91401656733 91365286363...

output:

No
No
Yes
No
Yes
Yes
No
No
Yes
Yes
No
Yes
Yes
No
Yes
No
No
No
Yes
No
No
Yes
Yes
No
Yes
No
No
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
No
Yes
No
No
Yes
No
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
...

result:

ok 300000 token(s): yes count is 161646, no count is 138354

Test #172:

score: 18
Accepted
time: 150ms
memory: 8408kb

input:

300000 300000
27446271672 999999700000 999999700019 20732833958 999999700000 999999700002 999999700000 999999700000 999999761881 999999700002 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 999999700000 20958487561 999999700000 999999700000 999999700000 999...

output:

No
No
Yes
No
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Ye...

result:

ok 300000 token(s): yes count is 161493, no count is 138507

Test #173:

score: 18
Accepted
time: 154ms
memory: 8292kb

input:

300000 300000
999999728222 999999700259 999999737124 999999814790 999999700006 999999703929 999999700039 999999700565 999999700539 999999705073 999999778132 999999700003 999999700010 999999737664 999999700260 999999700621 999999700444 999999700000 999999893395 999999700015 999999700000 999999700076 ...

output:

Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No
No
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
No
Yes
No
No
No
Yes
Yes
No
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes...

result:

ok 300000 token(s): yes count is 143369, no count is 156631

Test #174:

score: 18
Accepted
time: 156ms
memory: 8344kb

input:

300000 300000
488841521370 488848787974 40 488841401569 488854951290 488841407381 30 488841401571 488843616460 488841435868 488842298705 488841401574 488942970059 43 488841401570 500132849821 488841401570 488843291347 556356807013 488876469531 488847588561 488846952279 30 488841409515 43 48884140177...

output:

Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
Yes
No
No
No
Yes
Yes
No
No
No
Yes
No
No
Yes
No
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
No
No
No
No
Yes
Yes
Yes
No
No
Ye...

result:

ok 300000 token(s): yes count is 162044, no count is 137956

Extra Test:

score: 0
Extra Test Passed