QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#694405#8140. Customs Controls 2MaxDYF#AC ✓100ms34984kbC++232.1kb2024-10-31 17:53:142024-10-31 17:53:15

Judging History

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

  • [2024-10-31 17:53:15]
  • 评测
  • 测评结果:AC
  • 用时:100ms
  • 内存:34984kb
  • [2024-10-31 17:53:14]
  • 提交

answer

#include<stdio.h>
#include<string.h>
#include<vector>
#include<algorithm>
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int word;
typedef unsigned char byte;
struct READ{
	char c,w;
	inline READ(){c=getchar();}
	template<typename type>
	inline READ& operator>>(type &num){
		for(w=1;'0'>c||c>'9';c=getchar())
			w=c=='-'? -1:1;
		for(num=0;'0'<=c&&c<='9';c=getchar())
			num=num*10+(c-'0');
		return num*=w,*this;
	}
}cin;
word case_,n,m,top;
const word nsiz=2e5+10,msiz=1<<19;
std::vector<word> from[nsiz],to[nsiz],block[nsiz];
word fsiz[nsiz],dis[nsiz];
struct union_{
	word fa[nsiz],size[nsiz];
	inline void clear(){
		for(word i=1;i<=n;++i){
			fa[i]=i,size[i]=1;
			fsiz[i]=dis[i]=0;
			from[i].clear(),to[i].clear();
			block[i].clear();
		}
	}
	inline word find(word id){
		if(fa[id]==id) return id;
		return fa[id]=find(fa[id]);
	}
	inline void merge(word u,word v){
		if(u=find(u),v=find(v),u!=v){
			if(size[u]<size[v]) fa[u]=v,size[v]+=size[u];
			else fa[v]=u,size[u]+=size[v];
		}
		
	}
}_union;
inline void dfs(word id){
	dis[id]=++top;
	for(auto &p:block[id])
		for(auto &i:to[p]){
			const word nxt=_union.find(i);
			if(--fsiz[nxt]==0) dfs(nxt);
		}
}
int main(){
	for(cin>>case_;case_;--case_){
		cin>>n>>m,top=0,_union.clear();
		for(word i=1,u,v;i<=m;++i){
			cin>>u>>v;
			to[u].push_back(v);
			from[v].push_back(u);
		}
		for(word id=1;id<=n;++id)
			for(auto& i:from[id])
				_union.merge(from[id][0],i);
		for(word id=1;id<=n;++id)
			block[_union.find(id)].push_back(id);
		for(word id=1;id<=n;++id)
			if(_union.find(id)==id)
				for(auto &p:block[id])
					for(auto &i:to[p]) 
						++fsiz[_union.find(i)];
		if(_union.size[_union.find(1)]!=1||fsiz[1]){
			puts("No");
			continue;
		}
		dfs(_union.find(1));
		bool b=0;
		for(word id=1;id<=n;++id)
			if(_union.find(id)==id&&dis[id]==0) b=1;
		if(b) puts("No");
		else{
			printf("Yes\n1");
			for(word id=2;id<=n;++id)
				printf(" %u",dis[_union.find(id)]-dis[_union.find(from[id][0])]);
			putchar('\n');
		}
	}
	return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 5968kb

input:

2
3 3
1 2
1 3
2 3
8 9
1 2
1 3
1 4
2 5
3 6
4 7
5 8
6 8
7 8

output:

No
Yes
1 1 2 3 3 2 1 1

result:

ok ok (2 test cases)

Test #2:

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

input:

2
11 16
1 2
1 3
1 4
1 5
2 6
4 6
3 7
4 7
5 8
6 8
2 9
3 9
7 10
8 10
9 11
10 11
8 10
1 2
1 3
2 4
3 5
3 6
4 6
2 7
5 7
6 8
7 8

output:

Yes
1 1 1 1 2 1 2 1 3 1 1
No

result:

ok ok (2 test cases)

Test #3:

score: 0
Accepted
time: 1ms
memory: 5768kb

input:

1
8 10
1 2
1 3
2 4
3 5
3 6
4 6
2 7
5 7
6 8
7 8

output:

No

result:

ok ok (1 test case)

Test #4:

score: 0
Accepted
time: 1ms
memory: 3824kb

input:

1
11 16
1 2
1 3
1 4
1 5
2 6
4 6
3 7
4 7
5 8
6 8
2 9
3 9
7 10
8 10
9 11
10 11

output:

Yes
1 1 1 1 2 1 2 1 3 1 1

result:

ok ok (1 test case)

Test #5:

score: 0
Accepted
time: 1ms
memory: 3724kb

input:

1
3 3
1 2
1 3
2 3

output:

No

result:

ok ok (1 test case)

Test #6:

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

input:

1
15 24
1 3
1 7
1 6
1 12
3 11
3 5
3 13
3 14
3 8
7 11
7 13
7 14
11 2
11 10
6 9
5 9
13 9
14 4
8 4
2 4
10 4
9 4
12 15
4 15

output:

Yes
1 2 1 1 2 3 1 3 1 2 1 5 2 3 1

result:

ok ok (1 test case)

Test #7:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

10
20 40
1 8
1 11
1 19
8 7
8 16
8 15
8 14
8 4
8 17
11 5
11 6
11 2
11 3
7 6
7 2
7 3
16 9
16 12
15 9
15 12
14 9
4 18
4 10
5 13
5 10
6 18
6 10
2 13
2 18
3 18
3 10
9 13
9 10
12 13
12 10
19 20
17 20
13 20
18 20
10 20
20 30
8 19
19 12
5 12
5 10
10 4
18 4
18 14
14 6
15 6
15 7
7 3
17 3
17 2
2 16
9 16
9 11
1...

output:

Yes
1 1 1 3 1 1 2 1 2 1 3 2 1 1 1 1 4 1 5 1
No
Yes
1 1 1 5 5 1 3 2 2 2 4 4 5 3 2 1 1 2 1 1
Yes
1 3 5 5 4 2 3 6 3 1 1 1 3 1 1 1 3 1 2 1
Yes
1 4 1 1 1 1 3 2 1 2 4 1 1 2 3 4 2 1 2 1
Yes
1 1 1 2 3 1 1 2 2 3 1 1 4 5 1 4 2 2 2 1
Yes
1 2 1 1 2 2 1 2 3 4 2 2 1 4 1 3 6 1 1 1
No
Yes
1 1 3 1 3 2 2 1 1 1 3 2 3 ...

result:

ok ok (10 test cases)

Test #8:

score: 0
Accepted
time: 3ms
memory: 4412kb

input:

10
1919 3195
1888 1186
1186 519
1514 519
1514 859
859 1634
977 1634
977 185
185 1250
1103 1250
1103 463
463 1683
426 1683
426 1728
1728 1402
1612 1402
1612 1789
1789 857
586 857
586 1669
1669 1376
1833 1376
1833 1076
1076 749
733 749
733 551
551 217
1717 217
1717 862
862 319
96 319
96 479
479 1381
1...

output:

No
Yes
1 51 2 23 30 20 35 27 43 35 57 13 46 6 26 12 1 51 30 32 61 20 27 15 1 1 3 41 15 31 6 11 56 2 13 58 43 35 38 50 1 53 13 42 42 23 43 6 19 25 13 9 76 13 3 62 17 29 25 22 15 24 38 23 9 70 26 2 26 27 26 3 37 14 70 67 68 72 20 54 23 63 5 52 30 14 48 47 65 17 20 29 37 5 15 23 22 15 4 3 14 26 68 21 2...

result:

ok ok (10 test cases)

Test #9:

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

input:

1
181547 488264
1 172537
1 90998
1 88110
1 96832
1 114889
1 33910
1 88129
1 70671
1 63339
1 48928
1 87572
1 34438
1 159256
1 173984
1 91374
1 89583
1 47960
1 93777
1 44079
1 132241
1 85083
1 99617
1 160839
1 157126
1 178514
1 70706
1 13530
1 168869
1 29354
1 11630
1 123518
1 86921
1 19627
1 126118
1...

output:

Yes
1 1160 1529 303 642 151 1774 506 1053 741 176 170 738 917 763 1350 961 1420 793 607 687 131 253 260 806 502 521 399 439 614 271 190 319 450 1421 1749 1625 1050 1470 176 1640 1436 216 431 1589 2070 621 2109 623 707 305 366 1416 405 592 897 131 30 543 1344 701 1039 2016 89 504 1853 556 1721 631 80...

result:

ok ok (1 test case)

Test #10:

score: 0
Accepted
time: 58ms
memory: 32576kb

input:

1
180842 301400
100472 98062
98062 152871
139599 152871
139599 97417
97417 138150
99214 138150
99214 110823
110823 179307
54096 179307
54096 169504
169504 60019
92807 60019
92807 176799
176799 10766
51615 10766
51615 85235
85235 110883
72664 110883
72664 81826
81826 151507
21410 151507
21410 148464
...

output:

No

result:

ok ok (1 test case)

Test #11:

score: 0
Accepted
time: 92ms
memory: 33640kb

input:

1
195719 496023
1 37447
1 94499
1 93445
1 159134
1 9294
1 28312
1 159443
1 12198
1 175523
1 167569
1 182624
1 61106
1 109758
1 83799
1 70857
1 180981
1 90329
1 63481
1 5198
1 54301
1 29404
1 77383
1 193083
1 48588
1 143999
1 189809
1 102318
1 39109
1 50191
1 18419
1 162337
1 16535
1 8472
1 168713
1 ...

output:

Yes
1 788 389 60 313 431 30 386 457 459 141 448 49 529 586 19 358 322 445 897 290 382 767 140 684 641 34 446 120 536 469 416 424 468 552 154 647 184 112 139 152 202 3 782 718 676 497 145 87 127 211 13 467 505 12 393 490 401 442 579 316 598 93 798 339 75 299 733 146 104 479 481 40 517 637 562 232 296...

result:

ok ok (1 test case)

Test #12:

score: 0
Accepted
time: 37ms
memory: 34984kb

input:

1
195881 326465
4835 48280
48280 145430
69556 145430
69556 139594
139594 100169
113695 100169
113695 9721
9721 159758
45959 159758
45959 138631
138631 105525
161337 105525
161337 145825
145825 13840
115797 13840
115797 192352
192352 59986
147016 59986
147016 106035
106035 42785
87638 42785
87638 102...

output:

No

result:

ok ok (1 test case)

Test #13:

score: 0
Accepted
time: 100ms
memory: 32868kb

input:

1
200000 498030
1 61309
1 80811
1 159457
1 53775
1 53080
1 73194
1 50600
1 182243
1 70727
1 55494
1 86417
1 159878
1 131249
1 24024
1 131422
1 152466
1 61113
1 30222
1 199135
1 117959
1 27855
1 195292
1 181094
1 16962
1 123395
1 114071
1 116743
1 198435
1 182160
1 170066
1 142336
1 158861
1 83699
1 ...

output:

Yes
1 191 126 110 50 24 70 405 59 308 117 115 63 278 386 263 466 110 202 417 157 164 131 271 114 368 114 49 62 68 153 197 186 115 35 72 118 26 84 352 293 297 230 488 79 209 1 78 226 120 167 480 149 337 178 327 10 143 233 43 286 205 80 87 247 223 70 147 392 351 214 73 31 128 391 167 22 178 389 114 25...

result:

ok ok (1 test case)

Test #14:

score: 0
Accepted
time: 94ms
memory: 34124kb

input:

1
200000 496308
1 67125
1 87884
1 23447
1 175546
1 183274
1 9684
1 115668
1 110230
1 115021
1 162717
1 101513
1 182387
1 118073
1 43089
1 37679
1 125719
1 149180
1 181735
1 118142
1 29
1 92393
1 16214
1 75575
1 51852
1 85094
1 131713
1 122543
1 28961
1 10685
1 128461
1 57196
1 141573
1 80411
1 39767...

output:

Yes
1 477 361 143 633 497 245 658 739 470 758 793 181 795 325 64 397 574 425 204 135 150 351 690 145 1 201 493 54 599 264 334 243 429 683 535 207 245 147 79 537 11 417 211 332 161 758 129 256 1 115 447 585 794 272 11 266 476 108 38 624 35 623 3 505 602 872 136 81 255 84 26 169 619 98 118 336 87 417 ...

result:

ok ok (1 test case)

Test #15:

score: 0
Accepted
time: 97ms
memory: 34884kb

input:

1
200000 494647
1 40292
1 144979
1 143414
1 20633
1 103476
1 41901
1 54942
1 7709
1 13011
1 183194
1 10687
1 173540
1 46370
1 199713
1 197513
1 164369
1 56771
1 188738
1 191416
1 134766
1 174253
1 189997
1 62461
1 77816
1 155675
1 53293
1 73007
1 123351
1 73328
1 134584
1 192547
1 94713
1 87884
1 16...

output:

Yes
1 863 614 163 178 84 361 597 554 360 78 428 842 669 502 525 486 498 448 350 1 216 445 224 737 215 627 213 395 480 946 523 350 327 266 159 163 398 831 898 328 370 473 291 670 89 548 1178 88 998 521 456 492 589 972 643 243 244 293 12 715 164 1245 670 1077 1122 51 236 199 462 262 1006 37 255 978 30...

result:

ok ok (1 test case)

Test #16:

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

input:

1
196815 497583
1 155797
1 193300
1 125537
1 194998
1 189169
1 149571
1 81372
1 129406
1 85598
1 187825
1 36566
1 180012
1 10823
1 62405
1 46314
1 4001
1 61376
1 137856
1 42774
1 129337
1 35178
1 102964
1 174069
1 101483
1 121457
1 153968
1 77937
1 99096
1 155052
1 58925
1 36248
1 14075
1 57233
1 76...

output:

Yes
1 115 153 140 13 33 18 78 273 481 384 5 39 107 86 14 128 156 8 203 147 315 231 407 151 426 2 112 23 98 495 370 88 107 348 181 277 178 236 300 81 282 276 150 226 173 516 191 323 297 139 377 36 482 3 281 343 344 19 284 12 225 567 134 51 287 81 61 54 180 11 99 19 418 93 479 146 123 41 322 92 335 14...

result:

ok ok (1 test case)

Test #17:

score: 0
Accepted
time: 56ms
memory: 15048kb

input:

4
50000 99992
1 37052
1 42568
1 64
1 29389
1 33625
1 45029
1 29776
1 14888
1 15856
1 34822
1 42758
1 45081
1 41042
1 18758
1 22373
1 2232
1 48245
1 8335
1 30504
1 24566
1 43294
1 48483
1 17157
1 45811
1 13014
1 11847
1 19635
1 22669
1 46134
1 12982
1 30977
1 26649
1 17344
1 41235
1 6192
1 12638
1 25...

output:

Yes
1 143 36 16 32 68 24 173 56 209 15 93 7 43 20 201 33 46 124 47 54 63 99 28 76 65 61 98 151 148 77 78 134 93 85 146 74 181 56 95 118 56 15 184 75 93 246 20 152 62 137 135 144 6 68 40 98 126 80 111 140 157 169 1 129 122 160 219 196 98 41 197 138 36 159 257 63 58 74 49 34 25 114 159 208 191 55 75 8...

result:

ok ok (4 test cases)

Test #18:

score: 0
Accepted
time: 56ms
memory: 15024kb

input:

4
50000 99987
1 26348
1 28062
1 21534
1 42614
1 37721
1 47094
1 26341
1 48507
1 30205
1 18544
1 22338
1 11500
1 36134
1 49034
1 3366
1 333
1 21428
1 34175
1 25082
1 14845
1 46041
1 41371
1 45461
1 43435
1 16198
1 27448
1 20195
1 41680
1 30051
1 27745
1 44032
1 26376
1 31540
1 39763
1 22578
1 33250
1...

output:

Yes
1 89 20 78 132 120 133 79 276 247 9 102 267 17 40 151 97 64 67 86 114 8 15 8 77 238 97 112 202 80 132 3 58 176 206 162 26 127 148 208 79 297 58 121 159 34 48 5 129 66 89 30 159 15 88 101 29 30 180 228 105 123 26 53 123 99 48 197 77 100 1 23 76 1 99 72 124 62 140 23 155 230 89 214 85 135 300 107 ...

result:

ok ok (4 test cases)

Test #19:

score: 0
Accepted
time: 47ms
memory: 15516kb

input:

4
46544 77570
5146 33799
33799 24403
20994 24403
20994 6976
6976 17268
23793 17268
23793 34344
34344 3356
43440 3356
43440 44237
44237 10294
28698 10294
28698 39637
39637 18139
35928 18139
35928 44391
44391 33265
1826 33265
1826 6813
6813 10489
14783 10489
14783 39250
39250 3550
43164 3550
43164 516...

output:

No
Yes
1 114 105 202 20 78 145 197 247 241 74 259 175 3 121 177 126 80 108 24 86 96 24 169 169 93 95 170 103 93 211 152 114 86 136 118 83 159 30 8 277 46 94 43 122 44 32 239 35 122 63 157 124 60 45 125 165 102 127 101 37 49 310 124 109 194 116 63 20 135 285 29 91 243 183 138 115 124 122 94 137 95 17...

result:

ok ok (4 test cases)

Test #20:

score: 0
Accepted
time: 60ms
memory: 13636kb

input:

4
50000 99982
1 44586
1 26416
1 13734
1 14946
1 15582
1 48832
1 48946
1 49537
1 2997
1 44139
1 38283
1 42638
1 45750
1 30506
1 42989
1 4251
1 47124
1 11832
1 46680
1 17060
1 31444
1 17322
1 44148
1 45927
1 19806
1 45126
1 10678
1 34979
1 33116
1 19659
1 19963
1 47207
1 38543
1 23992
1 47547
1 30810
...

output:

Yes
1 148 45 71 188 46 74 246 90 269 195 284 320 120 275 6 20 57 10 4 103 352 49 46 114 67 70 139 134 168 28 175 173 210 59 19 270 79 209 306 205 107 88 335 325 109 261 55 73 63 238 123 179 238 167 154 112 209 120 188 48 122 118 96 271 60 41 167 125 90 11 4 27 92 96 69 177 85 315 155 4 282 14 261 22...

result:

ok ok (4 test cases)

Test #21:

score: 0
Accepted
time: 59ms
memory: 15292kb

input:

4
48440 80730
20510 37086
37086 41968
37277 41968
37277 32029
32029 12807
4350 12807
4350 5096
5096 13315
233 13315
233 26078
26078 39649
34279 39649
34279 30398
30398 19295
35076 19295
35076 10210
10210 23140
40175 23140
40175 24651
24651 10464
6146 10464
6146 20178
20178 6945
32095 6945
32095 398
...

output:

No
Yes
1 114 129 185 42 37 24 34 129 7 34 82 75 181 54 2 70 104 118 1 84 41 91 45 57 31 111 79 172 109 162 39 9 84 49 62 152 27 138 135 47 178 184 100 20 31 166 111 132 113 69 1 27 11 40 109 69 208 79 7 7 138 156 194 112 15 142 130 148 113 52 15 84 83 38 37 105 83 148 15 34 85 82 56 74 37 101 31 31 ...

result:

ok ok (4 test cases)

Test #22:

score: 0
Accepted
time: 60ms
memory: 15064kb

input:

4
50000 99978
1 28364
1 35612
1 47359
1 13620
1 30756
1 11913
1 7196
1 38786
1 30188
1 48614
1 13513
1 49242
1 2768
1 8699
1 24695
1 44809
1 28800
1 42856
1 416
1 44350
1 35045
1 26340
1 6524
1 39330
1 19440
1 31508
1 37508
1 25780
1 3393
1 41409
1 28384
1 11978
1 6137
1 3202
1 15895
1 44535
1 2860
...

output:

Yes
1 39 191 145 385 301 198 187 229 328 235 72 56 54 258 134 343 300 7 17 191 386 47 312 168 278 12 152 102 227 447 475 344 241 267 162 35 66 97 4 100 385 94 162 266 249 267 241 14 158 196 152 208 225 18 19 13 239 227 331 39 388 60 258 228 427 28 354 435 296 98 246 311 3 105 158 2 194 435 33 85 146...

result:

ok ok (4 test cases)

Test #23:

score: 0
Accepted
time: 40ms
memory: 13336kb

input:

4
45901 99522
1 18883
1 16169
1 24663
1 35800
1 39712
1 43438
1 44701
1 30656
1 38898
1 40326
1 43301
1 25369
1 42501
1 35809
1 10640
1 9339
1 38562
1 42600
1 158
1 21847
1 19980
1 20090
1 32169
1 8928
1 16065
1 6917
1 35776
1 45788
1 32598
1 17405
1 798
1 25226
1 8067
1 24647
1 5083
1 14754
1 4293
...

output:

Yes
1 119 229 36 282 73 248 37 24 20 416 263 202 247 154 153 40 145 187 239 54 321 102 35 29 89 345 109 345 155 73 24 312 209 125 66 20 113 58 36 47 17 146 267 117 130 5 195 205 194 66 73 206 1 84 288 267 113 164 244 243 159 78 72 219 12 67 30 41 119 34 248 185 292 34 41 24 169 194 98 37 8 138 199 2...

result:

ok ok (4 test cases)

Test #24:

score: 0
Accepted
time: 63ms
memory: 15256kb

input:

4
50000 99561
1 9493
1 4375
1 19778
1 17185
1 47877
1 20599
1 9768
1 37858
1 15658
1 13556
1 5845
1 38836
1 14046
1 30325
1 19245
1 11055
1 45732
1 40427
1 18069
1 2936
1 5434
1 14846
1 15104
1 762
1 16135
1 28604
1 45416
1 865
1 33562
1 4793
1 17457
1 43485
1 15706
1 37883
1 21892
1 39920
1 8477
1 ...

output:

Yes
1 550 1537 517 156 1521 944 278 73 1508 153 275 1571 369 383 199 445 453 328 2041 784 117 940 1206 677 538 356 1302 222 1687 171 352 106 1869 58 251 1551 1241 166 195 1196 1920 478 1477 593 570 172 193 1324 1096 391 2120 440 167 254 803 1 90 243 1809 1145 1155 575 744 339 1330 554 817 1221 645 1...

result:

ok ok (4 test cases)

Test #25:

score: 0
Accepted
time: 42ms
memory: 10920kb

input:

10
20000 49560
1 12421
1 18824
1 7063
1 6144
1 18228
1 10289
1 18844
1 16226
1 16484
1 15230
1 1325
1 9893
1 8118
1 6648
1 18994
1 14612
1 18502
1 3075
1 9636
1 914
1 2702
1 8055
1 15865
1 5437
1 13614
1 5111
1 3875
1 19395
1 19759
1 4084
1 6443
1 14246
1 6291
1 17649
1 12872
1 9223
1 9642
1 16067
1...

output:

Yes
1 62 37 39 39 58 46 2 35 92 30 28 43 30 29 8 58 47 4 69 41 59 51 86 34 128 36 84 81 58 69 77 54 127 63 12 31 90 9 7 91 11 16 44 82 13 54 91 28 142 6 37 138 17 25 14 55 8 80 76 8 15 23 84 117 69 101 18 3 32 41 38 23 78 116 113 99 107 57 1 126 66 35 115 26 38 1 55 65 137 107 87 13 48 40 100 100 9 ...

result:

ok ok (10 test cases)

Test #26:

score: 0
Accepted
time: 47ms
memory: 10940kb

input:

10
20000 49107
1 2585
1 5845
1 8900
1 17326
1 5237
1 7619
1 6910
1 5560
1 7767
1 13249
1 16441
1 4223
1 8764
1 7632
1 14152
1 5888
1 17688
1 6705
1 18011
1 5206
1 2533
1 4756
1 9396
1 14175
1 10340
1 13664
1 2459
1 15061
1 4081
1 7025
1 4435
1 9
1 19720
1 7035
1 7721
1 9669
1 8989
1 11217
1 9496
1 8...

output:

Yes
1 94 204 206 22 204 57 143 65 162 124 113 216 74 14 33 191 200 169 113 125 215 189 209 10 25 146 50 189 195 76 8 49 99 58 208 49 69 153 69 8 138 89 115 49 11 22 138 126 36 78 11 130 252 84 138 4 100 60 42 67 24 62 99 159 93 41 225 130 13 241 267 89 245 219 120 25 6 20 75 147 166 44 59 133 114 45...

result:

ok ok (10 test cases)

Test #27:

score: 0
Accepted
time: 50ms
memory: 9108kb

input:

10
20000 49355
1 7470
1 7577
1 9444
1 15558
1 7425
1 3863
1 17023
1 11796
1 6149
1 11714
1 6227
1 3974
1 2051
1 12472
1 162
1 846
1 13731
1 18883
1 3493
1 6308
1 2308
1 12711
1 711
1 3217
1 3536
1 6648
1 3836
1 15134
1 18111
1 8632
1 7968
1 2318
1 584
1 10247
1 11066
1 15015
1 3315
1 15121
1 9663
1 ...

output:

Yes
1 109 153 12 67 66 1 57 150 126 5 55 120 52 135 25 87 80 1 42 93 90 29 113 55 24 36 73 124 139 126 60 87 151 26 129 33 31 2 49 57 139 129 81 132 21 41 34 51 87 127 56 28 67 121 50 22 163 140 33 53 166 42 87 37 37 19 142 8 80 106 38 31 31 38 69 170 20 59 33 40 21 82 111 17 101 138 62 139 75 64 10...

result:

ok ok (10 test cases)

Test #28:

score: 0
Accepted
time: 55ms
memory: 9112kb

input:

10
20000 49306
1 7640
1 19539
1 10600
1 7349
1 8170
1 17293
1 3327
1 1538
1 10166
1 961
1 4723
1 10857
1 15980
1 4810
1 11977
1 16853
1 14175
1 3467
1 17354
1 15184
1 19601
1 12222
1 4953
1 3699
1 2097
1 4341
1 11166
1 16802
1 10024
1 6743
1 14735
1 3824
1 9205
1 727
1 2759
1 2973
1 15939
1 1566
1 1...

output:

Yes
1 79 6 148 35 78 9 20 111 78 125 30 42 87 80 117 7 38 162 57 117 59 92 73 162 79 32 33 95 58 37 28 23 112 124 12 112 64 72 91 113 83 39 38 48 59 72 75 103 136 7 77 19 118 31 108 61 8 130 76 67 51 21 136 103 132 59 106 34 34 96 61 114 82 113 47 88 62 134 10 65 194 65 31 40 47 30 130 49 134 132 2 ...

result:

ok ok (10 test cases)

Test #29:

score: 0
Accepted
time: 49ms
memory: 8968kb

input:

10
20000 49519
1 8235
1 7650
1 3118
1 17111
1 15781
1 16102
1 19721
1 17353
1 2190
1 10928
1 10843
1 18647
1 17340
1 9304
1 8101
1 7939
1 16815
1 1635
1 14666
1 8181
1 11412
1 109
1 16165
1 3710
1 10306
1 17420
1 6735
1 2471
1 2099
1 2308
1 4171
1 6075
1 3641
1 10159
1 7087
1 2055
1 5638
1 12576
1 2...

output:

Yes
1 4 9 31 88 19 91 38 26 2 11 8 63 56 33 36 88 23 62 1 81 108 65 113 2 102 23 61 8 47 22 89 46 111 49 93 23 65 91 44 123 72 33 97 70 5 19 107 47 39 1 45 100 13 25 34 43 4 14 34 72 29 29 15 13 10 65 51 1 10 29 19 11 44 80 23 64 95 50 36 25 3 93 31 26 33 6 66 24 71 62 12 8 124 84 80 61 40 37 36 6 3...

result:

ok ok (10 test cases)

Test #30:

score: 0
Accepted
time: 51ms
memory: 11068kb

input:

10
19817 33025
8702 12298
12298 8087
14391 8087
14391 15275
15275 13489
7589 13489
7589 13828
13828 17626
13759 17626
13759 15568
15568 7861
7560 7861
7560 1415
1415 3704
16988 3704
16988 7209
7209 11660
3746 11660
3746 537
537 18694
9263 18694
9263 7359
7359 15346
11798 15346
11798 794
794 10169
18...

output:

No
No
Yes
1 97 94 4 37 4 58 32 53 69 94 1 15 74 112 95 26 75 83 47 71 55 49 21 57 44 40 114 79 10 90 20 30 18 56 94 88 23 36 79 6 100 125 65 38 33 150 20 100 78 1 30 81 45 82 2 12 118 60 18 109 101 27 116 38 59 8 68 30 123 61 69 107 90 4 41 35 73 53 94 141 139 4 159 63 75 24 93 138 56 78 10 19 63 55...

result:

ok ok (10 test cases)

Test #31:

score: 0
Accepted
time: 50ms
memory: 9184kb

input:

10
20000 46778
1 17666
1 9583
1 11152
1 10784
1 1976
1 530
1 16681
1 15370
1 5019
1 18392
1 1399
1 488
1 454
1 16246
1 13133
1 3027
1 18304
1 15782
1 768
1 14823
1 13200
1 7920
1 346
1 6059
1 13204
1 9737
1 7592
1 19616
1 2964
1 9331
1 14593
1 7052
1 602
1 12049
1 15523
1 9925
1 3494
1 15517
1 18307...

output:

Yes
1 171 468 337 203 167 198 1135 490 150 730 389 227 532 1 279 727 541 432 244 447 14 135 444 81 147 1094 40 52 1143 158 256 256 618 1088 716 378 893 4 43 590 6 771 951 341 1020 975 658 920 681 557 500 240 277 291 143 36 462 658 797 928 581 351 311 163 92 280 174 362 256 82 69 849 546 3 284 2 808 ...

result:

ok ok (10 test cases)

Test #32:

score: 0
Accepted
time: 44ms
memory: 10692kb

input:

10
18919 48489
1 5647
1 13440
1 9257
1 2479
1 7324
1 18716
1 5839
1 7538
1 2868
1 18485
1 3031
1 14830
1 3522
1 11211
1 10343
1 15329
1 4888
1 17703
1 342
1 18032
1 14491
1 8520
1 13101
1 4569
1 6716
1 16225
1 4159
1 5545
1 13225
1 11735
1 16867
1 7687
1 3712
1 3458
1 9859
1 11566
1 14696
1 7612
1 6...

output:

Yes
1 38 117 31 110 46 272 178 153 92 33 186 329 88 69 207 229 206 138 24 338 84 204 32 27 19 288 380 156 223 166 128 202 14 256 300 221 218 28 10 27 42 158 248 310 69 153 12 234 1 114 319 133 100 17 329 205 51 206 49 117 303 58 49 356 26 94 169 148 124 223 296 284 63 8 67 64 64 260 7 203 43 57 148 ...

result:

ok ok (10 test cases)

Test #33:

score: 0
Accepted
time: 31ms
memory: 8036kb

input:

40
5000 11814
1 3958
1 4783
1 1625
1 4971
1 2666
1 4347
1 4726
1 983
1 3194
1 3690
1 2027
1 3165
1 2524
1 3054
1 2784
1 2288
1 954
1 3066
1 4592
1 3744
1 894
1 3044
1 4129
1 4206
1 4340
1 1312
1 282
1 407
1 4190
1 980
1 2100
1 1245
1 600
1 2680
1 4984
1 1058
1 2320
1 4736
1 1835
1 772
1 3850
1 3434
...

output:

Yes
1 41 2 28 35 97 52 2 71 152 17 96 125 136 144 26 70 69 230 32 30 162 97 98 2 64 84 55 98 65 14 52 86 39 93 137 32 162 99 114 193 178 8 7 15 1 153 44 120 46 63 175 83 6 132 73 112 230 163 80 147 10 34 94 158 97 45 24 47 183 128 65 147 117 4 129 87 6 65 3 36 52 151 50 70 20 35 207 7 32 156 144 21 ...

result:

ok ok (40 test cases)

Test #34:

score: 0
Accepted
time: 37ms
memory: 5924kb

input:

40
4721 7865
3857 3817
3817 3296
3963 3296
3963 4111
4111 475
257 475
257 1447
1447 4646
2028 4646
2028 3185
3185 3622
4651 3622
4651 1160
1160 1260
2044 1260
2044 2212
2212 4504
3886 4504
3886 1332
1332 2499
526 2499
526 2467
2467 924
3996 924
3996 1185
1185 4187
1816 4187
1816 307
307 3579
220 357...

output:

No
Yes
1 254 75 341 3 95 61 219 1 247 37 14 396 41 333 212 215 107 332 269 117 69 368 209 26 253 365 292 35 89 22 1 31 106 33 48 319 1 144 204 79 239 426 271 40 64 256 307 98 167 15 2 276 156 28 61 87 110 127 367 14 125 81 95 59 189 15 152 238 117 23 62 10 112 161 342 6 44 1 245 71 321 126 105 114 2...

result:

ok ok (40 test cases)

Test #35:

score: 0
Accepted
time: 41ms
memory: 7980kb

input:

40
4764 12096
1 4578
1 3298
1 4612
1 3807
1 3223
1 2526
1 2712
1 3568
1 1422
1 4727
1 4155
1 3080
1 659
1 3218
1 3075
1 3893
1 458
1 1821
1 587
1 4675
1 816
1 533
1 148
1 928
1 4335
1 3122
1 4506
1 3792
1 3766
1 2912
1 3651
1 2310
1 3119
1 2038
1 2452
1 1449
1 2758
1 1975
1 2962
1 4657
1 3038
1 2371...

output:

Yes
1 35 4 49 72 74 64 15 18 12 51 16 11 6 45 46 17 9 55 12 21 9 79 2 9 1 96 13 43 30 64 69 36 13 14 22 15 20 47 89 46 99 52 7 48 2 75 86 28 52 19 49 43 29 7 4 80 26 17 81 11 47 15 8 54 72 61 68 38 8 31 9 11 82 62 58 16 76 65 49 39 33 40 37 36 41 76 28 58 44 110 16 9 5 5 37 91 63 8 64 66 5 8 12 29 3...

result:

ok ok (40 test cases)

Test #36:

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

input:

40
4778 7960
2767 1868
1868 1252
1808 1252
1808 1426
1426 2084
4736 2084
4736 3578
3578 505
4167 505
4167 4537
4537 1732
2227 1732
2227 1876
1876 3989
4495 3989
4495 353
353 3061
2281 3061
2281 4502
4502 2478
83 2478
83 603
603 621
1033 621
1033 3023
3023 1777
1320 1777
1320 3704
3704 2126
1341 2126...

output:

No
Yes
1 53 73 368 140 285 212 311 311 178 145 317 242 149 375 13 8 314 422 174 100 176 174 133 208 32 150 140 482 260 200 41 426 218 175 1 11 119 493 270 335 50 166 160 158 4 1 412 1 446 318 9 36 2 87 45 375 383 86 228 209 1 1 21 80 241 511 261 361 71 532 153 164 151 51 1 195 213 1 238 586 43 117 1...

result:

ok ok (40 test cases)

Test #37:

score: 0
Accepted
time: 34ms
memory: 8084kb

input:

40
4837 11978
1 2353
1 1062
1 3787
1 4402
1 4050
1 1049
1 795
1 1018
1 3962
1 4447
1 2062
1 4467
1 2569
1 3967
1 3946
1 766
1 2336
1 1273
1 3153
1 4219
1 2927
1 1213
1 668
1 3004
1 1515
1 641
1 1358
1 4768
1 2183
1 2565
1 3675
1 2458
1 297
1 1055
1 3881
1 4719
1 579
1 2119
1 484
1 224
1 4315
1 2878
...

output:

Yes
1 2 99 88 16 15 59 128 69 35 29 3 57 17 61 23 97 28 69 7 26 2 34 31 56 10 16 87 84 53 104 19 112 89 136 38 25 103 12 47 82 79 113 154 146 54 28 62 13 49 17 72 115 42 36 61 3 12 1 81 35 1 72 57 82 48 56 44 53 79 39 153 141 34 20 45 59 18 16 54 6 44 12 20 40 20 145 71 37 47 114 68 24 70 86 51 20 2...

result:

ok ok (40 test cases)

Test #38:

score: 0
Accepted
time: 35ms
memory: 6184kb

input:

40
4531 11826
1 469
1 499
1 1329
1 1084
1 1582
1 4286
1 3566
1 4385
1 1823
1 4161
1 1884
1 623
1 321
1 198
1 3228
1 4165
1 2720
1 4092
1 2876
1 2853
1 1308
1 3671
1 4036
1 2147
1 3881
1 2180
1 3193
1 3794
1 2421
1 3051
1 1550
1 1430
1 1273
1 355
1 3728
1 320
1 1429
1 2111
1 93
1 1229
1 4516
1 3476
1...

output:

Yes
1 15 4 106 106 3 25 1 37 47 22 32 105 129 61 27 62 30 124 10 6 25 128 53 29 2 69 60 21 8 125 42 84 54 100 24 125 81 37 32 48 105 88 112 28 5 11 34 2 1 10 103 57 13 35 62 56 77 125 25 99 115 57 72 109 43 37 114 20 38 58 62 110 16 59 49 148 113 39 68 33 13 8 7 93 52 142 129 110 60 68 120 101 7 27 ...

result:

ok ok (40 test cases)

Test #39:

score: 0
Accepted
time: 33ms
memory: 8088kb

input:

40
5000 12093
1 4282
1 4844
1 4912
1 4220
1 4200
1 796
1 1478
1 3428
1 4898
1 4881
1 549
1 2913
1 4823
1 3658
1 2576
1 1732
1 3627
1 4938
1 2055
1 1088
1 769
1 2935
1 1085
1 1698
1 4172
1 1962
1 24
1 3967
1 206
1 163
1 3524
1 4740
1 3288
1 4368
1 4767
1 4508
1 4271
1 1004
1 966
1 1612
1 328
1 1015
1...

output:

Yes
1 75 72 71 65 13 45 11 25 78 72 79 32 9 22 114 19 28 37 57 66 21 15 27 20 32 38 65 49 102 69 65 9 13 76 47 1 74 20 80 48 25 38 82 8 55 73 37 17 82 40 38 52 86 24 5 41 25 79 95 5 10 33 13 51 11 8 12 8 7 7 38 73 74 61 44 52 47 11 9 7 72 35 51 66 13 8 1 50 22 28 32 17 5 94 38 29 36 53 18 44 43 62 9...

result:

ok ok (40 test cases)

Test #40:

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

input:

40
5000 12265
1 3936
1 3755
1 2242
1 136
1 3205
1 2971
1 1659
1 1707
1 150
1 554
1 4766
1 2084
1 3640
1 3266
1 2867
1 3424
1 2176
1 1288
1 3127
1 4005
1 2554
1 868
1 3477
1 912
1 2149
1 1582
1 3442
1 4186
1 522
1 3063
1 1635
1 741
1 3109
1 403
1 4529
1 1244
1 2880
1 2318
1 2161
1 3466
1 3931
1 1488
...

output:

Yes
1 29 4 21 13 26 17 25 39 14 23 1 33 26 14 50 6 49 25 22 23 32 14 17 38 54 47 50 15 3 81 36 69 5 25 34 20 1 27 9 28 22 78 14 82 61 18 6 16 34 28 4 26 40 2 63 10 25 28 9 25 6 40 32 58 4 24 2 53 65 2 10 4 23 14 25 71 31 51 46 4 9 25 7 3 12 1 24 6 26 32 12 32 64 47 5 28 14 21 12 30 22 2 4 39 40 24 6...

result:

ok ok (40 test cases)

Test #41:

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

input:

100
1870 3399
1 808
1 1347
1 1776
1 1128
1 1263
1 1100
1 1741
1 1497
1 33
1 1749
808 640
808 429
808 1099
808 1625
808 89
808 757
808 73
808 739
808 1295
808 578
808 1248
640 1242
640 747
640 908
640 934
640 243
640 1700
640 1275
640 272
640 383
1347 518
1347 1209
1347 13
1347 560
1347 440
518 45
51...

output:

Yes
1 551 2 148 71 1 225 15 178 1 3 355 50 280 184 390 466 11 89 1 301 83 111 2 281 199 273 1 278 1 4 1 614 40 293 242 116 1 593 1 1 1 3 1 1 379 14 507 215 318 458 4 177 482 290 1 333 469 276 1 220 264 1 434 230 26 1 333 254 192 139 447 29 264 219 140 199 1 246 107 492 61 208 2 57 178 9 481 25 226 1...

result:

ok ok (100 test cases)

Test #42:

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

input:

100
1944 4734
1 1018
1 1785
1 561
1 1221
1 107
1 1848
1 181
1 375
1 380
1 454
1 871
1 953
1 912
1 998
1 401
1 1709
1 581
1 417
1 1226
1 1328
1 1633
1 678
1 936
1 404
1 1909
1 125
1 190
1 900
1 712
1 732
1 1274
1 1489
1 1008
1 1600
1 1367
1 434
1 35
1 52
1 945
1 159
1 782
1 903
1 337
1 1353
1 838
1 5...

output:

Yes
1 21 39 50 19 18 62 49 15 22 66 31 61 5 21 19 54 2 40 52 23 23 23 5 30 9 1 66 45 15 37 24 1 79 64 10 30 52 16 57 5 7 68 37 30 47 8 40 18 7 43 79 2 28 7 16 31 65 41 55 81 1 26 58 47 12 64 10 5 60 2 21 24 51 43 43 9 9 5 3 51 54 57 54 9 78 16 27 40 38 52 2 1 17 30 25 38 3 46 59 21 10 54 56 27 20 6 ...

result:

ok ok (100 test cases)

Test #43:

score: 0
Accepted
time: 35ms
memory: 7232kb

input:

100
1941 4777
1 591
1 1042
1 162
1 27
1 1673
1 1394
1 50
1 209
1 782
1 1758
1 915
1 968
1 1660
1 1815
1 940
1 1049
1 325
1 1489
1 267
1 263
1 707
1 578
1 749
1 1218
1 660
1 1391
1 1029
1 415
1 1627
1 361
1 527
1 1899
1 362
1 805
1 324
1 1286
1 20
1 583
1 791
1 1041
1 530
1 1050
1 1356
1 1839
1 256
1...

output:

Yes
1 27 7 36 57 38 2 5 22 8 2 6 1 38 49 11 48 14 4 45 8 11 12 28 8 44 4 13 16 18 48 49 13 13 20 20 3 36 33 4 12 21 41 13 25 9 33 5 37 7 58 10 6 2 19 11 9 53 23 21 1 6 11 8 18 21 17 3 13 19 22 35 11 55 36 31 12 11 35 5 14 36 15 25 30 39 10 32 5 35 32 36 35 13 59 35 22 62 7 5 6 46 60 25 28 13 32 36 1...

result:

ok ok (100 test cases)

Test #44:

score: 0
Accepted
time: 29ms
memory: 5028kb

input:

100
1950 4510
1 1676
1 920
1 245
1 1944
1 1448
1 550
1 1032
1 776
1 376
1 618
1 1640
1 1887
1 585
1 1203
1 1187
1 139
1 1080
1 1625
1 1191
1 1136
1 1223
1 1229
1 1627
1676 29
1676 41
1676 1731
1676 1076
1676 1341
1676 1237
1676 1444
1676 117
1676 579
1676 599
1676 1822
1676 1834
1676 1035
1676 652
1...

output:

Yes
1 22 93 58 51 33 26 67 96 4 39 33 27 1 41 75 38 59 104 54 83 17 54 137 38 76 140 118 20 59 44 33 86 131 108 3 71 39 3 103 2 119 27 13 75 52 55 84 34 14 30 9 12 12 66 105 71 26 76 120 43 18 61 13 1 50 10 54 113 101 38 27 72 53 29 46 111 10 40 81 32 29 56 58 77 60 51 112 54 98 35 2 41 61 28 2 36 8...

result:

ok ok (100 test cases)

Test #45:

score: 0
Accepted
time: 32ms
memory: 5100kb

input:

100
1937 3225
1707 1249
1249 1515
1032 1515
1032 1779
1779 1399
1443 1399
1443 1649
1649 683
1934 683
1934 1051
1051 1344
69 1344
69 1304
1304 1210
1648 1210
1648 1146
1146 924
729 924
729 282
282 580
816 580
816 1440
1440 781
383 781
383 1273
1273 587
1118 587
1118 1751
1751 853
289 853
289 296
296...

output:

No
Yes
1 22 12 16 13 73 21 1 18 1 14 52 33 12 3 33 76 36 24 1 76 20 22 34 13 39 47 18 52 23 5 25 11 7 8 12 41 13 52 14 18 31 75 62 37 4 86 37 8 24 2 29 27 57 10 28 56 30 17 21 43 66 52 34 24 59 61 36 13 19 41 3 46 3 35 11 50 45 13 17 1 17 46 43 32 18 69 80 82 3 69 36 64 31 57 76 56 11 39 32 16 86 36...

result:

ok ok (100 test cases)

Test #46:

score: 0
Accepted
time: 29ms
memory: 5092kb

input:

100
1907 4098
1 1269
1 1056
1 846
1 645
1 160
1 955
1 310
1 774
1 73
1 989
1 1787
1 1802
1 1728
1 1577
1 524
1269 378
1269 1503
1269 1362
1269 1241
1269 1642
1269 928
1269 659
1269 115
1269 1372
1269 870
1269 1057
1269 1775
1056 1357
1056 726
1056 1849
1056 1850
1056 40
1056 896
1056 1471
1056 235
1...

output:

Yes
1 66 44 174 166 1 171 225 126 2 46 225 135 2 155 2 3 116 81 229 264 276 248 71 178 90 36 134 77 86 1 1 160 1 43 247 47 105 170 25 70 142 131 57 96 1 4 246 110 35 21 106 129 1 1 120 134 2 119 160 28 127 49 89 1 96 99 97 165 209 93 106 208 4 49 203 114 159 84 153 25 18 208 105 29 118 60 132 106 47...

result:

ok ok (100 test cases)

Test #47:

score: 0
Accepted
time: 30ms
memory: 7068kb

input:

100
1892 3150
1876 1550
1550 1752
1857 1752
1857 1805
1805 1628
1733 1628
1733 1352
1352 1227
155 1227
155 1885
1885 1662
348 1662
348 900
900 1774
689 1774
689 1476
1476 57
1685 57
1685 403
403 699
978 699
978 187
187 1001
19 1001
19 1719
1719 690
1164 690
1164 132
132 1769
113 1769
113 1784
1784 1...

output:

No
Yes
1 33 15 5 8 34 27 40 26 53 42 50 10 45 36 14 3 34 12 11 49 21 3 25 24 11 34 9 9 29 37 19 20 26 52 15 3 15 28 22 43 32 20 53 1 10 28 2 6 21 49 49 7 6 32 2 14 9 32 1 3 46 23 12 5 43 50 7 15 9 40 17 35 12 21 31 27 7 10 32 28 23 58 50 31 28 40 53 32 2 21 7 2 11 23 8 15 43 15 31 21 14 38 4 9 41 29...

result:

ok ok (100 test cases)

Test #48:

score: 0
Accepted
time: 30ms
memory: 5064kb

input:

100
1814 3020
1218 1336
1336 527
1014 527
1014 1445
1445 728
1583 728
1583 1718
1718 263
1177 263
1177 386
386 257
1387 257
1387 60
60 927
622 927
622 1004
1004 1719
433 1719
433 476
476 1662
989 1662
989 1538
1538 295
900 295
900 1288
1288 609
292 609
292 1730
1730 1036
689 1036
689 842
842 1596
64...

output:

No
No
No
No
Yes
1 4 11 39 1 11 31 28 22 38 57 5 4 21 52 13 53 41 30 35 9 57 8 28 36 24 77 39 23 64 12 46 70 14 17 20 2 48 37 77 58 65 7 18 40 6 20 9 16 72 49 22 13 20 13 59 3 26 28 47 51 43 1 82 1 75 19 13 20 58 39 51 18 31 17 17 17 49 43 42 16 33 1 23 2 76 60 61 48 31 83 18 15 50 9 43 55 5 26 5 10 ...

result:

ok ok (100 test cases)

Test #49:

score: 0
Accepted
time: 26ms
memory: 6240kb

input:

400
500 883
1 305
1 134
1 102
1 497
1 235
1 389
1 70
1 119
1 167
1 96
1 31
305 453
305 270
305 447
305 258
305 155
453 496
453 175
453 214
453 474
496 93
496 52
496 373
496 263
496 129
496 491
496 35
270 479
270 410
270 344
270 66
270 80
270 122
479 256
479 141
479 330
479 162
479 160
479 383
134 11...

output:

Yes
1 47 5 5 132 110 4 116 1 62 43 36 91 88 3 98 60 145 14 67 1 98 1 84 7 60 48 1 2 37 164 46 1 64 97 17 127 100 15 27 88 10 80 37 33 99 1 21 77 23 96 3 1 30 148 21 24 93 19 118 153 14 12 19 50 29 27 19 17 130 22 10 7 73 55 1 1 107 77 84 99 7 10 3 7 1 93 62 120 2 5 7 1 13 83 158 109 127 63 55 82 50 ...

result:

ok ok (400 test cases)

Test #50:

score: 0
Accepted
time: 30ms
memory: 6224kb

input:

400
473 785
360 240
240 421
175 421
175 169
169 8
443 8
443 9
9 63
406 63
406 377
377 309
68 309
68 85
85 64
3 64
3 105
105 424
62 424
62 179
179 415
349 415
349 274
274 378
72 378
72 454
454 47
403 47
403 270
270 91
189 91
189 27
27 414
199 414
199 381
381 258
242 258
242 408
408 155
252 155
252 17...

output:

No
Yes
1 68 15 5 30 25 78 71 9 1 83 113 125 35 88 32 86 88 1 32 85 12 44 41 28 4 57 28 20 96 1 94 124 9 23 20 46 1 67 17 25 59 15 50 80 45 27 5 2 90 22 28 77 69 67 22 53 95 17 2 35 10 44 39 6 75 87 62 3 17 24 1 76 35 20 85 9 23 62 34 103 25 38 101 77 46 26 44 1 30 104 3 2 35 8 77 69 37 60 41 66 75 6...

result:

ok ok (400 test cases)

Test #51:

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

input:

400
500 1147
1 149
1 103
1 140
1 229
1 425
1 389
1 423
1 194
1 293
1 16
1 479
1 496
1 401
1 269
1 407
1 247
1 212
1 171
1 262
1 397
1 80
1 85
1 75
1 44
1 175
1 258
1 122
1 65
149 32
149 213
149 438
149 286
149 96
149 126
149 200
103 32
103 349
103 119
103 231
103 3
103 489
103 341
103 90
103 126
140...

output:

Yes
1 20 27 2 10 2 2 17 1 5 3 8 9 11 2 8 11 32 18 1 28 26 8 7 2 4 5 24 16 3 10 2 18 24 16 25 4 3 19 14 5 22 23 36 26 22 9 2 11 27 22 4 17 9 15 10 4 14 6 2 2 10 17 1 40 5 9 15 12 3 12 28 16 7 31 5 21 1 21 30 2 10 30 20 31 8 1 6 13 37 1 3 13 8 15 37 3 15 11 10 26 20 1 15 12 1 17 36 29 10 4 36 15 14 16...

result:

ok ok (400 test cases)

Test #52:

score: 0
Accepted
time: 26ms
memory: 4188kb

input:

400
500 1149
1 484
1 71
1 338
1 237
1 187
1 388
1 27
1 296
1 272
1 14
1 445
1 491
1 209
1 457
1 312
1 56
1 5
1 81
1 52
1 345
1 395
1 41
1 199
1 386
1 326
1 339
1 448
1 84
1 360
1 83
484 128
484 436
484 349
484 127
484 478
484 256
484 428
484 466
484 251
484 350
71 63
71 418
71 193
71 186
71 492
71 1...

output:

Yes
1 30 7 11 19 5 29 3 13 4 7 3 12 10 9 13 23 9 11 20 5 34 18 11 19 11 8 10 8 10 18 3 1 16 16 6 2 19 6 14 26 22 8 7 7 31 6 12 14 1 14 21 13 11 5 19 14 14 5 6 2 2 1 6 16 8 31 19 25 8 1 18 18 25 11 21 9 2 10 10 20 13 37 33 11 8 16 17 12 7 4 30 28 6 6 8 19 31 16 4 12 22 18 15 1 11 4 2 1 11 18 8 8 4 29...

result:

ok ok (400 test cases)

Test #53:

score: 0
Accepted
time: 29ms
memory: 6076kb

input:

1000
200 353
1 62
1 175
1 131
1 173
1 6
1 37
1 94
1 85
1 171
1 39
1 187
1 25
62 199
62 182
62 44
62 65
175 191
175 145
175 13
175 177
175 73
175 124
131 31
131 15
131 2
131 146
131 96
173 31
173 3
173 18
173 180
6 92
6 152
6 139
6 170
31 78
31 30
31 88
31 76
31 97
31 38
191 136
191 115
191 80
191 51...

output:

Yes
1 1 8 62 1 31 13 42 35 1 36 1 8 34 1 23 4 20 30 1 1 19 33 23 65 2 36 17 1 37 6 53 22 6 25 11 44 50 55 14 43 27 43 25 1 20 25 1 1 11 54 3 4 1 31 1 26 6 34 33 1 1 32 8 61 43 1 22 1 1 63 1 48 1 20 48 1 1 29 17 7 10 48 28 48 43 36 26 2 18 1 1 6 47 24 51 50 1 23 30 23 1 1 21 37 56 10 6 2 13 2 22 13 7...

result:

ok ok (1000 test cases)

Test #54:

score: 0
Accepted
time: 23ms
memory: 5988kb

input:

1000
200 456
1 141
1 138
1 82
1 71
1 149
1 84
1 92
1 74
1 171
1 104
1 146
1 23
1 151
1 123
1 124
1 41
1 199
1 112
1 32
1 90
1 110
1 194
1 97
1 79
1 130
141 159
141 94
141 40
141 91
141 193
141 165
141 51
141 73
141 77
141 24
141 28
141 152
141 131
141 65
141 64
141 128
141 81
138 132
138 145
138 137...

output:

Yes
1 5 6 1 3 1 2 5 7 12 8 1 3 3 5 2 5 7 2 7 2 5 5 10 4 2 6 10 3 12 10 9 5 9 1 2 3 6 11 5 8 1 8 9 1 1 1 5 7 1 8 5 7 1 5 4 4 1 1 8 2 4 4 14 12 2 5 5 10 4 2 6 8 3 3 10 9 1 13 1 14 2 10 2 4 7 6 4 1 10 5 2 10 3 3 6 12 9 10 14 6 4 1 4 6 3 2 3 1 10 11 9 3 7 2 6 3 7 9 5 8 6 8 8 5 2 14 14 8 15 11 2 6 1 2 9 ...

result:

ok ok (1000 test cases)

Test #55:

score: 0
Accepted
time: 30ms
memory: 4020kb

input:

1000
182 300
151 50
50 110
181 110
181 138
138 54
141 54
141 41
41 93
33 93
33 101
101 20
159 20
159 120
120 32
118 32
118 119
119 107
117 107
117 9
9 2
173 2
173 86
86 7
48 7
48 105
105 24
145 24
145 3
3 73
63 73
63 150
150 71
87 71
87 83
83 16
68 16
68 19
19 30
103 30
103 164
164 25
104 25
104 67
...

output:

No
Yes
1 8 5 8 3 6 6 5 2 3 14 2 9 7 1 2 17 11 14 2 11 13 3 1 17 8 4 13 1 11 3 4 3 14 6 12 4 9 16 2 13 14 4 1 7 10 2 6 4 7 4 12 8 15 4 2 4 5 11 4 11 3 7 6 9 7 4 2 4 16 12 1 13 3 3 12 5 8 1 6 3 1 1 13 1 2 1 10 2 3 7 4 1 13 4 2 8 4 17 1 2 12 5 7 6 8 11 10 4 1 5 3 3 1 3 9 2 5 5 5 4 5 4 8 13 8 1 7 10 7 8...

result:

ok ok (1000 test cases)

Test #56:

score: 0
Accepted
time: 26ms
memory: 4016kb

input:

1000
198 461
1 68
1 77
1 163
1 12
1 19
1 196
1 30
1 60
1 28
1 175
1 21
1 115
1 22
1 190
1 87
1 145
1 113
1 78
1 169
1 125
1 155
1 124
1 191
1 139
1 52
1 146
68 103
68 81
68 18
68 34
68 132
68 164
68 40
68 165
68 94
68 193
68 88
68 168
68 49
68 177
68 183
68 178
68 116
68 160
77 37
77 86
77 126
77 19...

output:

Yes
1 3 6 6 2 7 8 12 3 10 1 3 1 7 13 9 1 4 3 8 6 7 2 7 1 3 3 5 3 4 7 7 6 6 4 2 2 4 6 8 4 1 2 4 9 3 1 2 11 3 1 14 1 3 2 1 11 6 1 4 1 5 11 8 3 3 3 1 2 6 3 11 5 2 3 1 2 8 7 3 4 3 7 5 9 3 7 10 9 1 6 9 1 9 2 11 8 10 5 7 4 8 1 7 6 3 1 4 1 7 4 6 8 6 7 13 8 1 5 6 6 5 2 13 11 3 10 9 10 1 1 6 5 3 5 5 8 11 14 ...

result:

ok ok (1000 test cases)

Test #57:

score: 0
Accepted
time: 25ms
memory: 6040kb

input:

4000
46 93
1 42
1 26
1 32
1 23
1 33
1 8
1 22
1 28
1 39
42 14
42 11
42 21
42 4
42 43
26 15
26 11
26 20
26 21
26 43
32 12
32 44
32 31
32 40
32 36
32 27
14 17
14 12
14 44
14 31
14 36
15 9
15 10
15 5
15 24
11 5
11 24
11 30
11 34
20 2
20 7
20 16
21 7
21 45
17 45
17 25
17 16
9 2
9 25
10 29
10 13
10 38
2 1...

output:

Yes
1 1 1 6 4 1 2 9 2 3 1 3 1 2 1 3 1 2 1 3 3 9 6 6 3 1 5 9 1 6 5 3 8 7 1 5 2 4 9 5 3 1 8 5 4 1
No
Yes
1 11 1 1 1 1 10 2 6 7 10 10 3 6 4 8 10 1 1 2 2 8 4 3 2 6 6 2 5 4 6 7 2 1 2 4 4 10 1 2 4 1 5 4 12 6 4 7 4 1
No
Yes
1 1 3 5 4 3 1 7 4 2 1 3 2 1 1 7 1 5 1 3 1 4 1 2 4 2 5 5 1 1 3 4 2 2 2 3 5 1 1 1 2 1...

result:

ok ok (4000 test cases)

Test #58:

score: 0
Accepted
time: 25ms
memory: 5920kb

input:

4000
50 111
1 42
1 37
1 8
1 33
1 48
1 30
1 17
1 22
1 21
1 6
1 29
1 24
1 45
42 40
42 39
42 18
42 32
42 34
42 3
42 2
37 39
37 32
37 34
37 25
37 13
8 40
8 3
8 2
8 5
40 11
40 10
40 44
40 12
39 27
39 11
39 46
39 44
33 31
33 19
33 43
33 49
33 35
33 36
33 23
48 49
48 35
48 23
18 14
18 43
27 19
27 49
27 35
...

output:

Yes
1 5 4 2 6 6 1 1 1 1 1 5 4 1 1 1 4 2 1 1 5 5 4 7 4 3 1 1 7 4 1 3 3 3 2 4 1 1 1 1 1 1 1 2 7 2 3 3 1 1
Yes
1 1 4 5 8 6 3 10 7 4 2 5 2 1 1 7 2 3 6 2 6 3 7 2 2 7 3 6 9 2 1 9 7 8 1 11 2 1 1 1 2 8 7 2 6 4 5 2 1 1
Yes
1 3 10 1 3 2 9 1 15 4 6 6 11 1 12 1 3 1 1 1 1 6 12 9 1 16 1 7 6 15 9 3 4 4 1 2 10 2 1 ...

result:

ok ok (4000 test cases)

Test #59:

score: 0
Accepted
time: 25ms
memory: 5924kb

input:

4000
44 70
32 33
33 23
6 23
6 27
27 18
40 18
40 14
14 4
9 4
9 36
36 28
37 28
37 21
21 19
43 19
43 22
22 20
30 20
30 35
35 26
24 26
24 3
3 39
29 39
29 16
16 12
17 12
17 15
15 10
13 10
13 31
31 7
11 7
11 34
34 41
2 41
2 8
8 42
5 42
5 38
38 25
32 25
1 32
23 44
1 6
18 44
1 40
4 44
1 9
28 44
1 37
19 44
1...

output:

No
Yes
1 9 10 1 1 1 6 12 6 2 9 11 14 8 1 13 5 5 9 15 1 6 7 1 10 1 3 12 11 10 2 3 5 16 1 1 11 5 7 1 2 4 2 2 2 6 11 1
Yes
1 1 1 1 2 1 4 2 1 1 2 1 4 3 1 2 3 7 4 4 1 2 1 2 4 1 5 6 2 6 1 3 3 1 4 1 5 2 2 3 4 3 7 3 6 4 1 1 2 1
Yes
1 2 14 4 8 1 1 11 1 2 5 1 6 14 14 6 3 1 1 1 5 12 4 6 6 3 7 1 1 5 2 3 3 8 4 7...

result:

ok ok (4000 test cases)

Test #60:

score: 0
Accepted
time: 25ms
memory: 3884kb

input:

4000
50 108
1 32
1 4
1 16
1 19
1 13
1 12
1 43
1 11
1 27
1 24
1 2
1 49
1 34
1 3
1 9
32 48
32 33
32 21
32 8
32 44
32 20
32 28
32 37
4 48
4 33
4 8
4 44
4 28
4 37
16 40
16 25
16 38
16 10
16 23
16 14
19 35
19 25
19 36
19 38
19 10
13 40
13 5
13 31
13 36
13 38
48 35
48 31
48 10
33 5
33 29
12 39
12 6
43 39
...

output:

Yes
1 5 7 1 1 4 2 3 7 4 3 3 2 5 1 2 2 3 2 4 2 1 4 5 1 1 4 4 4 1 2 1 1 6 1 2 6 2 4 1 1 2 3 3 2 1 3 1 6 1
No
No
Yes
1 10 9 6 3 5 2 3 10 6 1 6 1 1 2 3 3 3 9 1 1 3 1 3 2 2 1 15 3 5 1 2 8 14 1 10 6 1 6 1 7 3 3 13 1 11 5 7 7 1
Yes
1 2 7 2 4 5 3 6 4 3 3 1 2 4 1 6 3 4 5 6 3 5 2 5 5 1 1 2 6 4 1 1 3 4 3 4 3 4...

result:

ok ok (4000 test cases)

Extra Test:

score: 0
Extra Test Passed