QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#535293#4927. Bounded Spanning Treeegypt_ioi2024_03100 ✓502ms216380kbC++202.9kb2024-08-27 22:53:242024-08-27 22:53:25

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 432ms
memory: 182392kb

input:

1
500001 500000
254401 281557 349855 349855
181158 183050 7695 7695
168649 393239 182447 182447
275491 426002 407013 407013
412840 430191 81351 81351
180729 474744 468590 468590
167128 233022 352396 352396
56562 410078 411755 411755
28611 28934 27783 27783
250615 303207 495889 495889
348947 377767 2...

output:

YES
349855 7695 182447 407013 81351 468590 352396 411755 27783 495889 279148 126532 371490 46443 75037 440945 17872 376183 227217 256463 268704 93994 142674 221161 313215 423148 348655 110097 61558 138416 182869 460629 101134 233433 485321 293910 161637 31401 388370 43691 103888 258050 186588 285649...

result:

ok all is ok (1 test case)

Test #2:

score: 4
Accepted
time: 287ms
memory: 131528kb

input:

1
300001 500000
146540 236321 23350 23350
110737 197257 49315 49315
87807 244200 2878 2878
27529 179675 90834 90834
39761 204225 209751 209751
175226 239307 945 945
25136 248902 243667 243667
215811 229229 48401 48401
152882 243088 63537 63537
136220 210273 244339 244339
31127 43815 196573 196573
31...

output:

YES
23350 49315 2878 90834 209751 945 243667 48401 63537 244339 196573 170759 346610 33502 342292 86136 71174 153543 40008 300022 342991 305551 95289 63927 127147 133670 78873 57350 134796 242512 238031 153963 69392 220900 21326 171023 3218 211851 322418 63540 88200 109095 157709 6644 136208 86952 2...

result:

ok all is ok (1 test case)

Test #3:

score: 4
Accepted
time: 372ms
memory: 126536kb

input:

1
250001 500000
68287 196901 480106 480106
49342 196901 304518 304518
22416 49342 304522 304522
22416 155670 304523 304523
64466 155670 298516 298516
64466 91061 298511 298511
91061 107764 270019 270019
107764 145633 270023 270023
9967 145633 270022 270022
9967 74786 270020 270020
35298 74786 260981...

output:

YES
480106 304518 304522 304523 298516 298511 270019 270023 270022 270020 260981 260987 260975 260980 260999 260988 260553 260552 260551 255267 255249 255252 255206 255247 255246 255192 255270 255224 255251 255255 255296 255277 255189 255254 255245 255239 255217 255250 255289 255190 255276 255223 25...

result:

ok all is ok (1 test case)

Test #4:

score: 4
Accepted
time: 279ms
memory: 101464kb

input:

1
200001 500000
98193 105041 166701 166701
27762 114229 186133 186133
75089 79073 10507 10507
17865 143051 14801 14801
61475 66112 65966 65966
95929 145141 111474 111474
48331 68416 51667 51667
84658 174834 185681 185681
58072 88891 182212 182212
70612 148690 33041 33041
16155 127708 166666 166666
6...

output:

YES
166701 186133 10507 14801 65966 111474 51667 185681 182212 33041 166666 174410 126973 124348 104 167323 109299 22852 163302 119217 152431 288663 55933 2494 119959 58498 108854 313804 18466 166913 48980 9910 343607 193963 105226 272155 404993 191288 158308 131805 92742 84214 63930 160422 96427 12...

result:

ok all is ok (1 test case)

Test #5:

score: 4
Accepted
time: 218ms
memory: 71564kb

input:

1
100001 500000
27575 40895 44938 44938
3625 19411 38012 38012
3655 84852 11318 11318
1152 91041 28632 28632
221 39962 65491 65491
35918 79361 78583 78583
41888 68339 40937 40937
82334 93242 62129 62129
66333 67583 113798 113798
75883 82560 2019 2019
43643 57947 122462 122462
16229 42734 54831 54831...

output:

YES
44938 38012 11318 28632 65491 78583 40937 62129 113798 2019 122462 54831 63084 16263 70129 58780 69845 51401 33811 865 27448 134237 60986 98507 57992 123479 8086 75165 12759 68854 23507 138812 87299 48771 33602 41920 53104 17098 132939 44566 25731 172500 15616 100033 9986 83815 20839 27119 1501 ...

result:

ok all is ok (1 test case)

Test #6:

score: 4
Accepted
time: 68ms
memory: 16688kb

input:

100
2501 4850
1396 1781 772 772
1019 1580 1529 1529
1146 2063 2944 2944
1883 1912 158 158
443 1995 1378 1378
450 871 504 504
1737 2297 2571 2571
447 1804 3367 3367
1159 1917 1789 1789
1478 2444 2775 2775
1783 2412 479 479
2245 2412 2839 2839
73 1403 4729 4729
747 2463 1469 1469
1107 2377 2034 2034
1...

output:

YES
772 1529 2944 158 1378 504 2571 3367 1789 2775 479 2839 4729 1469 2034 2085 1526 747 1638 1356 2158 979 1042 290 919 1304 1555 430 1380 301 1100 2407 900 4497 1318 958 878 432 667 594 1152 763 552 642 3625 463 2885 2992 1630 851 4742 893 2265 1999 83 348 2176 212 3311 629 3246 1360 2114 186 1457...

result:

ok all is ok (100 test cases)

Test #7:

score: 4
Accepted
time: 75ms
memory: 16088kb

input:

1000
251 483
203 224 371 371
75 104 172 172
147 218 64 64
65 94 6 6
123 131 122 122
17 238 119 119
59 151 27 27
157 239 133 133
67 246 225 225
169 220 138 138
63 212 103 103
2 9 33 33
55 201 191 191
103 181 91 91
12 134 62 62
124 227 315 315
106 243 4 4
158 246 49 49
62 142 202 202
2 139 178 178
133...

output:

YES
371 172 64 6 122 119 27 133 225 138 103 33 191 91 62 315 4 49 202 178 199 182 139 234 284 201 75 156 28 101 143 290 129 233 286 44 160 231 208 25 90 73 104 461 15 56 287 429 83 106 45 115 128 194 17 311 24 71 95 70 50 92 67 111 65 358 80 99 282 382 66 167 147 21 52 125 43 195 48 162 57 170 326 2...

result:

ok all is ok (1000 test cases)

Test #8:

score: 4
Accepted
time: 66ms
memory: 15952kb

input:

10000
26 52
6 26 13 13
8 22 23 23
1 4 8 8
12 26 19 19
2 25 6 6
4 23 3 3
7 11 9 9
8 16 5 5
7 20 7 7
2 5 29 29
12 15 1 1
10 21 10 10
4 16 21 21
4 24 2 2
7 25 30 30
14 15 24 24
17 22 22 22
6 13 18 18
18 24 14 14
15 24 12 12
9 24 43 43
3 20 49 49
7 15 4 4
19 20 11 11
10 18 16 16
21 24 20 20
13 20 45 45
...

output:

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

result:

ok all is ok (10000 test cases)

Test #9:

score: 4
Accepted
time: 58ms
memory: 13852kb

input:

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

output:

YES
8 4 7 1 2 3 12 6 9 5 11 10 
YES
2 3 1 4 5 8 11 12 10 6 9 7 
YES
1 3 2 6 5 7 4 
YES
4 3 5 1 2 7 6 9 8 10 
YES
2 4 5 3 1 10 6 9 11 7 8 
YES
2 6 5 4 1 8 7 10 3 9 
YES
1 6 3 5 2 7 10 12 9 8 4 11 
YES
3 1 10 4 2 7 9 5 11 8 12 6 
YES
5 4 2 8 1 10 7 9 3 11 6 
YES
2 1 5 3 6 4 7 
YES
2 7 1 5 3 8 4 6 
NO
...

result:

ok all is ok (50000 test cases)

Test #10:

score: 4
Accepted
time: 169ms
memory: 89132kb

input:

1
250001 500000
58145 72387 235237 235237
58145 124192 125607 125607
61444 72387 20858 20858
58145 210560 75907 75907
15080 61444 417136 417136
58145 144891 443143 443143
61444 113315 217104 217104
113315 219614 495886 495886
31702 210560 453336 453336
72387 147061 299803 299803
72387 234856 355629 ...

output:

NO

result:

ok all is ok (1 test case)

Test #11:

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

input:

1
3 4
1 2 1 1
2 3 2 2
1 3 4 4
1 3 4 4

output:

NO

result:

ok all is ok (1 test case)

Test #12:

score: 4
Accepted
time: 326ms
memory: 146312kb

input:

1
350001 500000
51970 181661 167074 167074
51970 326555 193867 193867
181661 197260 75401 75401
181661 229687 137191 137191
147797 326555 47018 47018
326555 336123 115700 115700
178220 197260 115089 115089
177064 197260 127762 127762
229687 286501 113990 113990
118842 229687 25034 25034
85794 147797...

output:

YES
167074 193867 75401 137191 47018 115700 115089 127762 113990 25034 173325 57068 115719 140380 141783 1164 68154 113245 51496 114298 74156 98738 32453 179503 5043 72618 117146 17085 114789 62367 79201 175046 113082 38555 6883 160158 137354 89534 102294 84811 112280 144778 53617 55541 80021 131091...

result:

ok all is ok (1 test case)

Test #13:

score: 4
Accepted
time: 254ms
memory: 144028kb

input:

1
350001 500000
1 2 91619 91619
1 3 97604 97604
2 4 107881 107881
2 5 105480 105480
3 6 43453 43453
3 7 96271 96271
4 8 182260 182260
4 9 133967 133967
5 10 70321 70321
5 11 17915 17915
6 12 37981 37981
6 13 153439 153439
7 14 100312 100312
7 15 190436 190436
8 16 27817 27817
8 17 124568 124568
9 18...

output:

YES
91619 97604 107881 105480 43453 96271 182260 133967 70321 17915 37981 153439 100312 190436 27817 124568 58307 123433 138047 186140 80734 119093 57462 38052 41558 25990 109748 53006 88030 115853 29102 55929 190897 53226 154772 68399 176247 43649 162208 193175 167849 59192 67049 132375 71215 14642...

result:

ok all is ok (1 test case)

Test #14:

score: 4
Accepted
time: 284ms
memory: 117024kb

input:

1
250001 500000
55167 234232 55638 55638
3684 234232 68427 68427
55167 55500 57038 57038
55167 104654 71138 71138
3684 97251 86152 86152
3684 51545 57935 57935
55500 187343 17112 17112
17560 55500 26990 26990
104654 207657 94625 94625
5109 104654 39135 39135
32358 97251 60733 60733
24234 97251 83100...

output:

YES
55638 68427 57038 71138 86152 57935 17112 26990 94625 39135 60733 83100 89950 80785 49587 25806 51060 1477 66287 82731 24961 93687 61061 65681 55974 37373 46924 37873 46135 93431 72032 91960 40585 33082 66193 49669 4930 11237 43217 57226 64344 26400 81344 49776 95307 335 29041 56487 78400 46678 ...

result:

ok all is ok (1 test case)

Test #15:

score: 4
Accepted
time: 216ms
memory: 116944kb

input:

1
250001 500000
1 2 94951 94951
1 3 117117 117117
2 4 23480 23480
2 5 33084 33084
3 6 93826 93826
3 7 78212 78212
4 8 34019 34019
4 9 18988 18988
5 10 18835 18835
5 11 79631 79631
6 12 64796 64796
6 13 85774 85774
7 14 19026 19026
7 15 96932 96932
8 16 114480 114480
8 17 90135 90135
9 18 116267 1162...

output:

YES
94951 117117 23480 33084 93826 78212 34019 18988 18835 79631 64796 85774 19026 96932 114480 90135 116267 117794 21150 57905 122132 43553 2465 113385 4839 20753 77276 59088 12016 58544 82267 27230 37192 95528 33142 102861 5463 52787 26363 64907 76455 25780 17549 8290 33840 33909 62173 119910 1147...

result:

ok all is ok (1 test case)

Test #16:

score: 4
Accepted
time: 248ms
memory: 88580kb

input:

1
150001 500000
33562 137263 4731 4731
3140 33562 51401 51401
123261 137263 13746 13746
127268 137263 47614 47614
3140 112499 25919 25919
3140 123022 40262 40262
118183 123261 41486 41486
59636 123261 44743 44743
56726 127268 41422 41422
9584 127268 1382 1382
2765 112499 29621 29621
102477 112499 32...

output:

YES
4731 51401 13746 47614 25919 40262 41486 44743 41422 1382 29621 32059 26038 41052 35788 57790 39066 10908 26717 15676 13120 26818 53095 11623 35576 22385 36743 48593 50832 7489 43311 2469 16826 32832 16329 42185 31352 45205 36247 11975 37630 47545 40573 44458 17185 56813 12443 50754 17613 4489 5...

result:

ok all is ok (1 test case)

Test #17:

score: 4
Accepted
time: 194ms
memory: 84916kb

input:

1
150001 500000
1 2 9865 9865
1 3 50922 50922
2 4 72636 72636
2 5 5342 5342
3 6 68517 68517
3 7 2682 2682
4 8 16233 16233
4 9 23462 23462
5 10 42691 42691
5 11 63709 63709
6 12 49292 49292
6 13 47024 47024
7 14 15678 15678
7 15 29782 29782
8 16 26150 26150
8 17 24947 24947
9 18 31097 31097
9 19 3616...

output:

YES
9865 50922 72636 5342 68517 2682 16233 23462 42691 63709 49292 47024 15678 29782 26150 24947 31097 36162 58970 15209 20815 39494 42015 20539 30622 17608 4149 26738 6917 24820 38438 44236 58408 61349 54552 54008 19297 55622 24871 21553 73059 68664 45106 7196 36073 72990 46145 18832 40855 25322 44...

result:

ok all is ok (1 test case)

Test #18:

score: 4
Accepted
time: 200ms
memory: 76180kb

input:

1
100001 500000
32137 73071 8126 8126
30836 32137 8678 8678
33499 73071 28319 28319
54215 73071 10859 10859
13497 30836 14357 14357
20308 30836 20193 20193
33499 64930 32136 32136
33499 72955 10467 10467
4952 54215 13756 13756
54215 78914 7496 7496
13497 87217 18638 18638
13497 32815 12785 12785
203...

output:

YES
8126 8678 28319 10859 14357 20193 32136 10467 13756 7496 18638 12785 33440 30465 20187 38022 18080 35068 23543 32162 24620 13544 21454 32848 27770 1018 6270 26133 3075 7242 25247 32332 11951 28208 291 38575 25325 22264 19792 19256 20532 28167 35356 8949 16733 17298 25951 14904 12881 1026 8766 13...

result:

ok all is ok (1 test case)

Test #19:

score: 4
Accepted
time: 169ms
memory: 71776kb

input:

1
100001 500000
1 2 47454 47454
1 3 24116 24116
2 4 5212 5212
2 5 34333 34333
3 6 37903 37903
3 7 24157 24157
4 8 7647 7647
4 9 46362 46362
5 10 39307 39307
5 11 417 417
6 12 11637 11637
6 13 7943 7943
7 14 31697 31697
7 15 25556 25556
8 16 26719 26719
8 17 2858 2858
9 18 38629 38629
9 19 15877 1587...

output:

YES
47454 24116 5212 34333 37903 24157 7647 46362 39307 417 11637 7943 31697 25556 26719 2858 38629 15877 9949 2664 11319 38601 3830 28522 35313 47973 36161 33118 36164 32490 10857 777 1309 33735 18396 3663 40300 22986 1204 23229 25140 11139 5272 12659 6822 23629 24396 27547 49065 22096 2187 13626 3...

result:

ok all is ok (1 test case)

Test #20:

score: 4
Accepted
time: 183ms
memory: 60164kb

input:

1
50001 500000
11097 17004 6702 6702
11097 46242 6571 6571
9283 17004 14181 14181
17004 49249 3806 3806
16332 46242 12037 12037
23662 46242 620 620
9283 10658 16283 16283
9283 26166 4973 4973
12663 49249 9227 9227
39719 49249 14946 14946
6988 16332 7002 7002
16332 17234 8382 8382
21939 23662 6435 64...

output:

YES
6702 6571 14181 3806 12037 620 16283 4973 9227 14946 7002 8382 6435 8918 17999 2391 14264 14326 2400 19351 12275 3267 6860 2683 12585 3536 7244 17401 3138 19139 10062 18804 1804 17830 1334 9404 13005 13291 5769 2385 12046 9699 2957 11928 4790 2415 2254 8634 17482 11871 16931 2023 11959 11719 854...

result:

ok all is ok (1 test case)

Test #21:

score: 4
Accepted
time: 164ms
memory: 60496kb

input:

1
50001 500000
1 2 9300 9300
1 3 18013 18013
2 4 199 199
2 5 5439 5439
3 6 3410 3410
3 7 12409 12409
4 8 23362 23362
4 9 3502 3502
5 10 2909 2909
5 11 15885 15885
6 12 7701 7701
6 13 12244 12244
7 14 15582 15582
7 15 1562 1562
8 16 23437 23437
8 17 1520 1520
9 18 7605 7605
9 19 13720 13720
10 20 163...

output:

YES
9300 18013 199 5439 3410 12409 23362 3502 2909 15885 7701 12244 15582 1562 23437 1520 7605 13720 16361 605 17871 19668 13644 6113 23475 7978 9645 20419 21421 13609 4107 10853 838 20375 9212 6717 24799 7554 21582 4914 3456 20389 8124 4843 2321 8741 5613 18728 15007 16075 3688 13565 14034 3848 204...

result:

ok all is ok (1 test case)

Subtask #2:

score: 6
Accepted

Test #22:

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

input:

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

output:

YES
3 8 5 2 1 6 10 9 7 4 

result:

ok all is ok (1 test case)

Test #23:

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

input:

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

output:

YES
1 7 6 2 3 5 4 8 9 

result:

ok all is ok (1 test case)

Test #24:

score: 6
Accepted
time: 3ms
memory: 15928kb

input:

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

output:

YES
9 1 6 3 4 2 8 5 10 7 

result:

ok all is ok (1 test case)

Test #25:

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

input:

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

output:

YES
8 3 5 2 1 4 9 6 7 

result:

ok all is ok (1 test case)

Test #26:

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

input:

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

output:

YES
2 9 3 6 1 5 10 7 8 4 

result:

ok all is ok (1 test case)

Test #27:

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

input:

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

output:

YES
9 5 1 4 2 8 3 6 7 

result:

ok all is ok (1 test case)

Test #28:

score: 6
Accepted
time: 4ms
memory: 15816kb

input:

2
4 5
2 3 1 1
2 4 2 3
1 2 5 5
2 3 3 3
2 4 4 5
4 5
2 3 1 2
1 2 1 2
1 4 3 3
3 4 4 4
1 3 5 5

output:

YES
1 2 5 3 4 
YES
1 2 3 4 5 

result:

ok all is ok (2 test cases)

Test #29:

score: 6
Accepted
time: 3ms
memory: 16184kb

input:

3
3 3
1 3 1 2
1 2 3 3
1 2 1 2
3 3
1 2 1 1
1 3 2 3
2 3 3 3
3 3
2 3 3 3
1 2 2 3
2 3 1 1

output:

NO
YES
1 2 3 
NO

result:

ok all is ok (3 test cases)

Test #30:

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

input:

1
4 4
1 2 1 3
2 3 1 4
3 4 4 4
2 3 2 2

output:

YES
3 1 4 2 

result:

ok all is ok (1 test case)

Test #31:

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

input:

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

output:

YES
10 3 2 1 8 6 5 9 4 7 

result:

ok all is ok (1 test case)

Test #32:

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

input:

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

output:

YES
7 1 3 5 10 4 2 9 8 6 

result:

ok all is ok (1 test case)

Subtask #3:

score: 10
Accepted

Dependency #2:

100%
Accepted

Test #33:

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

input:

3
4 6
1 2 1 3
1 3 2 6
3 4 1 2
1 4 2 5
2 3 2 4
2 4 4 6
4 4
1 2 2 2
2 3 3 3
3 4 4 4
1 4 1 4
5 6
1 2 1 1
2 3 1 2
3 4 2 4
4 5 6 6
1 4 4 6
1 4 5 6

output:

YES
2 3 1 5 4 6 
NO
YES
1 2 3 6 4 5 

result:

ok all is ok (3 test cases)

Test #34:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #35:

score: 10
Accepted
time: 3ms
memory: 16180kb

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #36:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #37:

score: 10
Accepted
time: 2ms
memory: 15872kb

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #38:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #39:

score: 10
Accepted
time: 3ms
memory: 13864kb

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #40:

score: 10
Accepted
time: 3ms
memory: 15972kb

input:

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

output:

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

result:

ok all is ok (2 test cases)

Test #41:

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

input:

3
5 6
4 5 1 2
1 4 6 6
1 3 3 3
2 4 4 4
2 5 2 3
3 5 4 5
5 6
4 5 6 6
3 5 2 3
2 5 2 3
1 5 1 2
1 5 5 5
2 5 4 4
4 5
1 3 4 4
2 3 5 5
1 4 2 2
1 4 3 3
1 4 1 1

output:

NO
YES
6 2 3 1 5 4 
NO

result:

ok all is ok (3 test cases)

Test #42:

score: 10
Accepted
time: 3ms
memory: 15940kb

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #43:

score: 10
Accepted
time: 3ms
memory: 14064kb

input:

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

output:

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

result:

ok all is ok (1 test case)

Test #44:

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

input:

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

output:

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

result:

ok all is ok (1 test case)

Subtask #4:

score: 10
Accepted

Test #45:

score: 10
Accepted
time: 3ms
memory: 15988kb

input:

1
501 500
127 170 433 434
26 98 284 285
179 379 82 82
136 270 253 254
100 391 474 476
175 393 170 171
247 311 223 225
32 318 270 270
87 434 294 294
335 417 308 310
249 356 292 294
327 331 42 44
325 498 334 336
73 133 260 262
276 394 493 495
74 289 330 331
29 83 244 245
7 486 482 483
115 368 90 90
22...

output:

YES
433 284 82 254 476 170 224 270 294 308 293 44 336 261 494 331 244 482 90 277 32 115 416 106 240 386 479 444 125 500 488 306 399 86 474 408 455 458 15 87 42 141 24 128 33 383 29 342 333 381 448 214 346 365 2 25 397 13 499 357 326 310 392 139 366 487 449 361 498 285 436 153 481 412 83 328 84 187 3...

result:

ok all is ok (1 test case)

Test #46:

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

input:

1
501 500
129 176 247 250
72 179 289 289
170 435 422 422
135 320 255 256
126 397 150 150
25 112 29 29
341 422 112 112
68 176 419 421
83 208 266 267
111 470 144 149
212 488 163 165
109 261 468 468
457 478 500 500
298 426 427 432
61 408 459 464
235 440 297 302
114 117 307 307
132 448 37 38
128 380 219...

output:

YES
247 289 422 255 150 29 112 420 267 146 164 468 500 431 462 299 307 37 221 430 358 166 11 122 66 265 416 413 435 483 13 317 83 406 454 242 52 94 397 202 195 4 57 62 291 456 135 310 143 252 264 487 54 365 119 366 256 467 286 244 1 22 73 180 197 229 387 472 475 383 250 238 153 49 104 233 486 414 23...

result:

ok all is ok (1 test case)

Test #47:

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

input:

1
501 500
277 399 197 204
33 426 390 390
202 417 268 272
223 466 15 23
195 379 85 94
100 203 16 22
184 245 142 144
188 474 117 122
195 353 139 143
62 373 412 416
383 390 319 327
40 108 143 153
67 366 53 56
18 325 172 182
272 314 135 137
51 86 237 247
77 313 399 408
22 199 29 36
18 132 422 423
97 345...

output:

YES
201 390 270 20 89 17 142 122 140 414 325 150 53 176 135 242 404 33 422 355 12 313 39 468 292 120 99 491 213 290 88 169 437 32 497 371 205 314 3 19 180 128 295 2 331 421 101 223 360 241 488 144 66 212 474 118 367 258 159 387 285 484 219 348 485 370 342 476 481 271 244 339 405 441 264 226 332 402 ...

result:

ok all is ok (1 test case)

Test #48:

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

input:

1
501 500
212 481 169 188
28 427 404 420
339 466 43 62
229 281 111 126
89 143 234 238
333 444 160 168
288 484 431 451
177 432 441 453
384 407 418 427
146 340 118 118
92 249 467 479
53 469 396 398
63 70 174 180
54 367 8 19
285 360 153 164
67 389 286 291
91 442 99 104
1 455 58 67
207 309 453 472
286 4...

output:

YES
182 413 57 117 235 166 442 446 422 118 472 396 175 14 159 288 99 62 467 23 83 44 494 433 167 153 4 401 26 473 362 119 146 205 270 490 202 220 303 200 223 477 251 71 398 199 116 395 114 230 233 367 154 82 106 286 439 245 400 486 341 410 164 342 7 470 226 46 155 321 304 231 178 421 360 389 333 438...

result:

ok all is ok (1 test case)

Test #49:

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

input:

1
501 500
183 475 152 172
6 264 94 97
102 116 454 461
332 436 250 258
275 339 11 23
109 383 491 500
12 251 156 165
409 496 253 282
319 386 465 469
130 292 121 123
30 333 21 23
40 194 254 255
86 345 338 348
73 434 99 118
119 450 221 228
246 350 35 51
186 255 99 102
182 279 392 413
206 332 247 250
128...

output:

YES
167 94 454 256 13 496 156 277 465 121 21 254 339 107 224 41 99 405 247 197 479 249 404 199 161 269 148 363 413 371 453 446 481 428 296 283 73 316 191 297 244 354 169 246 341 488 436 245 448 280 181 220 500 71 6 7 298 361 227 406 343 119 437 39 391 51 411 252 142 88 475 63 382 345 266 291 84 309 ...

result:

ok all is ok (1 test case)

Test #50:

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

input:

1
501 500
56 261 38 63
139 152 248 251
173 435 92 131
254 445 21 36
74 246 202 208
52 442 422 447
328 340 434 466
179 434 92 126
200 241 127 132
48 294 183 203
72 271 147 172
42 382 245 265
330 466 349 368
59 216 120 125
279 443 359 381
469 478 292 309
51 100 21 39
186 475 275 299
94 495 420 429
323...

output:

YES
46 248 121 27 202 437 451 110 127 195 164 254 354 120 366 300 28 287 421 319 179 462 445 394 221 350 26 304 464 244 86 12 61 443 96 59 433 257 395 138 488 42 430 480 372 13 329 78 406 224 460 500 105 133 492 315 211 196 19 281 55 428 208 473 474 483 11 223 390 270 376 410 156 20 463 311 409 298 ...

result:

ok all is ok (1 test case)

Test #51:

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

input:

1
501 500
317 393 166 174
219 415 120 143
11 28 409 436
197 470 35 76
401 460 189 236
201 230 45 94
211 461 319 359
211 220 246 255
283 343 81 125
211 258 121 162
261 270 350 376
210 226 405 411
449 477 131 167
360 464 161 204
35 416 237 247
85 408 272 306
105 437 163 194
110 267 167 196
17 237 482 ...

output:

YES
168 132 420 64 217 73 341 247 111 145 361 405 148 191 237 289 178 182 482 492 172 318 319 400 223 269 306 457 401 453 81 232 365 195 203 477 108 197 298 352 340 299 34 2 162 254 463 287 258 454 38 301 233 339 268 78 209 396 293 170 204 241 192 321 355 154 414 456 440 408 45 256 22 312 25 236 323...

result:

ok all is ok (1 test case)

Test #52:

score: 10
Accepted
time: 3ms
memory: 16004kb

input:

1
501 500
66 362 223 231
19 173 108 146
267 468 15 84
269 309 295 302
438 462 348 415
132 187 474 498
91 416 92 191
141 161 71 169
142 309 153 177
59 390 139 220
57 203 359 449
172 362 463 466
226 463 444 495
344 369 1 68
122 266 320 336
293 326 316 358
108 207 34 114
14 140 153 182
339 383 363 383
...

output:

YES
223 120 48 295 377 475 165 143 154 184 412 463 471 30 320 330 85 156 363 123 160 260 431 121 125 423 28 218 57 440 336 273 398 224 415 394 446 306 359 166 347 425 314 335 67 16 18 7 39 104 95 436 351 382 308 197 101 271 494 318 92 353 366 354 418 285 262 36 495 134 396 445 362 221 432 213 474 46...

result:

ok all is ok (1 test case)

Test #53:

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

input:

1
501 500
419 457 238 270
52 410 93 141
101 172 97 163
146 274 112 149
277 448 127 325
435 440 46 195
375 380 159 299
107 306 326 359
31 441 188 346
6 55 174 197
74 340 16 123
38 437 1 72
265 366 178 255
203 442 1 105
42 119 215 281
54 65 1 85
72 213 14 208
358 392 301 302
210 359 125 197
142 293 27...

output:

YES
238 93 102 112 273 140 247 326 293 174 61 25 205 47 231 39 151 301 142 272 211 388 144 66 378 249 320 75 148 375 4 136 448 437 1 462 296 18 317 255 446 27 69 321 420 265 234 50 439 158 198 131 417 399 431 77 363 311 337 412 414 92 366 282 324 427 128 172 173 74 331 32 464 342 434 407 178 308 490...

result:

ok all is ok (1 test case)

Test #54:

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

input:

1
501 500
153 365 163 163
123 153 196 196
123 282 30 33
282 361 105 110
85 361 466 471
85 126 290 290
43 126 8 9
43 273 423 425
273 357 101 101
142 357 62 63
142 499 336 341
22 499 493 495
22 408 125 127
54 408 124 129
54 355 85 88
315 355 113 116
60 315 198 200
60 309 37 42
309 369 53 57
95 369 144...

output:

YES
163 196 31 107 470 290 8 425 101 62 341 494 126 128 85 114 198 39 54 144 130 71 222 489 221 203 388 246 217 339 19 468 11 5 300 72 429 360 166 44 184 55 333 328 173 82 336 308 407 317 495 220 230 292 375 463 46 161 56 274 104 347 297 91 226 310 304 157 9 243 466 180 209 440 106 302 98 454 439 16...

result:

ok all is ok (1 test case)

Test #55:

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

input:

1
501 500
23 115 137 146
23 68 233 249
53 68 53 59
53 342 321 335
11 342 342 356
11 279 281 295
76 279 401 414
76 236 441 448
236 454 468 484
325 454 240 253
287 325 418 423
287 351 423 435
14 351 318 331
14 141 206 208
141 404 309 312
166 404 53 64
84 166 270 283
84 311 42 57
205 311 347 357
161 20...

output:

YES
138 242 54 329 351 292 411 441 476 248 420 428 322 207 309 60 278 48 352 263 37 250 223 53 448 75 377 24 333 357 454 389 73 393 302 456 88 118 253 449 159 418 87 149 105 194 30 498 306 458 266 8 165 421 414 74 28 184 124 392 148 388 315 287 135 285 493 367 400 179 350 96 457 407 412 252 387 182 ...

result:

ok all is ok (1 test case)

Test #56:

score: 10
Accepted
time: 4ms
memory: 16184kb

input:

1
501 500
106 202 458 492
36 202 180 230
36 327 245 293
133 327 448 463
133 174 211 216
174 256 73 89
256 278 82 113
111 278 242 292
111 194 15 42
194 480 188 211
432 480 473 500
161 432 191 193
55 161 290 320
7 55 347 390
7 28 17 25
28 418 188 197
408 418 48 91
389 408 52 69
297 389 459 486
268 297...

output:

YES
476 217 280 453 211 73 100 277 26 200 494 191 305 378 17 189 72 56 468 224 320 86 322 234 341 424 418 59 479 61 213 376 285 269 260 480 203 63 287 212 145 10 496 113 483 129 65 242 19 499 168 146 298 69 470 97 464 58 290 123 429 283 396 437 198 122 208 116 136 155 304 333 68 225 316 491 252 192 ...

result:

ok all is ok (1 test case)

Test #57:

score: 10
Accepted
time: 4ms
memory: 16248kb

input:

1
501 500
128 431 134 232
62 431 214 243
118 431 68 159
194 431 157 213
422 431 297 355
226 431 377 461
208 431 112 196
179 431 202 288
46 431 1 72
302 431 68 110
353 431 313 313
197 431 1 17
233 431 111 162
12 431 443 500
234 431 167 234
387 431 466 500
35 431 244 332
397 431 487 500
204 431 430 49...

output:

YES
202 215 132 180 328 440 167 260 41 87 313 5 138 480 207 488 300 497 464 19 254 384 7 121 340 60 421 78 33 499 36 52 198 44 438 31 168 500 63 255 275 24 131 445 442 473 342 175 123 111 352 492 8 194 62 400 344 373 46 57 222 314 399 55 187 264 484 219 433 410 82 39 345 269 274 372 320 333 308 85 2...

result:

ok all is ok (1 test case)

Test #58:

score: 10
Accepted
time: 2ms
memory: 15988kb

input:

1
501 500
22 209 135 163
22 127 290 314
22 45 167 197
22 333 178 195
22 275 131 163
22 346 137 139
22 382 177 202
22 48 126 154
22 253 405 440
22 415 466 492
22 168 112 119
22 252 445 465
22 337 46 68
22 98 170 192
22 87 314 338
22 448 473 488
22 93 276 287
22 259 459 488
22 77 194 222
22 277 208 21...

output:

YES
154 303 184 183 153 137 191 142 430 482 112 456 59 177 332 476 276 473 207 208 104 455 431 475 122 254 500 219 436 204 16 165 29 463 192 169 140 258 283 350 450 443 313 74 96 123 205 82 353 263 393 467 265 241 146 83 49 368 366 167 129 327 323 480 388 190 148 407 68 319 35 489 378 468 432 239 23...

result:

ok all is ok (1 test case)

Test #59:

score: 10
Accepted
time: 3ms
memory: 16204kb

input:

1
501 500
124 342 261 323
7 124 103 106
124 439 303 341
124 443 316 342
81 124 456 458
124 429 24 53
124 413 205 262
75 124 54 91
124 336 348 382
124 433 412 452
124 147 349 401
124 180 91 150
124 501 385 434
124 133 191 247
124 447 152 220
18 124 469 493
124 271 67 76
124 316 395 457
124 279 260 29...

output:

YES
302 103 318 319 456 41 241 71 363 432 385 125 415 226 199 469 67 438 275 346 374 54 313 181 376 440 213 488 143 457 265 489 283 354 122 36 90 321 30 190 82 335 408 152 373 453 222 131 205 377 309 238 114 433 345 132 81 406 207 198 470 160 351 398 142 170 178 64 146 324 69 21 360 365 337 23 186 1...

result:

ok all is ok (1 test case)

Test #60:

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

input:

1
501 500
233 402 267 276
144 233 313 315
156 233 23 33
233 266 9 15
19 233 297 310
233 324 106 116
233 493 402 402
233 323 357 372
16 233 142 147
134 233 448 455
171 233 164 164
37 233 150 159
233 245 387 397
233 432 229 230
233 272 275 276
145 233 188 201
109 233 166 172
233 482 476 477
233 464 24...

output:

YES
272 313 29 14 305 113 402 368 144 450 164 157 392 229 275 193 167 476 256 154 231 135 171 469 276 338 46 13 248 428 195 48 273 500 27 15 371 471 443 344 108 291 495 65 406 353 125 124 49 19 429 308 158 499 192 378 321 100 139 91 357 318 2 282 440 405 367 334 252 102 137 479 204 5 24 241 359 33 2...

result:

ok all is ok (1 test case)

Test #61:

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

input:

1
501 500
156 217 398 408
56 217 92 93
145 217 57 62
217 399 350 355
82 217 470 474
217 308 311 321
31 217 227 227
217 476 314 324
217 289 386 398
122 217 289 296
217 501 217 229
217 398 328 329
217 458 462 472
217 357 192 199
132 217 266 271
131 217 136 137
152 217 365 374
121 217 375 386
217 358 2...

output:

YES
403 92 58 352 471 317 227 320 395 289 225 328 466 197 269 136 371 380 270 263 351 112 341 87 100 416 46 135 196 338 35 300 459 161 479 82 434 312 51 219 9 311 256 340 119 218 49 111 461 22 314 362 417 386 375 350 398 221 293 418 258 142 247 309 149 273 408 327 354 93 378 373 27 175 66 109 332 43...

result:

ok all is ok (1 test case)

Test #62:

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

input:

20
26 25
5 23 23 25
10 13 7 11
2 11 19 21
11 24 5 9
1 6 12 14
6 24 24 25
9 24 8 8
18 22 22 23
10 17 9 13
10 21 20 24
2 26 16 16
8 17 3 6
3 12 3 6
4 16 17 21
10 15 7 11
3 6 9 10
11 19 15 19
4 22 1 4
23 24 4 6
14 19 1 1
8 16 17 20
10 20 12 15
10 11 24 25
7 17 11 14
3 25 11 13
26 25
1 16 13 13
1 12 5 5...

output:

YES
23 7 20 6 14 24 8 22 11 21 16 3 4 19 10 9 17 2 5 1 18 15 25 13 12 
YES
13 5 9 24 16 7 20 11 23 17 12 18 1 21 25 22 14 6 10 8 4 19 2 15 3 
YES
15 14 12 9 21 8 22 13 1 10 18 6 2 19 16 3 5 7 4 23 17 24 11 20 25 
YES
8 23 17 15 25 22 3 7 13 18 9 24 12 14 19 16 10 4 1 2 11 5 20 6 21 
YES
9 8 14 20 5 ...

result:

ok all is ok (20 test cases)

Test #63:

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

input:

20
26 25
11 17 10 12
11 13 10 10
1 11 25 25
6 11 1 1
11 25 8 9
3 11 22 22
5 11 4 5
11 24 20 20
2 11 1 3
10 11 19 19
7 11 21 22
11 12 4 6
11 22 16 17
11 21 16 16
11 16 12 13
11 14 18 19
9 11 24 24
4 11 11 11
8 11 4 4
11 20 7 8
11 19 7 9
11 26 14 14
11 15 23 25
11 23 1 2
11 18 13 15
26 25
6 25 19 20
6...

output:

YES
12 10 25 1 9 22 5 20 3 19 21 6 17 16 13 18 24 11 4 7 8 14 23 2 15 
YES
19 15 21 4 1 24 25 11 10 18 13 2 23 9 5 17 6 16 12 14 22 20 8 3 7 
YES
12 22 8 14 6 10 24 25 21 19 23 4 7 5 1 2 16 9 20 3 15 17 11 18 13 
YES
22 5 9 2 12 17 13 14 25 8 1 3 7 23 21 18 15 4 19 16 6 20 11 10 24 
YES
5 11 3 12 1 ...

result:

ok all is ok (20 test cases)

Test #64:

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

input:

20
26 25
6 13 4 4
1 9 5 5
5 16 22 25
18 26 16 16
6 20 6 8
3 8 1 3
6 23 21 23
6 25 16 21
3 15 19 20
11 23 20 21
2 17 6 8
17 23 17 21
6 16 14 18
5 24 23 25
4 12 1 4
21 23 11 11
14 22 18 19
4 8 3 8
7 15 2 2
1 7 8 13
15 26 9 13
2 3 6 9
10 26 9 11
7 19 23 25
20 22 12 17
26 25
17 23 12 15
8 23 12 12
3 23 ...

output:

YES
4 5 23 16 7 1 22 17 19 21 8 20 15 24 3 11 18 6 2 12 13 9 10 25 14 
YES
15 12 17 6 18 2 10 4 14 21 3 1 9 24 22 20 16 5 8 25 23 13 19 11 7 
YES
6 8 18 24 3 14 5 15 21 20 22 25 17 23 7 12 10 2 11 4 16 13 1 9 19 
YES
21 12 15 23 4 2 8 17 25 20 16 7 9 19 24 22 18 10 14 1 3 11 5 6 13 
YES
15 20 14 19 ...

result:

ok all is ok (20 test cases)

Test #65:

score: 10
Accepted
time: 4ms
memory: 15936kb

input:

50
11 10
5 10 1 3
7 10 3 6
3 10 6 6
8 10 4 7
10 11 10 10
1 10 1 1
2 10 8 9
6 10 5 5
9 10 7 9
4 10 1 3
11 10
1 4 7 10
4 7 9 10
4 10 5 5
4 5 3 4
4 9 8 8
4 11 2 4
4 6 4 6
2 4 1 1
4 8 6 9
3 4 7 9
11 10
2 5 4 4
5 11 2 3
1 5 4 7
5 9 7 7
5 8 7 10
5 6 1 1
5 10 6 8
3 5 2 3
5 7 5 5
4 5 10 10
11 10
4 10 10 10
...

output:

YES
2 4 6 7 10 1 9 5 8 3 
YES
9 10 5 3 8 2 4 1 6 7 
YES
4 2 6 7 9 1 8 3 5 10 
YES
10 4 1 9 7 5 8 6 3 2 
YES
5 9 10 1 6 7 3 8 2 4 
YES
9 1 6 2 8 3 5 4 10 7 
YES
9 1 10 6 7 4 8 5 2 3 
YES
9 7 6 1 4 10 2 8 3 5 
YES
5 2 9 7 3 4 10 1 6 8 
YES
10 4 1 9 6 7 8 2 3 5 
YES
5 8 7 3 4 2 1 10 6 9 
YES
3 7 6 8 5 ...

result:

ok all is ok (50 test cases)

Test #66:

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

input:

50
11 10
5 9 9 10
9 11 5 5
4 10 4 6
1 5 7 10
5 7 4 4
8 9 8 9
6 8 6 7
1 2 1 2
3 10 1 2
5 10 3 4
11 10
4 6 8 8
3 4 4 4
4 8 4 6
4 10 5 5
4 11 1 1
2 4 8 9
4 5 2 3
1 4 3 4
4 9 5 7
4 7 9 10
11 10
5 8 8 9
1 3 2 2
10 11 6 7
4 5 5 5
2 7 10 10
7 11 2 4
5 9 6 7
6 11 1 1
4 11 2 4
3 9 9 10
11 10
6 7 7 9
7 8 5 7
...

output:

YES
10 5 6 9 4 8 7 1 2 3 
YES
8 4 6 5 1 9 2 3 7 10 
YES
8 2 6 5 10 3 7 1 4 9 
YES
9 6 4 8 2 10 1 5 3 7 
YES
5 6 1 8 9 2 7 10 3 4 
YES
9 7 1 4 5 3 10 2 8 6 
YES
8 10 7 6 4 1 3 5 2 9 
YES
6 8 9 3 7 4 2 5 1 10 
YES
6 5 4 2 3 7 1 9 8 10 
YES
8 3 10 4 6 5 9 2 1 7 
YES
6 3 8 7 5 9 10 4 1 2 
YES
1 7 4 2 5 ...

result:

ok all is ok (50 test cases)

Test #67:

score: 10
Accepted
time: 3ms
memory: 14072kb

input:

10
51 50
13 32 47 48
3 32 46 50
3 35 13 22
32 40 8 8
22 35 42 50
3 16 31 42
15 22 1 11
22 25 37 50
16 41 5 10
17 22 8 15
34 41 36 37
3 51 10 13
4 16 1 6
35 48 44 50
28 40 26 33
24 32 49 50
4 20 24 24
27 40 20 25
8 25 16 26
40 46 30 41
8 36 4 17
17 18 3 3
19 28 29 37
6 48 5 16
6 7 1 12
20 47 43 49
17...

output:

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

result:

ok all is ok (10 test cases)

Subtask #5:

score: 7
Accepted

Dependency #4:

100%
Accepted

Test #68:

score: 7
Accepted
time: 85ms
memory: 17140kb

input:

1000
501 500
95 327 464 470
95 380 339 349
95 427 301 306
95 188 258 269
95 498 142 151
95 436 484 485
95 171 166 167
95 388 230 237
95 293 258 269
95 247 131 142
95 445 38 44
95 334 329 330
95 238 120 131
95 196 20 23
95 100 406 406
47 95 167 174
35 95 329 333
95 452 122 129
95 492 217 226
95 237 2...

output:

YES
465 346 303 259 148 484 166 235 264 139 40 329 129 20 406 169 330 125 223 257 366 209 123 66 70 441 193 347 268 473 363 47 430 298 374 372 478 208 130 85 1 292 488 356 389 300 150 160 10 269 243 323 494 127 107 217 172 17 141 16 176 136 77 251 75 395 349 327 53 415 274 308 486 226 98 35 164 338 ...

result:

ok all is ok (1000 test cases)

Test #69:

score: 7
Accepted
time: 89ms
memory: 17072kb

input:

1000
501 500
100 384 388 403
100 437 92 107
100 212 128 140
40 100 327 337
100 228 233 236
83 100 382 414
100 288 54 83
100 133 374 377
100 442 6 25
59 100 142 144
100 198 215 220
100 244 476 500
100 416 293 319
100 161 126 147
100 185 249 265
100 433 496 499
31 100 148 177
55 100 384 415
81 100 178...

output:

YES
391 93 129 331 233 402 73 374 13 142 215 492 311 137 254 496 168 403 198 204 491 473 262 275 74 65 364 177 9 302 162 114 494 7 298 318 144 131 140 291 123 214 288 14 34 426 193 354 185 115 37 28 3 66 317 205 231 448 220 306 206 174 446 376 349 380 236 477 463 48 32 405 186 226 96 454 447 110 85 ...

result:

ok all is ok (1000 test cases)

Test #70:

score: 7
Accepted
time: 104ms
memory: 19492kb

input:

100
5001 5000
857 2162 3424 3425
2162 2880 449 452
654 2162 2394 2396
2162 4443 2899 2901
2162 3819 2732 2733
336 2162 233 235
183 2162 584 587
139 2162 1104 1107
2162 3643 1965 1966
1176 2162 4797 4799
1757 2162 4360 4360
964 2162 4232 4234
2162 4678 2201 2203
2162 3881 4540 4542
2162 2901 300 300
...

output:

YES
3424 451 2394 2900 2732 234 586 1105 1965 4798 4360 4234 2201 4541 300 4875 3608 2465 2131 3891 3015 136 3122 2077 3014 495 4207 1373 4050 4895 3097 3971 2663 1076 1125 1961 2102 4432 3027 3554 4753 3190 2255 4403 598 1792 4052 2884 219 1568 215 1469 537 890 903 3636 1303 196 2083 1142 1986 3357...

result:

ok all is ok (100 test cases)

Test #71:

score: 7
Accepted
time: 97ms
memory: 18864kb

input:

100
5001 5000
964 1256 4929 4936
964 1455 4664 4664
964 2385 4455 4459
964 1474 78 83
964 4718 4355 4355
103 964 1617 1620
964 3523 2304 2304
964 1666 1688 1691
964 4453 1781 1782
964 2448 294 296
964 1756 4024 4024
964 4810 4179 4180
964 1792 833 835
964 3503 3019 3024
964 1470 2055 2060
964 3358 6...

output:

YES
4933 4664 4457 79 4355 1618 2304 1690 1781 294 4024 4179 833 3022 2057 672 1485 151 2874 457 674 1386 1738 612 2666 4292 2034 3713 344 2812 3448 4511 3761 3953 3298 4173 2558 1681 3914 1598 3494 2392 1143 1522 1431 1978 4603 799 4174 4812 2804 2328 4285 4256 2521 1678 4005 611 2313 3007 435 2709...

result:

ok all is ok (100 test cases)

Test #72:

score: 7
Accepted
time: 178ms
memory: 33236kb

input:

10
50001 50000
1154 48388 35247 35648
45341 48388 12824 13438
28145 45341 18659 19160
25974 48388 3217 3750
45341 46173 14017 14320
44329 46173 8235 8655
42820 44329 2448 2942
22189 46173 15142 15403
31950 42820 43233 43620
18156 42820 6194 6332
20390 25974 1771 2128
10676 25974 25939 26176
31950 40...

output:

NO
YES
27985 25561 36715 34089 26460 20653 5788 36362 44710 5422 25144 5800 25302 48760 39781 33867 2569 30367 35649 27883 19279 37286 1033 20548 9135 16057 25395 49544 35423 47020 3289 38417 11401 24687 4521 10726 34435 28696 21434 22740 46807 10027 8728 18846 44112 35859 2259 39783 49757 33888 130...

result:

ok all is ok (10 test cases)

Test #73:

score: 7
Accepted
time: 155ms
memory: 32808kb

input:

10
50001 50000
4837 30873 29041 29431
16397 30873 24695 25634
30092 30873 6416 6922
16397 47323 41530 41702
8858 16397 35887 37030
8858 39510 16729 17222
16397 21744 20160 21035
4305 30873 6420 7103
13535 39510 28430 28745
4837 26229 39796 40518
16391 30092 10621 11223
4305 7761 23734 24170
26229 49...

output:

YES
29143 25419 6670 41530 36836 17031 20832 6853 28461 40311 11010 24025 43872 23409 21960 33631 25285 13056 41441 27521 25635 49005 29367 11452 29694 19003 29913 2666 40053 36889 15891 37287 45459 15444 34866 38737 12250 15710 43795 8472 6383 6995 13035 28759 34871 4917 15642 6718 21154 42932 2748...

result:

ok all is ok (10 test cases)

Test #74:

score: 7
Accepted
time: 176ms
memory: 33092kb

input:

10
50001 50000
3297 10597 21893 23332
10597 14002 45779 45913
14002 39203 44537 45776
16230 39203 47133 48076
10597 42719 930 1677
27482 39203 25479 25545
17683 39203 14245 15097
17002 39203 23779 24026
3297 28360 30177 31073
32663 42719 48225 49151
16179 42719 3150 3564
16230 38538 38741 39326
3355...

output:

YES
22958 45779 45380 47586 1242 25479 14765 23779 30632 48696 3150 38891 40475 16359 49428 16717 45074 13243 440 6033 27020 15961 25059 28350 42277 5892 11006 195 14716 44247 1071 28990 33425 33525 3485 36034 5994 23487 30743 18898 39246 5137 10090 8133 33990 17526 28207 36361 39339 21200 3156 1182...

result:

ok all is ok (10 test cases)

Test #75:

score: 7
Accepted
time: 190ms
memory: 36620kb

input:

10
50001 50000
676 21941 9187 9196
5164 22451 39703 39707
14121 18666 48315 48317
29302 34823 46461 46461
46158 48608 42983 42989
7091 22742 7767 7771
5393 43291 46598 46618
37247 42533 10499 10499
9235 14150 27205 27211
28282 45763 4305 4307
26410 41510 23403 23422
2421 29679 23400 23417
33002 3936...

output:

YES
9189 39703 48315 46461 42985 7767 46609 10499 27205 4305 23417 23411 9519 27226 5932 14223 49408 37724 29038 42851 37601 28758 16403 20829 31201 48404 10308 49084 21322 18005 46393 2764 3451 30923 27081 44586 16527 30459 5509 9700 4935 45115 1346 30081 48158 35018 32290 27307 12476 25433 18258 4...

result:

ok all is ok (10 test cases)

Test #76:

score: 7
Accepted
time: 204ms
memory: 38080kb

input:

10
50001 50000
18413 27371 39587 39588
27371 40518 25360 25381
6402 40518 29494 29502
6402 33421 3101 3103
6010 33421 13895 13912
6010 32352 26177 26177
32352 37952 36532 36542
24289 37952 47391 47393
5629 24289 1881 1889
5629 31675 25557 25576
14342 31675 41916 41935
14342 41114 47605 47616
14268 4...

output:

YES
39587 25374 29495 3101 13905 26177 36535 47391 1884 25571 41926 47610 16523 33044 18079 34582 6844 32869 23188 1341 8326 21862 42829 31388 22524 21066 33458 41378 18051 12445 34287 41522 1461 46965 15024 44322 10500 48115 5150 38118 37605 37739 4572 32264 30695 6644 2129 34308 23055 12025 33009 ...

result:

ok all is ok (10 test cases)

Test #77:

score: 7
Accepted
time: 182ms
memory: 34788kb

input:

10
50001 50000
9087 36392 42873 42878
15648 36392 5819 5823
21908 36392 31077 31082
8943 36392 33248 33249
3937 36392 28385 28390
36392 48498 3385 3387
36392 36494 6099 6103
16052 36392 6045 6047
16765 36392 25333 25333
3956 36392 9094 9099
34406 36392 22056 22056
787 36392 6105 6107
35261 36392 326...

output:

YES
42877 5820 31079 33248 28388 3385 6101 6046 25333 9097 22056 6105 32613 35863 10894 18421 37676 14585 12831 13929 15364 11953 7993 2848 5857 24618 10350 4935 19739 845 10079 26642 22267 19655 33382 5968 9457 49782 49028 16542 20837 32950 37500 22147 996 23817 9688 14755 29763 33669 19940 16915 1...

result:

ok all is ok (10 test cases)

Test #78:

score: 7
Accepted
time: 378ms
memory: 177948kb

input:

1
500001 500000
118916 452858 193791 194006
118916 214886 169820 169940
118916 453088 258405 258577
115232 118916 224429 224575
118916 339797 425033 425198
118916 215758 340944 341181
20755 118916 356647 356736
18816 118916 193247 193281
118916 149513 480519 480693
118916 177466 278710 278887
118916...

output:

YES
193938 169862 258491 224498 425117 341115 356676 193247 480608 278815 115104 314693 228348 324010 102505 41485 460349 354574 77597 103140 35652 284471 120137 282484 252248 128533 77703 371686 469231 52796 366569 383024 468809 152897 480323 138097 163228 354081 220987 392378 497065 162033 291695 ...

result:

ok all is ok (1 test case)

Test #79:

score: 7
Accepted
time: 165ms
memory: 35856kb

input:

10
50001 50000
11870 17755 15289 15289
17755 42502 6324 6342
11870 39868 3536 3572
11870 36314 25375 25411
15316 42502 40982 40983
23122 42502 25381 25423
37236 39868 15055 15074
24171 39868 7290 7326
11060 36314 45514 45539
21827 36314 3787 3817
15316 22461 9813 9831
15316 21587 47188 47192
23122 3...

output:

YES
15289 6327 3558 25399 40982 25410 15062 7318 45522 3806 9822 47188 40755 47401 20147 9163 807 1736 24497 21218 17135 48470 12604 26004 45130 14295 13944 1945 12957 18693 38917 34523 4619 14377 42404 9768 4594 43287 19605 44553 14588 22575 6347 32661 15732 28253 9957 48840 9404 16783 44218 15938 ...

result:

ok all is ok (10 test cases)

Test #80:

score: 7
Accepted
time: 369ms
memory: 178496kb

input:

1
500001 500000
420546 473370 406473 406887
373350 420546 414436 414788
20162 473370 172901 173182
386642 473370 60925 61259
355933 373350 143559 143673
373350 478524 178737 179055
20162 348095 396273 396420
20162 429570 113525 113634
386642 493606 112863 113113
326885 386642 495616 495665
95674 355...

output:

YES
406738 414642 173054 61114 143564 178911 396280 113525 112969 495616 457543 88890 91747 50826 99296 431848 421552 492989 227660 128591 460523 433641 180332 233588 29070 231964 411271 302307 78564 472875 377738 192059 466797 294601 446812 91745 411095 370217 117536 466217 26812 456381 260977 2357...

result:

ok all is ok (1 test case)

Test #81:

score: 7
Accepted
time: 381ms
memory: 197040kb

input:

1
500001 500000
32051 443456 87155 87155
32051 227284 94635 94642
131458 227284 247135 247140
131458 276639 497744 497750
148113 276639 231831 231831
36537 148113 372998 372998
36537 272219 107683 107689
272219 454443 242470 242477
96493 454443 39099 39101
96493 333930 380111 380117
86872 333930 465...

output:

YES
87155 94638 247137 497748 231831 372998 107687 242473 39100 380113 465782 176425 194556 158425 35472 148002 339254 185775 339163 241700 79300 352306 413511 102457 128115 461371 406865 455566 341350 243729 316158 371087 301914 424420 257033 148786 45942 224209 156827 35983 117039 24872 8030 27821...

result:

ok all is ok (1 test case)

Test #82:

score: 7
Accepted
time: 406ms
memory: 194080kb

input:

1
500001 500000
52433 271496 254941 255441
271496 476894 21933 22327
146194 476894 492370 493076
94840 146194 456216 456423
94840 353664 225771 226156
353664 375652 180688 181059
65818 375652 17077 17179
65818 472642 456743 456949
140962 472642 489152 489633
140962 240361 243536 243744
139848 240361...

output:

YES
255162 22045 492789 456217 225871 180789 17077 456743 489346 243537 395291 323298 400706 195277 141864 146115 121011 462954 166338 415498 369411 458624 290873 480747 175534 256301 124454 188934 330020 106224 191655 355209 335736 145126 68641 17845 339575 12817 467593 271623 16387 441666 226696 1...

result:

ok all is ok (1 test case)

Test #83:

score: 7
Accepted
time: 432ms
memory: 196040kb

input:

1
500001 500000
146950 440941 1 19125
24890 440941 120891 135140
24890 488472 433959 465370
383624 488472 477673 493484
192216 383624 213095 224631
97227 192216 160095 197328
97227 137207 426447 445459
84671 137207 60484 63159
84671 349161 265981 292949
349161 420309 309196 323908
401480 420309 1 27...

output:

YES
8699 122660 452924 481130 213095 184821 432947 60484 280438 311421 15513 294571 384127 60007 304754 364827 402906 35343 422930 12136 36402 116809 240986 220803 62012 352460 15931 466747 435447 196762 316833 243559 104826 53474 177440 145887 436856 217848 301827 41205 12261 454445 450993 94630 33...

result:

ok all is ok (1 test case)

Test #84:

score: 7
Accepted
time: 448ms
memory: 202588kb

input:

1
500001 500000
21540 444803 185057 202403
21540 424261 409107 439951
135576 424261 460604 500000
94285 135576 285462 300795
94285 393074 101141 118259
18973 393074 54562 61877
18973 258344 27641 32764
92283 258344 18933 35361
92283 146811 276185 295668
18912 146811 289783 298378
18912 180250 299070...

output:

YES
188878 426296 486969 287234 104522 54563 27641 21616 282095 289783 309666 412346 422228 148104 185806 375893 128656 120600 87657 86794 255398 496296 336531 442542 436116 286399 126706 399537 383370 398612 430189 187939 474966 370388 254266 202073 239953 258327 455483 89949 401780 433534 382098 2...

result:

ok all is ok (1 test case)

Test #85:

score: 7
Accepted
time: 444ms
memory: 193796kb

input:

1
500001 500000
20912 293408 166781 257842
56297 293408 46037 65241
33731 56297 21029 126811
362 33731 269535 316898
362 486565 306044 414383
307381 486565 1 11378
307381 471626 105176 173122
41868 471626 248946 333524
10945 41868 378431 406060
10945 269984 345834 464791
269984 337094 305713 385610
...

output:

YES
204430 46037 74417 269535 360786 1287 119665 280028 378431 411220 331776 470037 412633 338200 389982 194172 449155 239709 498470 80913 422015 121330 153252 55749 217630 453075 18420 66328 149748 247732 436634 295155 305312 278146 22625 267077 343281 143865 390852 305949 68183 388049 136270 31962...

result:

ok all is ok (1 test case)

Test #86:

score: 7
Accepted
time: 461ms
memory: 200792kb

input:

1
500001 500000
244291 496843 343588 500000
47608 244291 381805 448396
47608 95618 362896 421036
95618 390077 293345 312639
58548 390077 98025 104146
2760 58548 144695 393561
2760 395557 261040 500000
263743 395557 299971 337535
110181 263743 422021 500000
110181 496019 408371 500000
284051 496019 1...

output:

YES
448213 381805 362897 293345 98025 309505 421433 299971 480195 474893 141066 8397 371795 437893 352096 274268 439927 188895 228928 195393 362314 67107 33422 144093 124308 374 51647 217524 13582 134349 13652 326293 242324 72406 129506 142400 344673 3155 236055 41373 247896 472793 320899 34348 4663...

result:

ok all is ok (1 test case)

Test #87:

score: 7
Accepted
time: 438ms
memory: 191452kb

input:

1
500001 500000
81197 236616 280680 303606
8014 236616 464661 488221
8014 40028 355067 393281
40028 379891 109030 141075
279068 379891 372225 418240
193286 279068 387153 422464
193286 453196 105903 125214
327927 453196 208036 217413
327927 348454 417993 435276
348454 439755 224417 236368
242177 4397...

output:

YES
289543 474137 379299 127074 404248 408410 111380 208036 421204 224417 497315 24775 115706 24117 27209 451553 117217 444519 312873 255425 265192 491724 210781 249120 312046 235225 226095 188431 479399 492464 432414 200175 281756 409851 68127 429720 173165 301659 395977 131495 457832 205465 461367...

result:

ok all is ok (1 test case)

Test #88:

score: 7
Accepted
time: 459ms
memory: 204636kb

input:

1
500001 500000
221621 403521 1 88398
46566 403521 219309 323306
46566 294467 321221 332295
168132 294467 331151 441918
168132 373121 412416 500000
234812 373121 111991 217863
29516 234812 156951 162055
23295 29516 321901 367007
23295 286148 107733 111081
89210 286148 299203 393354
89210 404370 4465...

output:

YES
53920 288478 321221 407170 470326 182895 156951 332198 107733 358650 457590 138672 99359 445701 384047 465005 4076 128053 371826 225387 24844 41245 154765 344020 249132 12647 447036 430978 68405 344912 86971 145338 205687 262145 140842 6274 401585 184495 384922 406428 466897 151332 12987 133542 ...

result:

ok all is ok (1 test case)

Test #89:

score: 7
Accepted
time: 401ms
memory: 216380kb

input:

1
500001 500000
123315 445247 1 500000
57060 123315 1 500000
57060 239270 1 348025
153497 239270 1 500000
153497 213034 1 322451
48215 213034 2436 203971
48215 286985 145548 500000
152586 286985 1 432138
152586 325206 1 370283
269227 325206 1 500000
269227 321453 1 500000
237514 321453 1 500000
1289...

output:

YES
72439 72440 38366 72442 33503 15068 462601 56148 42723 72443 72444 72445 72446 491936 72447 48495 72448 438632 16823 72449 72450 60450 72451 72452 72453 72454 72455 72456 72457 183381 72458 22217 72459 72460 72461 72462 72463 72464 72466 72467 435252 72468 72469 72470 41720 72471 72472 58667 724...

result:

ok all is ok (1 test case)

Test #90:

score: 7
Accepted
time: 275ms
memory: 205736kb

input:

1
500001 500000
1 2 466694 466695
2 3 1637 1808
3 4 184615 184644
4 5 78967 79047
5 6 34877 35065
6 7 392451 392505
7 8 274081 274222
8 9 119059 119119
9 10 263211 263388
10 11 60265 60398
11 12 393482 393583
12 13 468331 468503
13 14 437516 437674
14 15 159516 159543
15 16 93772 93785
16 17 20360 2...

output:

YES
466694 1750 184615 78990 35007 392455 274160 119062 263333 60344 393525 468440 437620 159516 93772 20416 393707 43220 79391 21582 77598 65590 149341 162675 418079 331098 292339 69657 206508 468446 499277 195262 144803 23245 46212 67126 58117 188154 181430 258540 194940 360324 146990 284022 36608...

result:

ok all is ok (1 test case)

Test #91:

score: 7
Accepted
time: 43ms
memory: 53692kb

input:

1
100001 100000
1 2 70403 73927
2 3 52279 57814
3 4 83648 90033
4 5 22568 25872
5 6 35193 36728
6 7 1588 3784
7 8 1709 2933
8 9 68744 71771
9 10 48370 54763
10 11 65340 71193
11 12 35846 41455
12 13 68343 73641
13 14 40388 45955
14 15 61700 63835
15 16 6195 12572
16 17 34087 34252
17 18 2974 7257
18...

output:

YES
71885 55771 88032 23840 35193 1939 1709 69772 52749 69174 39541 71612 43930 61826 10650 34087 5265 48286 33334 28972 50216 15583 22498 70472 8943 39759 35234 32636 91556 77120 88420 35781 47959 95116 39296 52631 42154 11106 18078 74851 87332 38562 54326 85957 48935 93795 88985 65479 20177 69691 ...

result:

ok all is ok (1 test case)

Test #92:

score: 7
Accepted
time: 445ms
memory: 201828kb

input:

1
500001 500000
86404 353992 378207 390984
86404 486369 291277 307603
184694 486369 400607 426153
184694 214923 34927 54161
214923 486280 248634 255088
288242 486280 175738 202130
288242 384442 377461 395784
384442 406025 487830 489314
59332 406025 249162 275330
59332 72339 360942 383395
72339 41045...

output:

YES
383135 299650 418277 46253 248635 194134 388020 487830 267450 375480 181367 19598 350409 206777 276652 177405 235752 9969 289849 281320 98788 242959 361495 10739 356638 441671 197189 206888 369534 132324 263530 451006 67423 276499 154717 497243 463541 406280 241329 168276 494830 264719 110370 98...

result:

ok all is ok (1 test case)

Subtask #6:

score: 20
Accepted

Test #93:

score: 20
Accepted
time: 94ms
memory: 14288kb

input:

1000
500 500
100 331 2 8
162 182 272 276
133 415 393 397
144 176 499 500
64 273 47 55
37 463 424 428
96 481 127 127
115 341 333 336
79 95 246 248
266 473 473 476
117 140 113 120
112 309 323 330
251 438 39 45
22 339 275 285
83 474 264 266
185 212 282 291
377 425 25 31
42 436 351 357
35 69 173 182
159...

output:

YES
6 272 394 500 52 424 127 333 246 474 114 327 40 279 266 283 28 354 178 486 151 13 14 350 359 267 18 81 344 376 199 480 461 407 216 86 482 113 278 192 153 493 129 224 159 269 357 374 315 393 33 103 444 396 284 94 208 340 188 242 385 200 303 362 214 95 371 21 304 116 373 346 165 399 88 314 42 369 ...

result:

ok all is ok (1000 test cases)

Test #94:

score: 20
Accepted
time: 93ms
memory: 14320kb

input:

1000
500 500
263 445 23 34
78 313 146 154
230 479 442 449
30 422 402 413
203 491 298 313
211 353 266 276
336 449 412 428
39 200 291 315
333 344 15 30
77 227 472 475
166 435 90 115
338 471 223 236
237 287 203 213
226 457 17 32
7 179 441 454
130 447 344 359
5 302 376 383
75 329 423 424
76 386 172 190
...

output:

YES
29 146 442 407 308 267 419 311 25 472 103 230 208 28 443 351 376 423 181 488 165 185 374 302 239 111 345 70 431 321 372 150 144 184 316 464 395 415 340 236 333 209 460 268 79 373 3 82 432 467 142 498 289 290 251 8 291 85 416 335 19 327 300 94 77 119 394 455 213 398 40 320 341 386 113 253 458 444...

result:

ok all is ok (1000 test cases)

Test #95:

score: 20
Accepted
time: 103ms
memory: 19296kb

input:

100
5000 5000
1050 3257 3679 3683
1611 2666 4834 4845
452 3180 4411 4415
1500 4067 2424 2437
989 3394 3014 3023
3098 4437 4722 4727
1309 3218 1175 1177
4456 4719 3394 3404
3064 4235 533 549
2422 3362 1097 1104
3526 4419 4206 4219
1349 3646 4192 4200
889 3142 3836 3852
1429 2797 180 194
941 971 2333 ...

output:

YES
3679 4842 4411 2430 3021 4725 1175 3399 544 1102 4215 4196 3844 187 2344 3681 11 3939 4881 731 1638 4778 1179 4621 4902 4339 471 3647 2921 2229 3584 2028 2816 1005 1766 449 2922 1978 1046 3898 1380 2211 1272 650 1230 1989 3838 3936 260 3472 2070 3572 1575 141 4731 1796 1420 2380 4291 909 1505 20...

result:

ok all is ok (100 test cases)

Test #96:

score: 20
Accepted
time: 100ms
memory: 19472kb

input:

100
5000 5000
896 1568 2762 2764
896 3943 4810 4813
896 4703 1309 1311
698 896 3724 3727
896 4466 145 146
896 1510 3366 3367
896 3907 787 791
412 896 1161 1163
896 1144 2699 2702
896 4397 2012 2014
896 1197 486 487
896 1959 3032 3040
896 3782 4002 4010
896 4120 2053 2061
896 2848 1007 1016
29 896 29...

output:

YES
2762 4812 1310 3726 146 3367 789 1161 2701 2012 486 3035 4009 2058 1010 2918 694 511 2323 47 4535 1722 2995 4506 1153 4795 1203 3628 595 2286 241 3357 997 412 1970 1244 4320 1535 144 1316 169 1579 1743 2038 543 3812 1850 840 3110 1255 2272 4637 3836 4592 4782 4641 3534 266 1542 2805 2907 4902 25...

result:

ok all is ok (100 test cases)

Test #97:

score: 20
Accepted
time: 104ms
memory: 34968kb

input:

10
50000 50000
16923 41334 36220 36274
3707 16923 25007 25485
16923 43183 18327 19460
3707 36130 39723 39849
3236 43183 43590 44645
33673 36130 25151 25263
40317 43183 17958 18364
9548 40317 5313 5322
29972 33673 38913 40387
16923 46964 13196 14120
16660 43183 40309 40886
3690 3707 18129 19025
40317...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO

result:

ok all is ok (10 test cases)

Test #98:

score: 20
Accepted
time: 101ms
memory: 32588kb

input:

10
50000 50000
19424 19639 22452 23092
17278 19424 13463 13527
19639 38736 24509 24517
35080 38736 37348 37649
17278 40728 2919 3352
17278 35971 19193 19722
36585 40728 8570 9388
17278 38949 40307 40923
10426 40728 24206 24940
19639 26173 5971 6142
15699 19639 38641 38923
40728 43932 48259 48361
104...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO

result:

ok all is ok (10 test cases)

Test #99:

score: 20
Accepted
time: 114ms
memory: 35904kb

input:

10
50000 50000
1192 40512 19190 19355
1192 16647 1596 2390
40512 48981 30014 31493
1192 9477 8494 9679
9477 22370 44252 44582
1192 49956 12853 14527
9477 19578 690 971
22370 28423 49462 49885
9477 11391 7432 8311
11129 28423 47638 48233
11129 36670 35712 36687
11391 43704 27626 27746
9210 16647 4193...

output:

NO
NO
YES
10919 4289 22556 18192 12664 45720 37073 15891 23836 16866 12179 49750 3210 19964 42189 30493 4529 28004 34462 38913 15570 22859 9379 33782 1410 22248 40436 17383 11606 4831 43921 27454 44303 2282 12161 1606 2752 13377 41182 48810 14989 33619 8628 15318 48584 24708 26479 45344 39472 1245 3...

result:

ok all is ok (10 test cases)

Test #100:

score: 20
Accepted
time: 179ms
memory: 32724kb

input:

10
50000 50000
8304 12932 23665 23670
31403 41968 33812 33813
887 47837 30167 30169
4286 33182 16863 16864
15786 46808 1393 1398
25570 41476 25789 25793
19043 25829 6368 6373
7945 23399 36512 36516
23197 41637 7759 7764
5884 20309 42710 42712
29776 33891 8302 8303
303 13274 23488 23488
11277 42596 2...

output:

YES
23666 33812 30168 16863 1396 25790 6372 36514 7760 42711 8302 23488 23451 15392 7985 5569 32205 39712 44705 22123 31531 39199 36174 28644 49333 18168 21380 25398 15386 23007 9200 33701 15470 16102 8140 29491 35104 37063 19440 46764 9962 22766 47857 1385 45028 32840 49399 36840 33725 1557 19859 5...

result:

ok all is ok (10 test cases)

Test #101:

score: 20
Accepted
time: 199ms
memory: 37724kb

input:

10
50000 50000
41913 47632 6512 6531
42921 47632 29876 29880
8920 42921 6329 6347
8920 39871 34643 34650
3075 39871 13399 13410
3075 6883 4479 4519
6883 30250 17021 17029
30250 39228 31042 31060
25475 39228 26931 26965
2053 25475 27846 27888
2053 48494 16104 16127
18975 48494 38780 38788
10606 18975...

output:

YES
6519 29876 6335 34643 13400 4501 17022 31042 26944 27874 16114 38780 46693 6232 47660 39203 9643 31591 20261 1661 24298 2184 33459 5508 33752 30094 35436 1761 46636 39962 17184 47456 37668 14814 18119 23661 14429 10821 37973 9676 3173 32746 7819 45169 42232 35999 16646 42647 23098 7418 12094 117...

result:

ok all is ok (10 test cases)

Test #102:

score: 20
Accepted
time: 153ms
memory: 38816kb

input:

10
50000 50000
10553 28226 10181 10228
28220 28226 32714 32718
28226 33586 32521 32567
9269 28226 24833 24857
28226 36323 982 1018
28226 40190 9044 9090
28226 35742 31493 31529
16603 28226 28112 28118
28226 39725 40404 40445
28226 49320 39524 39541
28226 46425 12829 12875
5045 28226 9623 9661
28226 ...

output:

YES
10214 32714 32549 24843 1003 9076 31520 28112 40430 39530 12865 9643 35501 31645 17122 31247 19322 15982 42327 4449 13843 17005 11881 39195 15937 9284 2810 41320 28454 9709 43143 21566 45475 11976 16246 19822 32553 25526 1648 27659 20449 5902 29155 45763 47968 36316 13043 13348 39670 39538 27 45...

result:

ok all is ok (10 test cases)

Test #103:

score: 20
Accepted
time: 361ms
memory: 177780kb

input:

1
500000 500000
27666 296099 287454 287528
296099 415922 259068 259374
296099 301662 57883 58173
28795 296099 309225 309359
296099 355135 22964 23140
191694 296099 414455 414547
160041 296099 234036 234134
296099 353155 398700 398868
296099 298124 442893 443032
240081 296099 171054 171138
296099 358...

output:

YES
287455 259281 58078 309264 23049 414464 234036 398778 442930 171055 365327 311066 188972 488698 486460 400080 362957 71238 130249 17816 429928 340627 359319 351227 153742 1459 384749 228822 192485 23255 329133 277407 348014 474018 474276 492009 96160 361873 264949 283780 387947 260976 267890 231...

result:

ok all is ok (1 test case)

Test #104:

score: 20
Accepted
time: 182ms
memory: 34136kb

input:

10
50000 50000
2715 37650 11708 11709
2715 7532 46196 46197
4084 37650 16713 16714
30801 37650 1701 1701
7532 31471 26778 26778
7532 34624 16332 16333
4084 43204 26048 26049
4084 32302 32591 32591
30801 36788 22361 22362
4089 30801 45840 45841
31471 43181 9452 9452
15650 31471 579 579
14765 34624 35...

output:

YES
11708 46196 16713 1701 26778 16333 26049 32591 22362 45840 9452 579 3550 10696 29167 25804 15820 15196 24279 7215 25924 36931 43147 4990 23823 20887 1095 41396 4017 24589 8829 43375 47414 48351 446 35535 47420 23561 11918 41243 5689 28158 37269 9099 6226 18014 5364 46581 6564 32140 43683 30843 3...

result:

ok all is ok (10 test cases)

Test #105:

score: 20
Accepted
time: 380ms
memory: 178544kb

input:

1
500000 500000
350978 384616 431612 431835
183860 384616 144521 144592
189058 350978 112130 112217
350978 421982 421775 421905
166742 183860 325651 325730
62982 183860 114103 114341
186049 189058 291937 291966
189058 418793 430553 430555
279130 421982 65908 65962
421982 464192 301183 301325
166742 ...

output:

YES
431743 144521 112133 421806 325651 114230 291937 430553 65908 301219 488297 187133 347259 3007 274922 305045 188404 451989 388542 167227 266680 172845 29182 76302 359991 199040 3149 61194 385675 443319 39998 424388 257013 74819 45130 366310 279531 52202 291544 323046 495134 221397 150572 114554 ...

result:

ok all is ok (1 test case)

Test #106:

score: 20
Accepted
time: 417ms
memory: 196308kb

input:

1
500000 500000
215604 482720 9336 9336
187347 482720 339886 339888
127935 187347 56645 56645
95810 127935 167534 167536
95810 106925 464539 464540
106925 478623 69726 69727
381224 478623 124767 124773
345415 381224 312846 312846
345415 358809 353961 353961
212260 358809 334239 334240
212260 448751 ...

output:

YES
9336 339886 56645 167534 464540 69726 124772 312846 353961 334239 291070 498775 416183 450083 449445 334967 394624 239686 494137 300572 228466 294880 439585 233830 57832 161980 390982 118669 333697 319695 472166 311996 72746 80564 461295 362602 202298 186250 41817 144861 236031 70844 199239 3055...

result:

ok all is ok (1 test case)

Test #107:

score: 20
Accepted
time: 458ms
memory: 202432kb

input:

1
500000 500000
215308 293000 367250 368060
35529 215308 284644 285572
35529 210118 63073 63315
210118 306690 131612 131786
306690 381648 235581 235735
126047 381648 298060 298580
126047 364413 269204 270075
204485 364413 376275 377262
178874 204485 474702 475038
82671 178874 77500 78183
82671 35422...

output:

YES
367787 285302 63073 131615 235581 298315 269777 376972 474750 77913 195863 140328 12955 95407 11300 31205 345818 269617 485255 205266 440079 369989 494861 483181 267437 381859 303204 141647 185528 383783 376565 368230 239946 367953 487826 271062 121684 305655 282892 166614 160516 285502 55432 28...

result:

ok all is ok (1 test case)

Test #108:

score: 20
Accepted
time: 423ms
memory: 199436kb

input:

1
500000 500000
172091 389900 27256 28457
172091 414155 373461 374077
404244 414155 452626 453468
187718 404244 19899 20264
16984 187718 352185 354628
16984 295130 427098 429377
108258 295130 163767 164461
108258 398510 228318 228525
398510 403200 77965 78842
195873 403200 462094 462963
195873 45981...

output:

YES
27724 373461 452747 19899 353899 428651 163767 228319 78097 462186 346685 162297 46295 418160 64334 313791 15598 273722 68119 182482 274573 247605 446826 275988 69003 408852 91161 494103 317255 342293 207358 338991 491202 455991 375463 327913 498741 421361 482293 442436 431862 437351 486654 3761...

result:

ok all is ok (1 test case)

Test #109:

score: 20
Accepted
time: 392ms
memory: 202588kb

input:

1
500000 500000
259214 291911 390684 390743
259214 322337 211259 211382
322337 461511 401096 401230
461511 464732 219531 219776
219473 464732 6740 6899
213993 219473 13536 13682
159931 213993 333656 333753
159931 482231 111461 111488
266344 482231 306012 306300
236983 266344 307800 307838
236983 317...

output:

YES
390684 211302 401145 219686 6818 13612 333656 111462 306223 307800 344675 497498 318796 67359 435671 151706 353836 70289 70263 200876 333557 14913 290902 379182 241987 427471 442316 451875 365167 435173 46243 91205 369046 464059 234784 271948 258405 4684 230366 248564 255983 492768 423450 298366...

result:

ok all is ok (1 test case)

Test #110:

score: 20
Accepted
time: 402ms
memory: 190572kb

input:

1
500000 500000
330795 392574 203480 203694
392574 423123 383760 383767
28684 423123 60917 61538
28684 273674 335604 336392
273674 275630 3002 3378
96288 275630 95317 96382
96288 203576 297246 297270
61790 203576 306939 307694
61790 325062 471295 471508
292782 325062 344917 345630
157134 292782 4150...

output:

YES
203480 383760 61224 336101 3060 96067 297246 307381 471295 345316 415543 108608 3072 154186 116103 45715 276051 417074 462317 441498 448480 236319 244141 314497 57996 125817 470305 56641 368678 453896 141565 461413 119990 211213 82760 38559 283842 349430 137694 382197 417036 94911 434808 308898 ...

result:

ok all is ok (1 test case)

Test #111:

score: 20
Accepted
time: 407ms
memory: 191940kb

input:

1
500000 500000
39491 299185 30782 30812
39491 259353 352840 352861
259353 309986 67425 67473
83919 309986 146968 146975
83919 451788 208822 208827
290913 451788 415298 415370
211766 290913 490586 490586
211766 480666 87152 87224
399866 480666 396990 397040
114518 399866 416966 416991
114518 300894 ...

output:

YES
30790 352842 67447 146968 208822 415349 490586 87205 397020 416971 465025 111519 153697 399543 197545 483126 150215 396055 84349 8880 244841 388301 482548 389487 371364 216775 219928 309490 100623 138195 386754 342762 65575 396136 376389 306399 13544 457574 426644 380863 355672 37810 494150 9730...

result:

ok all is ok (1 test case)

Test #112:

score: 20
Accepted
time: 420ms
memory: 194048kb

input:

1
500000 500000
46754 452678 187210 198104
46754 52740 267995 281250
52740 203135 456552 466128
203135 325773 300828 306314
260560 325773 182631 196201
187766 260560 36270 45197
187766 431045 354969 356331
195199 431045 178056 187365
195199 300882 215021 226238
280096 300882 318941 337636
214694 280...

output:

YES
192051 275046 459902 300828 190122 38889 354969 181156 220101 331430 87134 330131 179120 282416 93423 387542 120335 259160 128118 109220 244290 157560 10354 185748 277953 239663 224126 307920 34265 204454 178108 267299 183028 317898 471271 202513 486799 184763 7505 424467 209176 39188 62511 3241...

result:

ok all is ok (1 test case)

Test #113:

score: 20
Accepted
time: 419ms
memory: 198532kb

input:

1
500000 500000
53242 159837 143382 165897
159837 178075 463092 467188
178075 376948 109964 120038
317015 376948 46105 50064
218707 317015 365093 385513
218707 401056 109454 110280
67695 401056 177350 188475
67695 238732 477719 479372
200407 238732 2173 10807
98168 200407 399100 404322
76728 98168 3...

output:

YES
158966 463092 113159 46105 378619 109454 181693 477719 4902 399100 346565 205490 222795 51104 337059 235985 132535 397229 351162 368 188731 95760 76144 328736 94211 290686 85664 368745 432829 329299 377353 409198 394862 426253 263336 197527 381077 425885 106824 248157 52156 24126 272185 165889 3...

result:

ok all is ok (1 test case)

Test #114:

score: 20
Accepted
time: 465ms
memory: 202488kb

input:

1
500000 500000
30447 392104 328309 341822
324482 392104 288339 415393
324482 489567 148351 175123
209566 489567 390045 500000
209566 454111 263808 265043
174167 454111 1 70691
174167 482851 19761 127055
256337 482851 62004 184861
241343 256337 226890 306358
133127 241343 124234 242562
133127 448511...

output:

YES
328309 377963 148352 475136 263808 36184 89938 147666 269026 205320 499751 275502 423666 369132 92609 437824 330654 102370 277235 307414 75926 398398 17002 236940 350163 300940 377984 29688 343863 306103 494077 154254 167015 75550 87878 491107 232999 210471 300316 319466 233672 303809 107717 987...

result:

ok all is ok (1 test case)

Test #115:

score: 20
Accepted
time: 470ms
memory: 202188kb

input:

1
500000 500000
67846 259403 74455 144057
67846 158710 36496 48157
158710 312920 90296 135809
312920 456455 129093 170164
274089 456455 252193 318771
274089 477473 319023 372332
73790 477473 324544 380438
73790 249305 188384 234755
5339 249305 452449 500000
5339 131597 373648 500000
131597 389121 31...

output:

YES
96141 36496 90297 129093 271223 324469 332442 188384 493217 476419 344823 138858 291544 155300 136708 412147 331282 69730 406494 365715 228747 4337 312207 333383 492921 161798 406656 426685 294616 115989 16792 58726 141924 97322 188 424229 143293 492580 149040 191236 491478 495640 317056 343944 ...

result:

ok all is ok (1 test case)

Test #116:

score: 20
Accepted
time: 481ms
memory: 204356kb

input:

1
500000 500000
173238 218038 1 204189
138674 173238 461175 500000
138674 140818 182274 188110
140818 251738 274707 450965
145722 251738 252282 500000
145722 219492 4555 18640
196427 219492 249106 315295
104805 196427 1 286655
93782 104805 288839 474951
93782 123242 401034 500000
123242 405402 63940...

output:

YES
100772 496658 182274 336385 445881 4555 249107 173699 360450 484769 263326 119427 343734 485910 476963 487714 459678 191149 70261 111312 29991 336482 71406 109850 473186 83309 169281 305150 197041 322896 455089 380009 480894 197718 169439 117038 9461 111542 243577 262536 67875 299271 311886 1416...

result:

ok all is ok (1 test case)

Test #117:

score: 20
Accepted
time: 502ms
memory: 192620kb

input:

1
500000 500000
262797 287497 266004 500000
74071 287497 111845 189535
72024 74071 56694 334218
72024 407057 304263 500000
368670 407057 15423 143366
292638 368670 238985 441703
289963 292638 297047 438044
289963 301094 15853 206514
301094 336492 312942 401505
182881 336492 14591 319500
182881 48961...

output:

YES
462138 111846 238506 468540 63135 345804 342140 115065 312942 223888 484461 453716 381166 323730 476450 347619 60248 110933 428710 278229 134745 497694 209275 117998 174679 494501 481157 16869 275116 292108 456454 215398 358911 477083 456072 205491 469533 269371 233316 239061 132009 345429 43959...

result:

ok all is ok (1 test case)

Test #118:

score: 20
Accepted
time: 452ms
memory: 209572kb

input:

1
500000 500000
2924 134417 1 500000
134417 432445 1 500000
432445 464203 1 500000
383628 464203 1 500000
383628 398462 1 500000
398462 444300 1 500000
159908 444300 1 500000
159908 384395 1 500000
296118 384395 1 373314
193297 296118 1 500000
156479 193297 1 500000
156479 459696 19285 500000
253458...

output:

YES
356659 356660 356661 356662 356663 356664 356665 356666 32490 356667 356668 484560 4099 356669 356670 356671 356672 356673 356674 356675 356676 356677 38566 356678 356679 356680 356681 34863 356682 356683 356685 356686 356687 356688 356689 356690 54597 356691 356692 356693 356694 356695 356696 3...

result:

ok all is ok (1 test case)

Subtask #7:

score: 11
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #119:

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

input:

100
26 50
9 15 7 10
10 26 11 14
18 26 9 13
4 19 8 9
11 20 17 21
12 15 27 27
14 20 22 27
19 24 9 11
7 10 1 3
1 6 9 14
19 20 3 4
15 26 4 5
16 23 19 24
1 19 17 17
2 19 35 39
21 23 39 39
6 26 6 6
7 25 11 11
5 24 4 6
9 16 11 15
8 19 31 33
3 5 21 22
13 23 35 37
6 22 41 43
5 17 1 3
13 26 38 38
4 5 16 18
18...

output:

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

result:

ok all is ok (100 test cases)

Test #120:

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

input:

100
26 50
11 18 17 18
16 20 13 14
7 9 23 23
21 22 3 4
4 20 7 8
11 23 19 19
1 20 24 25
12 15 15 15
7 21 9 9
15 24 1 2
17 18 11 11
8 22 22 22
5 18 7 7
5 26 20 21
3 12 5 6
13 23 33 33
1 18 32 33
14 25 10 10
12 19 29 29
10 21 1 2
5 21 6 6
14 22 30 30
2 5 16 16
3 6 12 12
2 3 4 4
2 20 46 47
3 6 49 49
11 2...

output:

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

result:

ok all is ok (100 test cases)

Test #121:

score: 11
Accepted
time: 2ms
memory: 15912kb

input:

10
251 500
28 246 256 275
16 246 304 304
71 246 163 169
34 246 389 407
115 246 298 299
73 246 259 279
225 246 33 35
56 246 442 448
76 246 10 10
30 246 151 166
18 246 55 55
55 246 185 195
15 246 211 212
239 246 360 366
177 246 201 215
4 246 368 385
104 246 158 161
9 246 90 102
93 246 285 288
2 246 16...

output:

YES
269 304 166 393 298 262 33 442 10 163 55 186 211 362 207 374 158 95 285 170 64 491 36 339 161 101 446 274 253 2 67 198 278 441 450 82 361 79 234 495 216 22 436 5 129 89 373 69 354 435 347 238 102 487 29 176 63 172 254 327 460 222 136 477 106 316 141 113 75 261 500 459 480 311 225 7 27 44 110 355...

result:

ok all is ok (10 test cases)

Test #122:

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

input:

10
251 500
31 58 98 116
31 148 319 325
31 37 71 80
31 169 486 500
31 221 385 390
13 31 389 390
31 247 332 339
31 239 61 65
31 64 144 151
31 88 238 248
31 202 381 389
31 68 461 481
31 108 194 213
31 179 465 484
31 53 340 356
31 131 444 449
22 31 313 322
26 31 1 4
25 31 278 279
31 113 407 408
31 233 4...

output:

YES
98 319 77 496 386 389 336 61 147 238 381 475 206 478 352 445 316 1 278 407 493 433 494 327 101 21 376 28 410 84 370 25 56 363 112 34 95 252 462 274 384 213 218 174 128 307 288 257 474 170 184 155 142 89 181 473 32 283 497 343 364 187 199 6 43 285 226 243 378 488 385 484 470 205 85 249 275 223 35...

result:

ok all is ok (10 test cases)

Test #123:

score: 11
Accepted
time: 4ms
memory: 16420kb

input:

1
2501 5000
2212 2301 1 5000
173 2301 1 4955
781 2301 800 5000
781 1932 2455 4096
1500 1932 1 5000
173 182 896 2532
182 1962 208 5000
867 2212 61 5000
264 1962 1 536
264 1591 1 5000
173 219 1 5000
1500 2435 1 2260
814 1962 1 5000
867 1568 2830 5000
173 950 1 5000
620 950 697 3292
264 613 3459 3551
7...

output:

NO

result:

ok all is ok (1 test case)

Test #124:

score: 11
Accepted
time: 5ms
memory: 16408kb

input:

1
3501 5000
2323 3344 1 759
1433 2323 461 5000
141 3344 724 4315
1556 2323 1 1735
1085 2323 1 3173
2112 2323 817 4396
1085 1332 4625 5000
1433 2526 735 5000
602 1085 1 2174
1541 3344 2108 5000
1332 2325 385 5000
110 3344 2947 4502
1213 1433 3823 4903
846 3344 1 2161
602 1237 1031 5000
1855 2112 4521...

output:

NO

result:

ok all is ok (1 test case)

Test #125:

score: 11
Accepted
time: 2ms
memory: 16068kb

input:

10
251 500
63 213 223 224
91 96 216 216
52 88 47 52
75 125 290 297
199 244 122 123
35 49 107 110
7 34 125 131
35 80 134 134
183 244 11 16
93 173 490 497
45 114 75 75
80 237 168 174
102 191 10 16
148 192 55 60
117 191 225 228
13 140 121 122
13 146 51 56
85 221 296 300
121 251 218 218
16 97 146 149
13...

output:

YES
223 216 49 293 122 108 125 134 14 491 75 171 12 56 225 121 53 299 218 148 277 40 36 77 249 63 107 224 61 17 65 367 43 94 35 99 20 151 1 6 333 42 66 50 28 267 192 78 48 34 183 282 213 54 73 261 175 13 88 21 143 86 32 120 18 58 96 294 69 129 55 347 15 51 133 226 101 152 195 103 74 90 118 468 22 3 ...

result:

ok all is ok (10 test cases)

Test #126:

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

input:

10
251 500
84 174 362 370
84 99 364 366
44 99 303 307
8 44 247 253
8 249 159 169
162 249 247 256
162 231 14 19
171 231 254 254
144 171 95 97
144 223 124 127
222 223 2 11
209 222 227 237
209 211 69 70
187 211 132 144
32 187 209 219
32 206 102 113
133 206 169 169
73 133 215 227
73 83 95 102
83 177 163...

output:

YES
366 364 303 249 165 253 14 254 95 126 6 234 69 140 215 110 169 225 98 167 238 201 127 142 179 23 128 207 51 99 116 220 39 211 229 149 38 59 218 102 151 35 1 112 133 52 16 181 223 154 146 109 177 129 36 186 90 100 148 198 44 103 156 89 85 191 144 173 97 125 232 200 105 135 20 123 82 204 174 139 6...

result:

ok all is ok (10 test cases)

Test #127:

score: 11
Accepted
time: 4ms
memory: 16076kb

input:

10
251 500
92 228 179 181
92 163 197 202
82 92 67 71
92 186 279 285
92 184 297 300
1 92 58 61
92 143 99 106
92 211 101 101
92 145 227 227
92 206 495 500
92 146 208 208
92 157 218 221
66 92 54 58
92 141 4 8
76 92 376 382
75 92 237 243
4 92 196 202
92 197 157 158
92 242 291 295
92 227 451 453
79 92 24...

output:

YES
180 199 67 282 297 59 104 101 227 497 208 218 54 6 380 237 198 158 293 451 249 85 205 16 84 304 319 191 138 50 102 422 95 136 256 69 353 404 34 382 274 131 148 23 207 92 371 420 219 47 435 66 288 65 376 285 172 126 331 17 19 431 10 105 429 120 318 52 56 2 243 123 465 438 83 397 305 436 472 160 3...

result:

ok all is ok (10 test cases)

Test #128:

score: 11
Accepted
time: 2ms
memory: 16380kb

input:

1
2501 5000
1920 2314 3823 3834
1250 2314 117 130
1387 2314 4074 4090
2314 2353 4741 4751
2278 2314 2244 2259
697 2314 126 142
2105 2314 3413 3440
2310 2314 277 304
1794 2314 292 309
1195 2314 3742 3783
867 2314 2941 2950
1207 2314 1203 1235
491 2314 4421 4427
1991 2314 1556 1573
664 2314 873 888
10...

output:

YES
3825 117 4077 4741 2246 128 3420 288 295 3742 2941 1218 4421 1562 873 1415 4720 4269 2725 2003 328 1831 2126 4102 4188 569 1888 3486 1334 1761 493 97 3777 4857 2270 3123 595 4946 70 3185 123 1344 641 24 4489 1767 3946 4054 1897 3603 2692 2592 3153 4572 3091 422 2154 3984 541 1936 3360 4383 1942 ...

result:

ok all is ok (1 test case)

Test #129:

score: 11
Accepted
time: 5ms
memory: 16032kb

input:

10
251 500
38 225 90 103
99 225 21 36
23 38 80 90
38 91 32 36
19 99 96 105
99 147 73 80
23 195 26 34
23 157 11 17
91 189 96 106
91 95 1 2
19 232 59 64
19 200 64 64
81 147 87 89
4 147 44 59
77 195 21 22
193 195 23 26
44 157 10 12
135 157 19 19
87 189 1 5
79 189 40 40
93 95 2 11
95 235 84 97
116 232 3...

output:

YES
98 30 84 32 101 77 28 16 102 1 61 64 87 53 21 23 10 19 4 40 8 92 43 99 73 79 12 109 59 15 63 103 33 6 94 163 69 235 108 145 47 218 29 83 13 50 42 11 57 68 52 24 86 104 20 172 7 75 72 18 39 31 100 202 205 74 128 135 65 14 179 76 147 204 333 118 276 231 3 177 143 144 45 110 210 302 138 364 97 62 1...

result:

ok all is ok (10 test cases)

Test #130:

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

input:

1
2501 5000
554 764 278 302
554 2366 11 43
764 1536 473 497
764 2439 164 199
616 2366 349 368
363 2366 482 515
1536 2179 405 427
1536 2481 205 211
2208 2439 784 784
1437 2439 498 519
616 1271 824 858
616 2075 543 548
363 881 299 303
363 725 404 416
1531 2179 109 123
2179 2377 428 457
912 2481 5 27
1...

output:

YES
290 35 486 184 356 503 415 205 784 507 849 543 299 406 111 444 15 903 875 789 858 435 837 5 38 635 48 326 335 224 495 389 148 970 896 311 197 322 271 885 547 90 684 74 315 118 209 902 323 973 790 990 890 882 146 627 373 144 258 56 21 795 445 207 745 408 31 906 392 300 381 940 479 260 430 355 162...

result:

ok all is ok (1 test case)

Test #131:

score: 11
Accepted
time: 3ms
memory: 18508kb

input:

1
2501 5000
119 611 3092 3112
119 1774 3092 3092
130 1774 3096 3111
130 2213 3087 3099
1020 2213 3092 3096
1020 1346 2849 2866
1346 1946 2853 2864
522 1946 2847 2853
522 2161 2841 2862
2161 2371 2852 2853
126 2371 2853 2873
126 440 2742 2754
208 440 2511 2514
54 208 1231 1248
54 1918 29 48
1860 1918...

output:

YES
3096 3092 3098 3091 3094 2855 2856 2847 2854 2852 2857 2745 2511 1240 44 655 134 2503 2519 2000 2517 1738 2506 1222 2500 2480 2493 2505 2502 2371 2478 2508 2488 2496 2487 2453 562 469 2498 2033 1897 2483 2442 2445 2504 1066 2477 135 876 279 2482 1572 593 2099 2490 2479 2397 1440 2491 277 2494 22...

result:

ok all is ok (1 test case)

Test #132:

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

input:

1
4001 5000
2624 3672 4999 5000
1196 3672 4989 5000
1194 1196 4968 4969
1194 3346 4620 4625
1269 3346 4617 4628
1269 3911 4622 4622
800 3911 4623 4630
800 1964 4235 4246
1964 2296 4233 4244
1393 2296 4239 4246
1393 3589 4189 4195
1302 3589 4192 4201
1302 3560 4186 4188
3537 3560 4049 4052
2946 3537 ...

output:

YES
5000 4995 4968 4621 4624 4622 4626 4242 4240 4243 4192 4198 4187 4050 4051 4046 4048 4003 3985 4023 4022 4021 4017 3999 4010 4001 4024 4011 4005 4012 4014 3997 3996 3995 4025 4016 3991 3987 4000 3989 1970 3951 2356 1520 2095 609 234 2927 420 3748 378 1345 1008 327 1314 885 2631 192 1657 997 1017...

result:

ok all is ok (1 test case)

Test #133:

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

input:

1
3001 5000
539 987 4992 4998
987 2070 4990 4994
750 2070 3932 3933
587 750 3929 3935
587 2851 3102 3105
401 2851 3079 3085
401 596 3070 3072
596 2073 3079 3080
586 2073 3069 3070
586 2197 3063 3064
1469 2197 3082 3084
797 1469 3103 3108
797 1691 3098 3104
611 1691 3101 3107
412 611 3066 3072
412 22...

output:

YES
4997 4992 3932 3933 3102 3083 3072 3079 3069 3063 3082 3104 3099 3103 3071 3068 3065 3066 3055 3062 2984 2977 2985 1396 2649 2681 607 2216 916 2653 2674 2924 1048 1291 146 2375 2462 1314 285 2325 2013 1286 1658 2870 1940 970 1006 807 2733 1711 538 295 1643 824 2061 1887 496 172 733 2006 2111 197...

result:

ok all is ok (1 test case)

Test #134:

score: 11
Accepted
time: 5ms
memory: 14448kb

input:

1
2001 5000
625 1894 2505 2505
1046 1894 2419 2425
1046 1212 2419 2420
1212 1683 2158 2164
1031 1683 2036 2036
139 1031 2036 2038
139 1229 2041 2043
168 1229 2014 2020
168 583 2023 2026
247 583 1988 1994
247 796 2009 2015
143 796 1652 1652
120 143 2019 2021
120 1375 2030 2034
1228 1375 2034 2034
278...

output:

YES
2505 2422 2419 2160 2036 2037 2043 2017 2026 1990 2013 1652 2020 2032 2034 2021 2008 2029 1343 2003 1993 2023 2014 2040 1998 2025 2019 2000 324 761 2038 2010 1678 641 812 1167 964 1773 190 1272 1956 318 225 30 280 1033 707 1618 476 479 397 1159 1557 19 1279 551 928 1854 1115 1824 1775 440 1948 1...

result:

ok all is ok (1 test case)

Test #135:

score: 11
Accepted
time: 5ms
memory: 16356kb

input:

1
1001 5000
467 645 1495 1498
189 645 800 800
189 944 617 619
523 944 980 983
387 523 386 387
387 983 364 365
658 983 733 734
658 939 978 981
573 939 634 636
207 573 187 188
147 207 308 310
147 184 902 905
184 213 776 779
213 386 269 272
386 483 787 787
483 604 803 804
586 604 174 175
98 586 943 945...

output:

YES
1495 800 619 981 386 364 733 980 635 187 308 904 776 269 787 804 175 945 621 52 135 822 879 293 369 361 40 743 687 565 186 729 260 10 566 717 454 284 563 137 120 885 194 374 300 486 510 689 261 891 789 883 410 88 77 144 210 801 68 358 448 613 949 316 459 538 7 331 517 170 430 307 594 934 834 200...

result:

ok all is ok (1 test case)

Test #136:

score: 11
Accepted
time: 5ms
memory: 16496kb

input:

1
2501 5000
1046 2160 4999 5000
867 2160 3311 3329
867 1214 3208 3284
1214 1902 3078 3167
1653 1902 2659 2766
1653 1935 2643 2816
4 1935 2592 2742
4 628 2591 2716
628 2130 2452 2657
2130 2359 2481 2676
1444 2359 2531 2536
274 1444 2397 2561
105 274 2444 2664
105 1607 2520 2638
1607 1826 2457 2667
18...

output:

YES
5000 3311 3234 3078 2693 2711 2663 2645 2530 2535 2531 2512 2529 2538 2534 2539 2511 2540 2426 330 2436 1418 2431 2457 244 902 1779 1669 2443 2438 1473 59 218 1927 446 914 1187 1315 2383 438 974 316 178 2227 1350 2092 2442 1542 229 933 1863 1912 763 1386 54 1539 2163 781 233 796 929 2455 2343 28...

result:

ok all is ok (1 test case)

Test #137:

score: 11
Accepted
time: 5ms
memory: 16868kb

input:

1
3501 5000
1304 3311 4878 4893
1301 3311 4879 4911
953 1301 4884 4934
953 1058 3921 3973
1058 1558 3929 3986
1558 2634 3935 3990
2634 3187 3941 3959
98 3187 3941 3946
98 3477 3591 3646
848 3477 3611 3612
1 848 3614 3616
1 3312 3622 3637
467 3312 3605 3662
239 467 3609 3637
239 2409 3608 3663
2409 2...

output:

YES
4878 4879 4884 3955 3960 3963 3944 3941 3636 3611 3614 3625 3644 3624 3646 3627 3615 3617 3628 3597 3610 3605 3620 3616 3520 3515 3519 3530 3510 3522 3497 3504 3529 3514 3502 3528 3508 3525 3523 3495 3518 3512 3511 3517 3503 3513 3526 3444 3446 3472 3451 3453 3457 3469 3454 3437 3480 3439 3448 3...

result:

ok all is ok (1 test case)

Test #138:

score: 11
Accepted
time: 5ms
memory: 16472kb

input:

1
2501 5000
1955 2193 4263 5000
1374 2193 2941 3434
679 1374 2737 3526
679 1632 2494 3633
1632 1645 2602 2610
1645 2197 1898 2643
1130 2197 2531 2548
1130 2151 2561 2571
440 2151 2050 2885
440 775 2411 2552
775 1831 2450 3290
1524 1831 2277 2805
1523 1524 2362 2567
195 1523 2183 2932
195 1106 2242 3...

output:

YES
4755 3108 2999 2998 2602 2494 2531 2561 2641 2453 2514 2503 2455 2498 2500 2505 1062 669 488 2496 2213 794 2471 2444 2513 1095 558 1989 2447 2511 672 2383 2510 2504 2502 784 2438 2456 217 2090 891 1211 1702 980 2497 819 2064 1463 2501 1999 667 115 1325 609 2043 128 1773 436 464 2044 1411 591 152...

result:

ok all is ok (1 test case)

Test #139:

score: 11
Accepted
time: 5ms
memory: 16664kb

input:

1
3501 5000
2024 2275 4162 4307
681 2275 3743 4378
681 2224 3370 3927
1380 2224 3598 3865
876 1380 3682 4039
876 2288 3240 3899
833 2288 3554 3757
833 2766 3344 3786
1421 2766 3310 3622
1421 2260 3336 3771
1293 2260 3527 3538
1293 1812 3441 3674
1812 3226 3340 3599
2719 3226 3324 3549
2600 2719 3505...

output:

YES
4162 4015 3721 3672 3829 3697 3599 3612 3496 3535 3527 3542 3483 3463 3505 3494 3546 3536 3540 3548 3499 3466 3545 3534 3543 3513 3533 3530 3541 3537 3544 1925 540 2375 2072 2743 2116 3058 2629 1692 328 3504 1773 2522 2070 3473 1966 364 1539 2971 3139 1625 2133 602 800 2376 717 3450 2686 2087 35...

result:

ok all is ok (1 test case)

Test #140:

score: 11
Accepted
time: 5ms
memory: 16552kb

input:

1
2501 5000
2155 2364 2395 2410
2155 2225 1864 1866
2225 2386 2234 2244
1897 2386 2505 2508
1414 1897 2516 2520
1025 1414 1995 2010
1025 2228 1307 1316
1913 2228 2513 2525
1913 2409 2496 2508
2178 2409 474 481
2025 2178 732 733
1887 2025 2492 2492
1090 1887 1762 1765
517 1090 2519 2528
517 2260 2477...

output:

YES
2406 1864 2238 2507 2516 2004 1311 2521 2505 477 732 2492 1764 2525 2483 2508 1235 2495 2499 2220 1009 120 2514 744 44 748 2519 197 1533 1859 1041 2108 787 65 2500 1482 1159 70 2523 323 2522 780 2490 1369 1277 96 1718 1249 2022 544 1412 1198 2480 537 278 1059 2060 2515 459 2044 1456 439 1251 167...

result:

ok all is ok (1 test case)

Test #141:

score: 11
Accepted
time: 2ms
memory: 16864kb

input:

1
3501 5000
1677 2949 4845 5000
2949 3374 3687 4424
1883 3374 4202 4471
1883 3119 3165 4445
3022 3119 3454 5000
945 3022 3383 4159
945 3309 2812 3756
527 3309 2409 4254
527 1159 3487 3627
1159 2506 2335 3645
2395 2506 2570 4225
2275 2395 3403 4591
2275 2330 3414 4237
727 2330 3289 3784
727 1719 3116...

output:

YES
4980 3880 4202 3900 3942 3739 3527 3587 3487 3458 3589 3595 3596 3541 3429 3523 3590 3503 3593 3435 3512 1719 2931 1270 3547 3455 3343 835 2781 3452 3295 2895 3493 3484 3466 3488 3492 3485 3486 3474 3461 3460 3476 3479 888 3468 1922 884 3434 2243 2272 1226 3482 2783 2063 65 984 264 2083 3477 231...

result:

ok all is ok (1 test case)

Test #142:

score: 11
Accepted
time: 2ms
memory: 16736kb

input:

1
2501 5000
230 1156 1 5000
230 1620 955 5000
1302 1620 1 5000
1302 1713 1 5000
104 1713 1 5000
104 1961 1 5000
673 1961 1 5000
391 673 1 5000
391 433 1 5000
433 873 1 5000
873 2374 1 5000
1340 2374 1 2816
1340 2419 1 5000
302 2419 1 5000
302 2379 1 5000
784 2379 1 5000
699 784 1 5000
699 2148 1 500...

output:

YES
2624 2385 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 2364 1308 1309 1310 1311 1312 1313 2510 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1327 2359 148 1328 35 1329 1330 2170 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344...

result:

ok all is ok (1 test case)

Subtask #8:

score: 8
Accepted

Test #143:

score: 8
Accepted
time: 88ms
memory: 16012kb

input:

1000
251 500
1 2 280 287
2 3 251 256
3 4 249 249
4 5 252 253
5 6 252 256
6 7 250 250
7 8 254 261
8 9 245 256
9 10 123 127
10 11 45 49
11 12 122 128
12 13 164 167
13 14 153 156
14 15 210 217
15 16 53 64
16 17 205 208
17 18 136 149
18 19 132 135
19 20 24 27
20 21 45 51
21 22 21 30
22 23 5 7
23 24 178 ...

output:

YES
281 254 249 252 255 250 257 253 123 46 125 164 153 214 58 205 145 132 24 47 26 6 180 86 78 216 187 107 217 23 181 110 21 32 122 8 221 27 127 207 141 36 215 43 11 185 150 69 68 146 168 211 163 142 90 159 134 61 29 172 85 115 138 54 76 165 30 147 103 3 105 75 139 177 189 1 14 73 209 35 192 33 124 ...

result:

ok all is ok (1000 test cases)

Test #144:

score: 8
Accepted
time: 89ms
memory: 16052kb

input:

1000
351 500
1 2 62 69
2 3 225 227
3 4 160 166
4 5 172 177
5 6 118 120
6 7 35 42
7 8 92 100
8 9 82 87
9 10 222 230
10 11 234 239
11 12 141 145
12 13 213 217
13 14 110 116
14 15 154 157
15 16 280 280
16 17 243 250
17 18 124 132
18 19 20 29
19 20 328 329
20 21 41 48
21 22 189 192
22 23 241 249
23 24 4...

output:

YES
64 225 163 174 118 39 95 85 226 234 141 213 115 156 280 248 131 25 328 43 190 247 49 157 70 214 255 284 9 143 235 28 282 149 26 334 216 123 249 86 134 139 313 170 323 221 78 72 110 217 151 268 128 238 30 41 330 294 48 45 187 112 344 253 55 180 66 97 107 348 340 318 19 125 87 312 63 93 162 38 303...

result:

ok all is ok (1000 test cases)

Test #145:

score: 8
Accepted
time: 80ms
memory: 16048kb

input:

1000
251 500
1 2 175 184
2 3 74 76
3 4 134 143
4 5 63 69
5 6 18 19
6 7 258 258
7 8 216 221
8 9 157 163
9 10 224 229
10 11 220 227
11 12 115 115
12 13 187 189
13 14 209 216
14 15 1 4
15 16 10 10
16 17 82 83
17 18 75 84
18 19 146 148
19 20 233 238
20 21 80 87
21 22 134 136
22 23 59 59
23 24 228 238
24...

output:

YES
182 74 138 65 19 258 218 160 226 221 115 187 214 1 10 82 80 146 235 86 136 59 234 112 121 83 216 68 34 94 28 53 215 200 144 217 58 201 106 27 155 57 148 54 42 125 93 84 170 228 51 63 69 78 21 175 153 4 71 174 134 242 157 96 6 162 26 45 99 36 198 149 119 241 220 132 14 161 186 81 120 233 118 229 ...

result:

ok all is ok (1000 test cases)

Test #146:

score: 8
Accepted
time: 74ms
memory: 16240kb

input:

1000
151 500
1 2 198 198
2 3 165 167
3 4 1 10
4 5 121 125
5 6 114 117
6 7 131 136
7 8 134 141
8 9 97 103
9 10 90 94
10 11 133 135
11 12 118 123
12 13 51 60
13 14 139 147
14 15 61 61
15 16 46 49
16 17 33 40
17 18 62 62
18 19 70 76
19 20 65 69
20 21 114 122
21 22 1 1
22 23 71 71
23 24 5 5
24 25 2 5
25...

output:

YES
198 167 7 124 116 135 137 97 91 134 121 57 144 61 46 38 62 70 65 118 1 71 5 4 18 96 6 89 78 20 68 19 107 40 133 77 101 66 69 99 112 100 122 136 142 85 51 80 86 138 103 125 33 31 114 132 43 117 92 76 58 111 143 104 49 2 64 128 50 75 25 42 30 55 8 98 87 131 109 47 74 28 79 88 123 12 115 130 129 11...

result:

ok all is ok (1000 test cases)

Test #147:

score: 8
Accepted
time: 241ms
memory: 103276kb

input:

1
250001 500000
1 2 232634 232778
2 3 439147 439210
3 4 242069 242195
4 5 123158 123260
5 6 404204 404219
6 7 148853 149029
7 8 128047 128105
8 9 241218 241219
9 10 396066 396078
10 11 431745 431863
11 12 265898 265945
12 13 358860 358915
13 14 154751 154864
14 15 346376 346465
15 16 251154 251293
1...

output:

NO

result:

ok all is ok (1 test case)

Test #148:

score: 8
Accepted
time: 224ms
memory: 103204kb

input:

1
250001 500000
1 2 372249 373236
2 3 351474 352579
3 4 241138 242185
4 5 435154 435927
5 6 401961 403137
6 7 173100 173817
7 8 155176 156484
8 9 63955 64214
9 10 311244 312461
10 11 48185 49366
11 12 431470 431604
12 13 276348 276648
13 14 371291 372298
14 15 304170 305042
15 16 493375 493860
16 17...

output:

NO

result:

ok all is ok (1 test case)

Test #149:

score: 8
Accepted
time: 223ms
memory: 103264kb

input:

1
250001 500000
1 2 277031 302631
2 3 272854 285543
3 4 424143 468447
4 5 396355 403233
5 6 289295 307306
6 7 285064 314710
7 8 379021 381726
8 9 487091 490187
9 10 398992 426493
10 11 1 5954
11 12 26437 62862
12 13 424015 464639
13 14 325754 338143
14 15 330349 346931
15 16 189161 202399
16 17 1842...

output:

NO

result:

ok all is ok (1 test case)

Test #150:

score: 8
Accepted
time: 180ms
memory: 28788kb

input:

10
25001 50000
1 2 31358 31509
2 3 28901 28919
3 4 28884 28946
4 5 25217 25746
5 6 25276 25394
6 7 24956 25369
7 8 25000 25224
8 9 25095 25337
9 10 24823 25407
10 11 12565 12923
11 12 24691 25012
12 13 24252 24380
13 14 24735 25027
14 15 23497 23937
15 16 5156 5690
16 17 24729 25155
17 18 24723 2507...

output:

YES
31358 28901 28884 25561 25276 25218 25064 25187 25253 12732 24907 24252 24915 23743 5494 24986 24951 23296 22151 8887 25008 17031 7675 24875 24892 9428 25007 12140 12329 7603 24934 2384 24953 14898 19981 24589 24893 30 13731 9389 17975 18941 25006 5123 24988 25005 24307 23100 24922 23251 24888 2...

result:

ok all is ok (10 test cases)

Test #151:

score: 8
Accepted
time: 188ms
memory: 29000kb

input:

10
25001 50000
1 2 36781 37518
2 3 25466 26238
3 4 25463 26245
4 5 24868 25339
5 6 25182 25355
6 7 25214 25517
7 8 25226 25304
8 9 25216 25519
9 10 25042 25053
10 11 24931 25199
11 12 8625 8773
12 13 1430 1507
13 14 3117 3652
14 15 24886 25407
15 16 19619 20184
16 17 24890 25270
17 18 24663 25471
18...

output:

YES
37271 25854 25852 25138 25182 25277 25226 25283 25042 24996 8625 1430 3404 24986 19956 24987 24967 24965 25031 17429 4220 6860 24897 14938 24134 2975 24241 6454 21996 3075 21143 24973 10522 8945 6017 9087 13245 4148 19704 24902 24966 17835 13055 24995 11114 23118 11508 24970 21386 23761 12799 46...

result:

ok all is ok (10 test cases)

Test #152:

score: 8
Accepted
time: 348ms
memory: 126196kb

input:

1
250001 500000
1 2 259518 259754
2 3 259411 259762
3 4 259296 259689
4 5 259454 259620
5 6 259524 259607
6 7 259550 259599
7 8 259385 259626
8 9 259461 259565
9 10 259337 259617
10 11 259505 259631
11 12 259318 259632
12 13 259403 259672
13 14 259530 259577
14 15 259424 259657
15 16 259569 259620
1...

output:

YES
259558 259554 259549 259513 259525 259550 259517 259461 259505 259522 259526 259552 259530 259555 259569 259557 259556 259559 259561 259533 259495 250330 250252 250321 250476 250507 250492 250467 250262 250421 250367 250410 250260 250361 250362 250261 250230 250297 250314 250269 250318 250346 25...

result:

ok all is ok (1 test case)

Test #153:

score: 8
Accepted
time: 350ms
memory: 179396kb

input:

1
400001 500000
1 2 499992 500000
2 3 452848 454137
3 4 420800 422040
4 5 420925 422118
5 6 420333 421827
6 7 421677 423163
7 8 418884 422170
8 9 420655 422958
9 10 420170 423002
10 11 421663 421694
11 12 411459 412764
12 13 410515 412117
13 14 410180 412346
14 15 411512 412666
15 16 411542 412255
1...

output:

YES
500000 453113 421027 421118 420819 422170 421179 421976 422018 421663 411460 411096 411235 411513 411542 411234 411426 411237 410883 411382 403498 403499 403676 404159 403496 403887 403858 404075 400795 400803 400785 401027 401231 400800 400806 400807 401140 401363 400814 400797 400538 401191 40...

result:

ok all is ok (1 test case)

Test #154:

score: 8
Accepted
time: 375ms
memory: 143876kb

input:

1
300001 500000
1 2 339269 339579
2 3 324668 325565
3 4 321466 321470
4 5 299249 299913
5 6 299754 299847
6 7 299923 300237
7 8 299616 300640
8 9 300215 300951
9 10 300072 300486
10 11 299083 299983
11 12 299618 300104
12 13 299784 300253
13 14 300145 300416
14 15 299778 300125
15 16 299760 300402
1...

output:

YES
339269 325198 321466 299660 299754 299924 300277 300470 300115 299704 299788 299917 300145 299800 300045 299756 300103 300138 300094 300456 299628 300152 300172 300275 300462 299975 300038 299949 300101 300467 299869 300466 300177 299659 299809 299824 299727 299986 300099 299866 300001 299974 30...

result:

ok all is ok (1 test case)

Test #155:

score: 8
Accepted
time: 363ms
memory: 109796kb

input:

1
200001 500000
1 2 291127 291234
2 3 215988 216316
3 4 216222 216239
4 5 216223 216246
5 6 210689 211053
6 7 210583 210897
7 8 210707 211069
8 9 206674 206847
9 10 206840 206975
10 11 206830 206839
11 12 206669 206840
12 13 206808 206835
13 14 201717 202102
14 15 201744 201945
15 16 201642 201704
1...

output:

YES
291128 216130 216222 216223 210697 210695 210708 206726 206855 206830 206716 206808 201717 201744 201642 201690 201720 201732 201670 201705 201691 201704 201701 201765 201739 201676 201683 201648 201748 201672 201753 201698 201680 201697 201632 201733 201703 201655 201657 201673 201700 201756 20...

result:

ok all is ok (1 test case)

Test #156:

score: 8
Accepted
time: 315ms
memory: 76576kb

input:

1
100001 500000
1 2 106900 106990
2 3 106914 106929
3 4 102586 103228
4 5 102360 103034
5 6 102946 103436
6 7 103000 103064
7 8 102872 103107
8 9 102424 103010
9 10 102740 103144
10 11 102983 103111
11 12 101525 102150
12 13 101652 101915
13 14 101672 102072
14 15 101590 101934
15 16 99832 100435
16...

output:

YES
106900 106914 102996 102804 103174 103000 102872 102773 102899 102983 101719 101652 101721 101676 100076 100108 100101 99911 100058 100086 99897 99962 100070 99774 99979 99821 99973 100059 100064 99881 100193 100092 5315 100081 100054 99958 100114 99991 99866 99781 100055 99932 99912 99957 99844...

result:

ok all is ok (1 test case)

Test #157:

score: 8
Accepted
time: 397ms
memory: 126184kb

input:

1
250001 500000
1 2 253823 263332
2 3 251831 266180
3 4 259436 277518
4 5 257822 267868
5 6 254226 263360
6 7 259551 264281
7 8 258893 263282
8 9 245573 263476
9 10 254781 265360
10 11 254967 263374
11 12 256384 258542
12 13 254347 273470
13 14 253167 258046
14 15 252893 254807
15 16 253990 254608
1...

output:

YES
257405 257404 259436 257823 257407 259551 258893 257403 257408 254967 256384 254347 253451 252893 253990 253878 253049 253418 251209 252222 253425 253422 253420 252788 252483 253143 254356 253419 253421 253426 254042 253294 253423 250113 250931 249939 250829 250046 251051 251032 250515 250797 25...

result:

ok all is ok (1 test case)

Test #158:

score: 8
Accepted
time: 411ms
memory: 160320kb

input:

1
350001 500000
1 2 370625 372357
2 3 371765 375069
3 4 370971 408071
4 5 347060 383450
5 6 324223 379821
6 7 360800 380086
7 8 369915 404768
8 9 341388 360376
9 10 330962 355384
10 11 350251 388901
11 12 346582 378673
12 13 344231 367257
13 14 338495 365138
14 15 348533 357515
15 16 349429 387685
1...

output:

YES
370625 371765 381824 367951 364829 365045 371036 351430 350764 351440 351438 351435 351429 351421 351439 351427 351237 350122 351428 350381 350439 350473 350469 350389 350228 350388 350441 350399 350498 350459 350421 350420 350408 350457 350432 350352 350361 350496 350427 350460 350445 350477 35...

result:

ok all is ok (1 test case)

Test #159:

score: 8
Accepted
time: 402ms
memory: 125204kb

input:

1
250001 500000
1 2 245600 252151
2 3 250694 256517
3 4 249052 255422
4 5 251032 252053
5 6 247385 252929
6 7 248560 253843
7 8 249914 255109
8 9 251325 259962
9 10 247587 253220
10 11 249044 251391
11 12 251107 251644
12 13 247411 252788
13 14 249389 258014
14 15 248208 251587
15 16 249754 253916
1...

output:

YES
250429 252584 252582 251032 250977 251548 252522 252587 251140 250050 251107 250885 252583 250140 251601 250208 251054 252585 252586 251147 251862 250083 250622 249666 250445 249726 250249 250604 251281 249691 250279 249830 251278 250013 250314 249755 251272 251070 251280 251284 249701 250808 25...

result:

ok all is ok (1 test case)

Test #160:

score: 8
Accepted
time: 429ms
memory: 158568kb

input:

1
350001 500000
1 2 363278 376120
2 3 342099 390684
3 4 345866 444221
4 5 335918 417280
5 6 327208 438347
6 7 349874 359171
7 8 346272 385180
8 9 298319 361357
9 10 278803 359384
10 11 349708 359940
11 12 331584 361952
12 13 348075 358429
13 14 286557 372895
14 15 344970 364576
15 16 284271 383850
1...

output:

YES
363278 361746 361747 351338 351337 351079 351339 351336 349991 350055 350021 350050 349995 350038 349993 350011 350004 350026 350005 350047 350045 350030 350012 350044 350007 350031 350017 349997 350013 350035 350025 350034 350036 350053 349992 350002 350052 191835 350046 350033 350024 349999 20...

result:

ok all is ok (1 test case)

Test #161:

score: 8
Accepted
time: 428ms
memory: 126792kb

input:

1
250001 500000
1 2 282631 282932
2 3 207353 405027
3 4 281869 282231
4 5 263660 291326
5 6 254291 500000
6 7 252423 418013
7 8 209027 289085
8 9 201898 490514
9 10 139664 288456
10 11 215892 268964
11 12 220031 255971
12 13 209011 254709
13 14 248889 255949
14 15 182378 278918
15 16 232592 379548
1...

output:

YES
282631 282495 281869 263660 282498 282496 257213 282494 257022 251986 250099 250001 250094 254247 258633 250152 258632 251664 249947 249948 249924 249927 249956 249955 249929 249953 249952 249949 249960 249935 249937 249921 249946 249958 249940 249925 65446 249945 249930 249916 249944 60900 2499...

result:

ok all is ok (1 test case)

Test #162:

score: 8
Accepted
time: 416ms
memory: 162004kb

input:

1
350001 500000
1 2 384079 465239
2 3 344477 478991
3 4 265262 500000
4 5 237986 500000
5 6 357142 388714
6 7 204917 413624
7 8 252959 472380
8 9 290029 435736
9 10 342714 365342
10 11 177346 414518
11 12 275489 429003
12 13 339805 500000
13 14 285847 500000
14 15 332488 475269
15 16 240662 500000
1...

output:

YES
394687 364616 364615 353046 357142 353045 353048 353053 351383 353044 353050 353057 353051 353055 353047 351110 353056 353054 353049 351310 351330 351329 351318 351325 351316 350334 351320 351317 351323 351327 351321 182793 139471 160337 350169 224218 351309 351313 351314 136586 351308 81464 798...

result:

ok all is ok (1 test case)

Test #163:

score: 8
Accepted
time: 445ms
memory: 127544kb

input:

1
250001 500000
1 2 92881 429699
2 3 190528 301684
3 4 226959 350913
4 5 249455 287469
5 6 59760 320597
6 7 197844 463609
7 8 201699 268567
8 9 236739 500000
9 10 216916 500000
10 11 249499 297685
11 12 239876 259752
12 13 247942 266668
13 14 160239 276471
14 15 93393 431866
15 16 101539 390853
16 1...

output:

YES
274292 258602 258603 255335 251424 251438 251439 251448 251444 251455 250287 251201 251431 251425 251426 249859 250713 251447 251427 250178 250093 251430 250805 251429 251442 251454 251435 251449 251433 251420 251434 251450 251432 251445 251428 251436 251437 251441 249764 251451 251443 251421 25...

result:

ok all is ok (1 test case)

Test #164:

score: 8
Accepted
time: 54ms
memory: 39020kb

input:

1
50001 100000
1 2 56411 56441
2 3 56426 56436
3 4 56419 56450
4 5 56420 56440
5 6 56398 56436
6 7 50484 50513
7 8 50490 50492
8 9 50474 50507
9 10 23208 23210
10 11 47609 47634
11 12 46446 46461
12 13 14117 14130
13 14 49533 49571
14 15 6656 6681
15 16 15724 15758
16 17 43071 43113
17 18 19796 1982...

output:

YES
56429 56426 56430 56431 56422 50484 50490 50483 23208 47621 46451 14123 49559 6671 15747 43102 19818 24340 14957 22880 13513 35510 18999 13304 33808 4647 49560 17810 37516 41786 49913 8387 26002 49923 44916 13583 30943 3648 29460 35836 33739 29926 37710 40996 17975 37978 18333 27830 37988 41053 ...

result:

ok all is ok (1 test case)

Test #165:

score: 8
Accepted
time: 47ms
memory: 40300kb

input:

1
60001 100000
1 2 65167 65239
2 3 1502 1718
3 4 7989 8408
4 5 21291 21640
5 6 5615 5685
6 7 3239 3528
7 8 40636 41042
8 9 23954 24229
9 10 46567 46586
10 11 55537 55756
11 12 14255 14332
12 13 11262 11411
13 14 6322 6451
14 15 56665 56833
15 16 19212 19354
16 17 59654 59973
17 18 11657 11925
18 19 ...

output:

YES
65167 1583 8291 21490 5615 3396 40914 24080 46567 55616 14255 11287 6324 56711 19237 59920 11780 47581 43590 9490 57126 48383 8818 11024 15082 36965 49088 34048 54017 59949 52899 1372 8354 15480 16870 38549 16656 28056 58066 9410 45408 45473 34243 22714 19316 3144 20291 59987 19968 43848 47213 1...

result:

ok all is ok (1 test case)

Test #166:

score: 8
Accepted
time: 43ms
memory: 29116kb

input:

1
20001 100000
1 2 23088 23487
2 3 22951 23269
3 4 23051 23211
4 5 21607 21936
5 6 21486 21946
6 7 21801 22456
7 8 21841 22752
8 9 21838 21855
9 10 20838 21019
10 11 20556 20965
11 12 20791 21166
12 13 20363 21088
13 14 20181 20525
14 15 20354 20876
15 16 20249 20517
16 17 19807 20678
17 18 19876 20...

output:

YES
23223 23003 23051 21645 21644 21801 21841 21838 20838 20612 20791 20363 20271 20354 20272 20268 20270 20355 10889 2601 10824 14071 9631 13704 404 330 7399 6542 12648 1491 9710 17125 6915 12276 3327 4742 1817 6593 14490 17097 774 12990 12416 17333 3717 11569 13282 4316 19488 10041 19348 19990 184...

result:

ok all is ok (1 test case)

Test #167:

score: 8
Accepted
time: 52ms
memory: 30628kb

input:

1
30001 100000
1 2 38420 40575
2 3 33273 37195
3 4 29410 32244
4 5 30299 32360
5 6 30611 31883
6 7 31660 32239
7 8 29611 32425
8 9 28874 33245
9 10 29970 33183
10 11 29502 31340
11 12 30119 30576
12 13 30108 32235
13 14 30002 30169
14 15 29736 33957
15 16 29809 34220
16 17 29016 30507
17 18 29966 31...

output:

YES
39167 33274 31079 31173 30789 31660 31224 31304 31305 30453 30119 30108 30002 29853 29855 29845 29966 29854 30045 29947 29849 29846 29838 30128 29837 29850 29840 29748 29839 29842 29788 29852 29835 29901 29848 29847 29836 29833 29851 29841 29768 29785 29777 29699 29780 29771 15453 6655 23872 649...

result:

ok all is ok (1 test case)

Test #168:

score: 8
Accepted
time: 44ms
memory: 39220kb

input:

1
50001 100000
1 2 64505 65250
2 3 48787 51354
3 4 49210 51701
4 5 50399 51475
5 6 49921 53074
6 7 50616 52285
7 8 50118 51225
8 9 50703 51032
9 10 49111 52060
10 11 49260 50545
11 12 49693 51538
12 13 49522 51645
13 14 48983 50362
14 15 26179 29312
15 16 13140 15706
16 17 40707 42455
17 18 43136 44...

output:

YES
64505 50576 50827 50659 50908 50909 50491 50703 50907 50114 50713 50091 50018 28335 14693 41520 43873 2453 7700 10927 46676 32822 50085 8696 33278 23382 38271 9304 33743 22429 27300 36822 15329 25349 35240 40536 43371 33652 46077 41057 17893 13006 43045 50090 32199 11154 34376 7493 32016 32691 3...

result:

ok all is ok (1 test case)

Test #169:

score: 8
Accepted
time: 47ms
memory: 35372kb

input:

1
50001 100000
1 2 1 100000
2 3 1 100000
3 4 1 100000
4 5 1 100000
5 6 1 83312
6 7 1 100000
7 8 1 100000
8 9 1 65009
9 10 49114 100000
10 11 32569 51371
11 12 1 100000
12 13 1 100000
13 14 1 100000
14 15 1 100000
15 16 1 100000
16 17 1 100000
17 18 45545 100000
18 19 1 100000
19 20 1 100000
20 21 86...

output:

YES
54997 54998 54999 55000 52480 53261 53262 50590 51780 47786 51779 49791 49792 49793 49794 49795 49847 49796 49797 49840 49798 49799 49800 49801 49802 49803 49804 49805 49846 49806 49845 49807 49808 49809 49810 49811 49812 49813 49814 49815 49816 49817 49818 49819 49820 4962 49821 49822 41754 498...

result:

ok all is ok (1 test case)

Subtask #9:

score: 12
Accepted

Dependency #7:

100%
Accepted

Test #170:

score: 12
Accepted
time: 20ms
memory: 16412kb

input:

100
501 1000
59 300 426 438
15 166 59 90
58 306 424 441
183 451 328 330
56 496 380 411
12 387 212 230
250 410 191 212
282 460 123 132
169 392 647 676
74 362 269 286
273 459 154 177
187 420 204 232
52 180 515 529
178 498 774 777
93 310 607 608
78 344 162 196
186 498 122 130
240 425 395 399
190 501 22...

output:

YES
426 83 429 328 401 220 206 123 670 271 166 222 522 774 607 187 122 395 224 298 197 256 438 59 105 65 513 195 147 71 215 51 278 214 144 435 117 66 61 31 347 370 293 189 625 353 154 577 340 173 534 82 86 160 386 333 257 319 250 294 130 487 167 165 300 45 498 134 596 362 153 34 458 681 24 357 96 45...

result:

ok all is ok (100 test cases)

Test #171:

score: 12
Accepted
time: 25ms
memory: 17644kb

input:

10
5001 10000
2215 3470 9821 9832
3470 4468 2363 2393
2600 3470 9557 9598
2504 3470 58 64
67 3470 4182 4207
2952 3470 9751 9767
3351 3470 7357 7405
2460 3470 4335 4380
3249 3470 4231 4256
2748 3470 9175 9231
1303 3470 937 985
888 3470 7032 7096
3042 3470 9426 9470
222 3470 1745 1746
3470 3937 6159 6...

output:

YES
9821 2376 9581 58 4187 9751 7379 4343 4231 9209 970 7054 9452 1745 6161 8627 8866 9126 1697 1588 3148 4460 8935 7603 9229 1960 4767 8619 4440 3822 329 5638 2659 5279 1559 3672 3364 9053 9707 460 4295 7519 1299 7447 5776 1599 4315 74 2785 4280 377 4780 3572 2636 769 3646 1213 777 3411 5519 3798 1...

result:

ok all is ok (10 test cases)

Test #172:

score: 12
Accepted
time: 18ms
memory: 29932kb

input:

1
50001 100000
20224 36845 10161 79384
20224 29899 51057 77049
25462 36845 28446 58635
36845 40508 45379 100000
12821 36845 39925 96830
27839 36845 1 47070
27839 42140 16578 87324
18866 27839 74859 86715
15560 40508 82347 97864
1605 18866 3003 9284
15560 33038 43113 49621
1713 15560 21407 51175
2117...

output:

NO

result:

ok all is ok (1 test case)

Test #173:

score: 12
Accepted
time: 25ms
memory: 35384kb

input:

1
65001 100000
18673 53473 65949 68154
18673 49612 85622 100000
1286 18673 31518 69068
1286 3475 45822 100000
3475 46398 68171 71542
1286 60218 17704 42247
1149 18673 1 29176
21451 46398 68989 87365
46398 48056 29642 66351
19644 48056 72149 93300
24266 49612 20493 36910
29230 48056 20281 29355
21451...

output:

NO

result:

ok all is ok (1 test case)

Test #174:

score: 12
Accepted
time: 26ms
memory: 17132kb

input:

10
5001 10000
662 976 464 518
2560 4545 5877 5964
2173 3509 5793 5881
1326 2907 3214 3221
1554 2087 1239 1330
104 4998 935 973
1399 3388 1118 1183
1352 3401 1327 1331
828 2338 3805 3810
3111 4746 5630 5688
2531 4671 4417 4470
3051 4465 375 439
1216 2711 3919 4011
2158 2386 525 545
2408 2853 5288 535...

output:

YES
485 5936 5846 3214 1307 946 1158 1327 3805 5661 4442 410 3981 525 5322 8879 6715 1527 1103 2437 2675 6595 4479 2198 606 2320 175 3557 2813 3455 2977 643 6796 2145 4239 1685 490 1003 9131 1569 1286 565 2283 1086 6352 5512 1619 427 1902 379 4367 1714 1852 2466 5714 859 2342 1227 26 1974 2782 1069 ...

result:

ok all is ok (10 test cases)

Test #175:

score: 12
Accepted
time: 28ms
memory: 17492kb

input:

10
5001 10000
1123 1333 6629 6671
1333 1811 5413 5460
333 1811 5451 5515
333 2565 5032 5085
2279 2565 3801 3863
2279 4653 977 994
640 4653 5026 5080
640 1288 4126 4160
591 1288 4953 5002
591 957 5006 5062
957 1312 780 838
1312 2131 1942 2000
81 2131 5049 5050
81 3018 5031 5032
1626 3018 1089 1115
16...

output:

YES
6643 5436 5451 5038 3845 977 5037 4137 4971 5035 817 1971 5049 5031 1089 1774 4998 5040 3848 5024 1880 4234 4970 4990 440 2109 4888 4975 2439 193 5043 1770 4938 4352 4905 2284 5023 5041 3507 3332 5007 3812 5018 1449 3509 4908 956 4878 5021 944 4960 4991 5015 4073 4984 1103 5039 3394 4393 4916 50...

result:

ok all is ok (10 test cases)

Test #176:

score: 12
Accepted
time: 22ms
memory: 17756kb

input:

10
5001 10000
1137 3803 2524 2562
1137 4489 625 642
1137 3047 7584 7647
363 1137 7061 7089
1137 2262 566 607
1137 2048 3948 4007
1137 4373 346 394
1137 3593 494 559
1137 3344 1867 1875
1137 1391 8753 8783
1137 4029 8764 8793
1137 4928 3433 3437
1137 3908 3511 3544
1137 2982 8901 8910
1137 1542 1666 ...

output:

YES
2539 625 7588 7068 587 3991 375 531 1867 8765 8773 3433 3519 8901 1674 3630 5695 6433 526 153 1723 4203 5137 9033 2656 3985 2172 6230 2368 2375 447 3847 4772 7012 1716 320 1853 6244 9501 9895 3073 680 7765 5172 581 792 8806 732 8335 5608 1509 1425 6588 1441 6852 344 1066 3268 131 4380 3380 689 3...

result:

ok all is ok (10 test cases)

Test #177:

score: 12
Accepted
time: 33ms
memory: 36000kb

input:

1
50001 100000
6532 42821 87082 87167
23004 42821 97570 97692
25974 42821 47176 47258
22149 42821 46323 46370
40874 42821 9477 9496
21217 42821 41216 41296
2982 42821 33147 33202
18755 42821 40659 40736
41895 42821 97213 97250
39581 42821 12042 12060
12834 42821 52211 52249
36365 42821 79998 80124
1...

output:

YES
87126 97666 47229 46341 9477 41258 33164 40694 97225 12042 52219 80089 45163 88070 48283 81692 25046 4267 3612 59446 47046 83454 96442 30678 75639 39864 63973 2063 88840 30387 93436 20243 28815 22661 17496 46178 64646 1673 61108 34263 6087 24057 65738 45329 55137 91207 486 58594 18341 49498 2946...

result:

ok all is ok (1 test case)

Test #178:

score: 12
Accepted
time: 26ms
memory: 19328kb

input:

10
5001 10000
1 2 1313 1410
1 3 833 953
2 4 720 725
2 5 379 408
3 6 974 1036
3 7 2336 2428
4 8 539 556
4 9 2316 2402
5 10 2114 2165
5 11 156 229
6 12 2137 2249
6 13 2367 2418
7 14 1190 1285
7 15 580 760
8 16 372 539
8 17 1333 1457
9 18 1625 1639
9 19 469 569
10 20 1457 1486
10 21 1154 1267
11 22 172...

output:

YES
1349 899 720 379 983 2379 539 2356 2115 183 2196 2368 1217 710 480 1404 1625 518 1458 1204 1743 1492 1972 324 2349 1650 970 2510 1122 1453 2050 1251 735 565 888 2447 277 1153 580 465 138 1123 1765 1870 2374 1424 2038 604 2423 493 2209 217 2082 111 1312 41 1022 1390 475 246 2376 1100 241 524 2456...

result:

ok all is ok (10 test cases)

Test #179:

score: 12
Accepted
time: 39ms
memory: 32452kb

input:

1
50001 100000
1 2 21834 21992
1 3 12339 12673
2 4 20915 20940
2 5 22415 22852
3 6 5796 6126
3 7 12872 13225
4 8 16991 17023
4 9 6590 6766
5 10 15687 15917
5 11 827 1178
6 12 15538 15601
6 13 9802 9956
7 14 18012 18182
7 15 5956 6319
8 16 17542 17833
8 17 15489 15569
9 18 8556 8868
9 19 16239 16290
...

output:

YES
21863 12545 20915 22717 5997 13086 16991 6610 15785 1039 15538 9821 18046 6187 17706 15489 8725 16239 22883 10758 23630 9750 812 14093 13469 6059 24180 7038 16290 9610 20707 945 10714 5322 4613 1803 10651 24282 19621 5678 14617 13494 20365 13323 22839 23052 16167 18087 2445 21225 5565 1070 5752 ...

result:

ok all is ok (1 test case)

Test #180:

score: 12
Accepted
time: 33ms
memory: 36112kb

input:

1
50001 100000
1 2 9264 9602
1 3 15416 15852
2 4 9974 10488
2 5 5611 5882
3 6 11754 11991
3 7 8951 9847
4 8 21058 21074
4 9 7099 7967
5 10 13357 13591
5 11 21905 22564
6 12 17232 18072
6 13 6383 7127
7 14 23701 24573
7 15 13641 14216
8 16 14835 15045
8 17 1 638
9 18 19313 20281
9 19 14612 14664
10 2...

output:

YES
9327 15567 10222 5611 11754 9553 21058 7670 13357 22288 17791 6852 24279 13928 14835 372 19992 14612 21352 14435 21978 1282 19516 22121 19628 3711 18902 14070 5211 2876 6164 9008 16641 17497 23217 22394 9690 4514 800 17602 5302 3631 2083 569 6593 3668 9160 18865 4026 21779 19213 12189 13526 2468...

result:

ok all is ok (1 test case)

Test #181:

score: 12
Accepted
time: 40ms
memory: 36280kb

input:

1
50001 100000
1 2 12371 12438
1 3 22828 23457
2 4 13967 14312
2 5 22772 23178
3 6 21108 22772
3 7 1071 2293
4 8 7387 9253
4 9 10238 11929
5 10 7091 8287
5 11 5654 7165
6 12 14299 15449
6 13 1 552
7 14 21553 23027
7 15 1224 1721
8 16 3084 3877
8 17 11060 12839
9 18 4498 5617
9 19 7131 8338
10 20 172...

output:

YES
12371 22914 13967 22772 22243 1746 8682 11370 7751 6626 14897 179 22498 1224 3355 12278 5049 7808 17690 4596 5395 2363 14969 7344 10100 14065 12601 10873 7852 14464 2031 9130 8747 5716 7364 901 17075 8834 2373 46 9193 22146 17556 3538 8667 3576 13365 19724 22028 18506 4606 22980 18836 6105 13356...

result:

ok all is ok (1 test case)

Test #182:

score: 12
Accepted
time: 42ms
memory: 34272kb

input:

1
50001 100000
1 2 3855 4728
1 3 1290 2791
2 4 22037 22765
2 5 24058 24833
3 6 9966 10752
3 7 22855 23897
4 8 1875 4926
4 9 13428 15604
5 10 22412 22867
5 11 12459 13971
6 12 5551 5994
6 13 6337 9354
7 14 17520 19456
7 15 20129 21004
8 16 10941 11198
8 17 11516 12652
9 18 2362 4354
9 19 10431 12479
...

output:

YES
3855 1887 22037 24058 9967 23005 3999 14681 22412 13052 5551 8491 18553 20129 10941 11721 3379 11527 9248 18688 8203 22749 2294 3353 18885 5069 638 8248 24016 9096 760 23665 3708 16139 17573 7472 19997 9952 12116 14844 7252 4968 15202 10338 14462 16347 2199 205 17389 2264 18114 1768 20178 1692 2...

result:

ok all is ok (1 test case)

Test #183:

score: 12
Accepted
time: 35ms
memory: 35492kb

input:

1
40001 100000
1 2 11341 11614
1 3 5003 5097
2 4 17600 17763
2 5 15435 15644
3 6 7011 7218
3 7 10125 10370
4 8 488 900
4 9 7667 7928
5 10 15503 15663
5 11 19690 19869
6 12 18913 19020
6 13 14045 14110
7 14 11486 11670
7 15 1 156
8 16 12083 12400
8 17 1279 1466
9 18 5326 5487
9 19 8466 8750
10 20 604...

output:

YES
11477 5003 17639 15523 7084 10240 763 7788 15543 19741 18913 14045 11526 55 12273 1331 5370 8603 6087 5601 8573 12624 4182 19859 10773 12745 3150 15847 17274 18098 18458 17801 2404 12015 16342 9885 16781 11032 19336 8894 11201 10273 1774 18941 610 8213 6425 13235 12092 4499 5783 8906 13017 16979...

result:

ok all is ok (1 test case)

Test #184:

score: 12
Accepted
time: 29ms
memory: 36948kb

input:

1
60001 100000
1 2 18129 18219
1 3 4777 5450
2 4 5514 5803
2 5 3830 4912
3 6 4658 5667
3 7 10669 11014
4 8 11665 11941
4 9 20530 20561
5 10 21565 21792
5 11 7125 7734
6 12 7807 8316
6 13 22103 22787
7 14 23189 23235
7 15 14677 15427
8 16 5817 6280
8 17 12320 12531
9 18 3872 4166
9 19 27888 28848
10 ...

output:

YES
18129 5128 5514 4586 5327 10700 11665 20530 21565 7383 7975 22442 23189 15111 5969 12320 3875 28502 10861 13357 21587 19134 22930 2104 13305 13147 13899 8225 25363 10903 27270 25277 18545 13936 473 27559 15830 16604 5571 19693 9311 6846 29039 10509 24278 11919 27791 28433 21071 4340 11695 295 99...

result:

ok all is ok (1 test case)

Test #185:

score: 12
Accepted
time: 33ms
memory: 28764kb

input:

1
30001 100000
1 2 13322 13858
1 3 12248 14360
2 4 14647 14916
2 5 14348 14756
3 6 90 182
3 7 9057 9511
4 8 4018 5793
4 9 11711 13159
5 10 13693 13995
5 11 1 429
6 12 3739 5175
6 13 7161 8232
7 14 12667 13602
7 15 4982 5256
8 16 4850 5110
8 17 1360 2270
9 18 13092 14596
9 19 12069 12095
10 20 5358 6...

output:

YES
13322 13774 14647 14348 90 9057 5212 12549 13693 106 4547 7590 13007 4982 4850 1636 14010 12069 5627 8395 10334 327 2612 13350 9055 8801 6660 3113 135 2205 8667 11341 11221 6528 11329 9234 7220 9379 8532 6155 11694 14425 1154 9778 9612 1418 5410 2137 178 14299 12277 4145 13617 6418 6681 12618 59...

result:

ok all is ok (1 test case)

Test #186:

score: 12
Accepted
time: 35ms
memory: 37700kb

input:

1
70001 100000
1 2 1462 2845
1 3 8645 11001
2 4 1615 2204
2 5 34662 37230
3 6 15893 17475
3 7 2652 2924
4 8 26744 29064
4 9 14263 16033
5 10 30058 30477
5 11 35144 37753
6 12 29592 30276
6 13 22841 22981
7 14 37875 38374
7 15 30115 32655
8 16 30109 31218
8 17 6686 7864
9 18 859 1749
9 19 4642 6848
1...

output:

YES
2025 10159 1615 36380 16639 2652 28218 15137 30058 36925 29593 22841 37875 31813 30399 7018 968 6015 2348 7099 26710 16794 37425 31700 38333 29752 5614 33585 10880 4067 31156 38360 793 21206 17975 28214 25551 5291 20029 19111 17209 12055 38559 11842 175 13684 14195 28176 26495 8024 29055 20636 1...

result:

ok all is ok (1 test case)

Test #187:

score: 12
Accepted
time: 29ms
memory: 28032kb

input:

1
20001 100000
1 2 89 2064
1 3 6057 7849
2 4 1585 1987
2 5 7802 9428
3 6 6200 6567
3 7 5309 5389
4 8 8906 10899
4 9 6019 6853
5 10 1895 2457
5 11 2799 4537
6 12 8611 9411
6 13 6282 6922
7 14 9333 9797
7 15 5372 6546
8 16 6855 7282
8 17 5287 7145
9 18 2355 3663
9 19 6839 8550
10 20 614 1264
10 21 212...

output:

YES
1463 7246 1585 8817 6200 5309 9422 6249 1896 3947 8800 6307 9333 5936 6855 6553 3074 7943 709 671 1106 6208 8575 3424 4583 4327 5992 331 1083 9621 5859 3577 4928 8516 8547 9700 5995 1961 7878 3704 3347 7285 5433 8937 4974 1156 6718 9429 1594 3657 3878 7451 6891 840 5863 3450 8687 7799 8485 8567 ...

result:

ok all is ok (1 test case)

Test #188:

score: 12
Accepted
time: 37ms
memory: 44612kb

input:

1
80001 100000
1 2 14160 14805
1 3 53840 54987
2 4 37246 38345
2 5 22557 22950
3 6 14384 15236
3 7 30788 32296
4 8 51824 52685
4 9 57855 59044
5 10 22320 23860
5 11 33991 35273
6 12 16961 16998
6 13 29063 30146
7 14 10206 11588
7 15 26391 27990
8 16 56790 57090
8 17 23242 23751
9 18 37017 38357
9 19...

output:

YES
14320 54490 37824 22557 14755 31795 52222 58582 23370 34776 16961 29676 11079 27509 56791 23261 37838 46776 19664 45118 16499 5697 14996 37571 32128 34790 57023 52653 3372 19434 39044 40829 27083 27020 19007 51215 21167 52448 13313 13875 20817 12228 34959 40703 38951 15503 21405 50127 2014 9309 ...

result:

ok all is ok (1 test case)

Test #189:

score: 12
Accepted
time: 21ms
memory: 17096kb

input:

10
5001 10000
394 1320 650 712
394 4210 1912 1920
1320 1943 1874 1916
1320 1490 861 871
4210 4616 825 895
3390 4210 193 250
168 1943 1113 1149
383 1943 1148 1203
1490 3411 1943 1994
688 1490 168 225
3354 4616 946 1010
4616 4711 1693 1732
3390 4779 1122 1194
217 3390 1673 1714
168 3665 1979 2032
168 ...

output:

YES
682 1912 1889 861 875 221 1125 1179 1972 200 983 1716 1174 1693 1979 882 1121 1096 643 1374 1486 526 1744 1562 1513 705 125 1033 1207 1775 1172 717 1957 886 1409 112 332 1597 610 637 1155 1228 1420 1231 1745 234 1826 240 118 1977 1665 1309 763 1595 1237 1059 1920 1929 749 1137 1905 515 1962 424 ...

result:

ok all is ok (10 test cases)

Test #190:

score: 12
Accepted
time: 44ms
memory: 32180kb

input:

1
50001 100000
6233 25520 18204 18217
6233 49266 12138 12181
13083 25520 11483 11616
25520 33174 2798 2965
19713 49266 10906 11264
1869 49266 18374 18464
13083 42197 24 262
13083 16518 9468 9529
13639 33174 19130 19442
2789 33174 14157 14523
19713 46525 16565 16912
19713 43508 3511 3812
1869 43646 9...

output:

YES
18204 12138 11493 2845 11147 18374 132 9468 19332 14409 16785 3676 9898 6331 9214 1522 4831 14043 17649 19111 1561 2019 8197 14819 10951 19210 14312 15362 8784 7564 6405 450 8607 2314 7118 15560 8089 4771 18226 9928 8718 17733 325 7115 16040 3128 10918 4337 5805 18536 14543 5480 2728 18099 2010 ...

result:

ok all is ok (1 test case)

Test #191:

score: 12
Accepted
time: 44ms
memory: 36148kb

input:

1
50001 100000
26591 42129 5262 5982
26591 44197 12614 12620
18702 42129 14984 15356
36080 42129 11566 12320
7119 44197 13334 14095
44197 47361 5811 6246
18702 38434 18102 18252
17293 18702 18410 18765
28456 36080 11225 11663
208 36080 4692 5059
7119 25606 18805 19050
7119 10158 10644 10651
1512 473...

output:

YES
5740 12614 15125 12085 13874 6007 18103 18552 11426 4834 18823 10644 1504 595 17275 19099 61 15365 19102 10050 10402 17741 428 9319 159 12666 7720 15999 15439 19150 12145 6730 18243 9556 18937 16187 15701 605 7442 2562 9175 8568 4647 13881 12692 15020 18971 7005 7072 1324 10898 12166 13091 16535...

result:

ok all is ok (1 test case)

Test #192:

score: 12
Accepted
time: 45ms
memory: 34668kb

input:

1
50001 100000
4423 8129 14538 14808
4423 33050 3879 4032
8129 25864 15677 15882
8129 23915 12576 12732
33050 48068 16490 16672
16706 33050 12400 14372
25864 43627 18 1004
25864 35324 13007 14325
23915 29615 7241 8096
23915 42132 5466 5847
42211 48068 1447 3483
45752 48068 15553 16122
16706 32777 43...

output:

YES
14540 3879 15677 12576 16490 13737 481 13696 7509 5468 2848 15553 4599 12305 15348 6525 4677 1210 18009 5659 9853 4952 14405 5648 14144 5138 4758 12320 2523 2348 11124 3462 4912 6276 14707 13961 5144 3050 12502 2658 6173 3753 12602 7354 18531 11604 9629 10401 18679 8709 8381 9235 14185 17469 144...

result:

ok all is ok (1 test case)

Test #193:

score: 12
Accepted
time: 46ms
memory: 36184kb

input:

1
50001 100000
24052 24374 9391 10637
3367 24052 9287 11714
24374 32888 3789 6613
20143 24374 3925 4878
3367 20189 3500 5342
3367 16623 10166 13100
32888 45573 11090 13821
29211 32888 15081 16230
20143 41761 11882 12544
20143 32607 14126 16948
20189 48427 15900 16621
20189 49016 16857 18631
15150 16...

output:

YES
9784 10819 5722 3995 4445 12263 12939 15349 11882 16071 15900 17751 8390 13414 15146 16117 10378 4012 17969 18515 18167 1219 7817 16175 6653 18114 18865 5515 1281 17584 16489 13672 10459 9888 16009 6713 16677 7980 5446 8295 3885 12073 7425 11528 13377 2062 9998 16305 13945 15870 9423 5661 5849 1...

result:

ok all is ok (1 test case)

Test #194:

score: 12
Accepted
time: 48ms
memory: 29300kb

input:

1
40001 100000
21522 36630 2624 2860
680 21522 8586 8609
12007 36630 10857 11144
19624 36630 10489 10527
680 11146 9543 9957
680 12160 5123 5579
12007 14108 4951 5371
12007 17904 6436 6835
19624 23081 6207 6217
9521 19624 10024 10288
11146 26147 3776 4241
11146 13215 12014 12090
12160 14184 7539 783...

output:

YES
2711 8586 10998 10489 9827 5439 5232 6685 6207 10144 4105 12014 7691 3150 3755 5211 11771 13103 6137 9587 7973 9563 4755 2004 14042 1425 3158 6803 15045 11838 9252 1618 12850 7386 2580 8099 8277 10255 15147 3783 9237 8781 8896 1604 12167 11041 3110 7800 5881 13097 2877 9231 12915 7902 3385 8947 ...

result:

ok all is ok (1 test case)

Test #195:

score: 12
Accepted
time: 50ms
memory: 37012kb

input:

1
60001 100000
13621 55082 18327 19040
55082 55976 8983 9070
13621 48011 16180 16911
9316 13621 10252 10679
55787 55976 13656 14027
22652 55976 3731 4057
34470 48011 13666 13949
1891 48011 5380 5474
9316 10452 20325 21206
8353 9316 20243 20498
7195 55787 48 887
37575 55787 19895 20087
20829 22652 77...

output:

YES
18780 8983 16625 10429 13786 3795 13716 5380 20957 20243 630 19895 1019 14720 16299 10611 4945 11802 3722 5990 444 13321 17096 4591 10141 22932 3277 14842 10140 2999 14977 21844 11740 12025 5000 17891 19097 13197 10233 6390 21456 20499 20105 10225 20347 22135 5042 9612 916 19356 8545 22805 6660 ...

result:

ok all is ok (1 test case)

Test #196:

score: 12
Accepted
time: 39ms
memory: 28956kb

input:

1
30001 100000
5622 6855 4093 4890
2039 5622 7389 8716
779 6855 9514 9880
6855 8475 4843 5935
755 2039 8303 9635
2039 23135 1 755
779 3025 6529 7162
779 1157 946 1920
8475 17591 6442 7934
1282 8475 8820 9896
755 9199 8226 8777
755 16725 7019 7849
23135 25035 10690 11301
1876 23135 1664 1958
2010 302...

output:

YES
4308 8133 9514 5369 9058 311 6600 1384 7352 9301 8226 7271 10745 1664 2515 6715 7325 5344 3535 3419 5861 7042 7474 4509 1893 4881 2651 10770 2050 3862 1389 1264 9651 6304 11444 9880 5150 8155 4095 9797 10823 10709 1901 7367 366 11360 2161 2270 11367 9926 4432 150 11294 1672 9104 1200 1831 972 11...

result:

ok all is ok (1 test case)

Test #197:

score: 12
Accepted
time: 53ms
memory: 43848kb

input:

1
70001 100000
28657 43613 11933 12561
18247 43613 22364 23242
28657 42050 27069 28615
23166 28657 17127 17257
18247 49062 23504 25352
18247 66232 873 1537
11153 42050 29024 31081
4310 42050 24894 26612
23166 49362 20411 20753
23166 66854 27447 29853
13770 49062 14545 15346
49062 52163 14413 16264
3...

output:

YES
11936 22423 27784 17127 24554 874 30215 25776 20411 28989 14550 15449 19998 4366 22389 30112 38684 39698 10597 8982 9890 15413 9385 1870 6205 39341 19276 39037 1735 30233 11504 26032 38330 34152 37997 10480 24194 24144 26103 7322 14216 2867 5791 512 17538 20089 20835 6404 311 15347 2998 34409 26...

result:

ok all is ok (1 test case)

Test #198:

score: 12
Accepted
time: 36ms
memory: 21868kb

input:

1
20001 100000
12044 12595 891 2302
12044 13912 1 1295
4038 12595 682 3231
12595 13496 1782 2517
11434 13912 2157 3003
13912 17172 1093 2947
4038 7083 6312 6999
4038 7098 6435 6882
11154 13496 5594 8015
13496 15251 2237 2508
11434 18167 299 1357
10308 11434 1797 4032
11897 17172 4840 7496
17172 1778...

output:

YES
1469 635 2431 1782 2218 2143 6312 6435 7152 2237 675 3219 6740 7360 3501 15 4233 1836 614 6587 2061 2595 2869 1199 5922 1950 2257 2444 4692 2075 6379 4218 7087 2699 5218 4680 2039 4575 2474 6574 7153 896 3615 2432 4301 1002 7652 5894 5877 3816 2235 7450 6716 2440 5882 2519 4306 5282 3644 6529 71...

result:

ok all is ok (1 test case)

Test #199:

score: 12
Accepted
time: 49ms
memory: 44532kb

input:

1
80001 100000
1116 47281 10447 10801
40680 47281 55235 56651
1116 66275 43973 45334
1116 22849 534 2111
40680 41275 26695 27340
25631 40680 16804 17493
3793 66275 56712 57889
6157 66275 4386 6059
161 22849 59332 59692
22849 31991 57103 57411
41275 76946 25911 27289
29515 41275 21299 22619
18265 256...

output:

YES
10447 56138 44860 1617 26826 16983 57400 5570 59332 57104 26772 22136 3899 37737 29547 7149 1622 45997 19304 13492 43255 25470 20248 46115 11354 17548 17123 16290 58113 35367 5725 55233 57290 42350 16734 13430 28368 40374 58610 40815 25367 13979 28721 48933 28474 58240 5170 46013 1793 20499 1384...

result:

ok all is ok (1 test case)

Test #200:

score: 12
Accepted
time: 56ms
memory: 38840kb

input:

1
50001 100000
17407 20818 63036 63124
17407 38380 62863 63150
38380 41309 59982 60289
41309 47750 60058 60244
45092 47750 60033 60192
5930 45092 60034 60132
5930 24678 52979 52999
4711 24678 52985 52989
4711 16518 52892 53089
16518 41721 52666 52849
41721 47284 52826 52831
24304 47284 52765 52830
2...

output:

YES
63036 63024 60097 60098 60087 60034 52979 52985 52892 52734 52826 52765 52815 51596 51592 51603 51549 51620 51332 51279 51253 51322 50892 50909 50793 50862 50797 50886 50811 50957 50863 50860 50812 50870 50903 50843 50809 50880 50855 50908 50796 50861 50854 50921 50858 50868 50802 51026 50823 51...

result:

ok all is ok (1 test case)

Test #201:

score: 12
Accepted
time: 55ms
memory: 48468kb

input:

1
80001 100000
3129 20045 99891 100000
6922 20045 84926 84949
6922 37116 84911 84959
2567 37116 84832 85157
2567 71999 84855 85004
18600 71999 84649 84973
18600 46595 84726 85040
46595 56761 84835 84921
3489 56761 84706 85030
3489 33850 84905 84977
31592 33850 84805 85046
6991 31592 84908 85143
6991...

output:

YES
99976 84926 84911 84922 84901 84872 84915 84835 84913 84905 84921 84925 84906 84837 84860 84923 84916 84876 84928 84868 84919 84828 84862 84890 84927 84021 84076 84079 84164 84137 84136 84169 84122 84078 84192 84123 84091 84125 84159 84133 84110 84121 84134 84113 84111 84099 84179 84127 84068 84...

result:

ok all is ok (1 test case)

Test #202:

score: 12
Accepted
time: 56ms
memory: 41364kb

input:

1
60001 100000
7370 17964 99563 100000
7370 48904 68195 68776
48904 53932 67733 68388
47129 53932 68038 68543
4051 47129 61900 62216
3060 4051 61903 61991
3060 31436 61897 61952
31436 36273 61785 62119
23600 36273 61883 62361
23600 52961 61933 62165
52961 54546 61645 62165
7662 54546 61932 61940
766...

output:

YES
99854 68195 68126 68128 62013 61903 61897 61927 62151 61980 61978 61932 61391 61384 61504 61505 61466 61512 61510 61595 61475 61552 61544 61494 61548 61600 61536 61411 61438 61503 61509 61516 61502 61452 61515 61514 61455 61500 61501 61555 61511 61566 61473 61584 26709 33663 24180 47648 48787 53...

result:

ok all is ok (1 test case)

Test #203:

score: 12
Accepted
time: 60ms
memory: 36696kb

input:

1
40001 100000
1766 19522 74795 75123
1766 10541 57440 57899
10541 25970 57863 57904
18859 25970 50247 50822
16880 18859 49975 50491
11489 16880 50179 50542
11489 33240 50187 50597
4721 33240 50091 50468
4721 7963 50316 50489
3324 7963 50381 50856
3324 16267 50443 50471
16267 25843 40416 40910
2355 ...

output:

YES
74935 57694 57863 50351 50284 50334 50347 50266 50316 50381 50443 40702 40693 40707 40703 40701 40786 40719 40662 40755 40710 40637 40705 40686 40758 40713 40706 10876 3390 37071 30538 37335 28372 28681 18480 38031 29416 35012 4681 35168 4361 20664 26453 5953 14387 20586 12590 11897 30532 13332 ...

result:

ok all is ok (1 test case)

Test #204:

score: 12
Accepted
time: 50ms
memory: 26768kb

input:

1
20001 100000
3768 8812 25453 25784
3885 8812 24061 24098
3885 15095 20912 21158
864 15095 21076 21142
864 4281 20885 21155
4281 15717 21051 21188
15717 17492 21054 21193
7519 17492 21001 21262
7519 10360 20981 21145
8055 10360 21033 21120
5168 8055 21112 21124
5168 18315 21104 21115
17509 18315 20...

output:

YES
25671 24061 21062 21076 21058 21085 21090 21127 21052 21033 21112 21104 20157 20191 20159 18078 9063 11760 2892 17460 19120 158 7281 11724 13050 9455 17324 8694 140 6355 18384 14849 11857 12861 4967 19982 12362 19990 19930 6590 19415 10894 7664 20002 4000 2921 795 17227 16734 10858 12692 6537 71...

result:

ok all is ok (1 test case)

Test #205:

score: 12
Accepted
time: 51ms
memory: 37868kb

input:

1
50001 100000
6309 47026 75096 75729
6309 29826 54874 55859
4817 29826 55394 55507
4817 16944 55350 57296
11627 16944 55199 58151
4877 11627 55071 57464
4877 4968 54487 56418
4968 34978 51215 53129
28762 34978 51001 51382
22342 28762 50235 53933
22342 45129 49556 51588
18786 45129 51152 51379
18786...

output:

YES
75096 54875 55394 55968 56856 56165 55083 51892 51001 50393 50387 51152 50391 50386 50389 51106 51139 50388 50857 50396 50397 51133 50246 50718 50611 50596 50249 50231 50522 50258 50708 50121 49874 50260 50238 50241 50072 50118 50251 49829 50077 49946 49806 50248 49987 50268 50202 49796 50244 50...

result:

ok all is ok (1 test case)

Test #206:

score: 12
Accepted
time: 53ms
memory: 30532kb

input:

1
30001 100000
12454 26772 35303 36523
5482 12454 33002 33373
5482 28795 32930 34074
27496 28795 31536 33898
24403 27496 33082 34262
3758 24403 29844 33314
3758 16304 30952 34440
5676 16304 32867 35002
5676 25720 31081 34925
25720 26727 30880 33009
8980 26727 28961 33023
8980 12367 29505 31820
3514 ...

output:

YES
35303 33002 32930 32649 33084 32096 33199 33693 31082 30880 30777 30778 30730 29932 29926 29893 29883 29905 29933 29887 29859 29873 29930 29919 29920 29888 29921 29884 29896 29931 30008 29914 29918 29890 29909 29911 29895 29815 29903 29924 29929 29902 29898 29936 29912 29904 29906 29899 29881 29...

result:

ok all is ok (1 test case)

Test #207:

score: 12
Accepted
time: 66ms
memory: 39048kb

input:

1
50001 100000
530 26006 96839 100000
530 9209 60457 77025
2179 9209 60603 68571
2179 25388 40979 59312
25388 49254 55583 67581
3153 49254 47077 62094
2172 3153 47869 63307
2172 19774 57443 61254
19774 27590 45345 63754
15432 27590 44498 60449
15432 28972 47407 58206
28972 29348 52315 54217
9984 293...

output:

YES
99407 60711 60712 54578 55744 55739 55740 57443 55734 55444 53732 52316 51879 53261 51889 52734 51881 52872 51890 52588 51883 51878 51888 51891 50102 49930 51886 51880 51885 51887 51884 49936 49806 51105 50984 51107 51109 51106 50958 49918 51108 49723 50235 50070 49980 50572 50570 49920 50365 50...

result:

ok all is ok (1 test case)

Test #208:

score: 12
Accepted
time: 59ms
memory: 45436kb

input:

1
70001 100000
9050 38975 70553 90741
38975 42193 79781 87712
42193 46447 73023 91476
46447 62990 78710 98007
4718 62990 78076 97220
4718 14007 69708 82225
14007 65368 81137 82662
54994 65368 81760 98392
54994 67009 79116 83458
30845 67009 73374 92259
5205 30845 78917 92078
5205 62409 74398 83700
24...

output:

YES
81312 81317 81313 81315 81314 76593 81137 81760 79116 78650 78917 74480 74148 74476 74474 74478 74479 78418 73637 70215 70593 69933 69999 70530 70600 70598 70597 70607 70602 71126 70226 70609 70606 70631 56108 70595 70604 70608 70448 70596 70601 69623 69490 70594 70591 69762 19373 70599 70605 70...

result:

ok all is ok (1 test case)

Test #209:

score: 12
Accepted
time: 65ms
memory: 35820kb

input:

1
50001 100000
33856 44692 98453 100000
600 33856 57978 61175
600 25266 49265 57382
25266 32192 52502 54313
32192 40467 54022 54155
27472 40467 41186 54864
14521 27472 46440 50343
5669 14521 45105 61177
5669 19253 49910 63573
19253 35436 42695 60672
35436 41138 49226 52133
18909 41138 50173 52257
12...

output:

YES
99834 57978 51893 52502 54022 51446 49637 50015 50020 50011 50017 50173 49715 49702 50008 50010 50007 50012 50019 50009 49762 50014 50150 50016 50018 39597 38070 26575 4771 49879 49886 49873 49824 28124 49776 4404 11625 49858 47553 42054 26412 40750 49773 41784 49816 11474 49734 49822 49800 1197...

result:

ok all is ok (1 test case)

Test #210:

score: 12
Accepted
time: 57ms
memory: 30576kb

input:

1
30001 100000
13268 25102 1 34320
6540 25102 15070 40854
6540 7497 28039 40789
7497 10924 23079 34324
10924 28765 29323 33832
15593 28765 28452 31204
15593 18191 27362 35963
16212 18191 22917 56578
1776 16212 27593 40710
1776 14656 12644 33603
14656 21752 27678 67347
16831 21752 29760 36215
16831 2...

output:

YES
30607 30970 30971 30609 30461 29981 30949 30948 30950 30399 30951 30953 30944 30945 30946 30078 30600 30599 30596 30597 30096 30598 30594 30595 30131 30132 2372 9152 30120 2242 10484 7486 4897 30128 9096 30124 30130 30125 30121 5838 30126 30133 28353 30122 8305 4819 8035 29304 29290 28381 30127 ...

result:

ok all is ok (1 test case)

Test #211:

score: 12
Accepted
time: 56ms
memory: 37456kb

input:

1
50001 100000
43952 44205 1 99203
30689 44205 1 58934
23005 30689 47538 79889
23005 34020 1 100000
33629 34020 1 100000
1349 33629 1 100000
1349 48787 1 100000
24045 48787 1 100000
24045 45458 1 100000
42498 45458 1 100000
33422 42498 32104 51000
5739 33422 28661 100000
5739 26596 1 100000
1427 265...

output:

YES
55673 50049 52305 52923 52924 49578 49579 49580 49581 49582 38055 49817 49583 49798 49818 49584 49585 49558 49586 49801 49587 49588 49589 49816 49614 49615 49616 49617 49808 49815 49810 49618 49619 49620 49621 49622 49623 49624 49795 49625 49822 49820 49307 49626 49627 49628 49629 49630 49631 49...

result:

ok all is ok (1 test case)

Subtask #10:

score: 12
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

Test #212:

score: 12
Accepted
time: 229ms
memory: 88912kb

input:

1
250001 500000
80839 234929 1 285720
142821 234929 277833 500000
234929 237500 132076 292810
1885 142821 421969 500000
142821 228674 268656 500000
220849 237500 1 287575
66680 228674 25960 75456
81867 142821 335146 468710
16127 220849 415170 500000
20184 234929 65475 304782
45571 220849 1 280065
41...

output:

NO

result:

ok all is ok (1 test case)

Test #213:

score: 12
Accepted
time: 260ms
memory: 114840kb

input:

1
350001 500000
81961 185208 37557 46762
179730 185208 121649 155365
81961 150482 323213 339399
1842 185208 263099 267020
113863 150482 107638 114542
25172 81961 30093 57227
179730 242782 239125 299210
179730 283455 111722 164330
60102 283455 411682 421314
113164 283455 466563 500000
283455 347453 2...

output:

NO

result:

ok all is ok (1 test case)

Test #214:

score: 12
Accepted
time: 282ms
memory: 111732kb

input:

1
250001 500000
71675 167514 240929 241905
167514 173525 44442 45824
131227 167514 499682 500000
153207 167514 28045 28136
32393 167514 4618 4665
167514 236243 456741 456814
39119 167514 34335 35868
107093 167514 50499 52028
159533 167514 416317 416850
124558 167514 479897 479907
167514 205573 45194...

output:

YES
241369 45314 499926 28045 4618 456741 35352 51521 416347 479897 451948 161168 481295 495678 204667 122972 499132 495708 331630 255034 427069 31085 278023 117785 331259 137585 267758 129206 278555 137089 424104 60564 124495 297209 499732 271178 33285 457544 425772 165703 300946 428106 132538 2159...

result:

ok all is ok (1 test case)

Test #215:

score: 12
Accepted
time: 284ms
memory: 112724kb

input:

1
250001 500000
1 2 83227 84661
1 3 47191 50194
2 4 12338 12479
2 5 86313 87848
3 6 56559 57813
3 7 11237 15131
4 8 20106 20283
4 9 84545 86945
5 10 20624 20745
5 11 23369 25233
6 12 115533 118797
6 13 26797 29134
7 14 22080 25692
7 15 26817 26832
8 16 45622 48932
8 17 71493 75218
9 18 20231 24135
9...

output:

YES
83461 48974 12338 86662 56643 13909 20106 85729 20624 24042 117564 27953 24563 26817 47740 74032 22982 26902 56362 37736 35576 95933 101937 79860 1391 73749 63085 85067 114563 13138 2360 47250 27742 12857 17097 465 92337 68696 56920 36288 91377 118990 53557 118085 20925 46783 85232 68432 50358 2...

result:

ok all is ok (1 test case)

Test #216:

score: 12
Accepted
time: 279ms
memory: 111716kb

input:

1
250001 500000
1 2 18673 25168
1 3 31405 39873
2 4 44968 52434
2 5 52511 62541
3 6 29233 35016
3 7 67270 71984
4 8 30956 34987
4 9 85337 88373
5 10 14747 22461
5 11 96497 98478
6 12 20970 24270
6 13 38514 42477
7 14 52195 54427
7 15 102457 107525
8 16 47162 51792
8 17 66619 70699
9 18 21911 28698
9...

output:

YES
22179 36867 49407 59491 32086 68981 32060 85337 19531 96498 21308 39472 52195 104463 48818 67682 25663 64908 63989 106587 48787 51931 12987 75861 78100 7492 15330 80060 44868 62714 99119 20201 100164 37279 68329 49512 68498 119489 76990 44673 46859 117296 88625 20786 67974 30827 73624 9187 63562...

result:

ok all is ok (1 test case)

Test #217:

score: 12
Accepted
time: 299ms
memory: 112612kb

input:

1
250001 500000
1 2 20148 22388
1 3 79062 81936
2 4 89424 96874
2 5 5898 12377
3 6 86223 94313
3 7 104066 108554
4 8 26450 27136
4 9 47196 65882
5 10 88240 92173
5 11 112342 113342
6 12 69853 79357
6 13 60030 78918
7 14 57365 65013
7 15 103926 106032
8 16 41221 47800
8 17 55752 60358
9 18 32481 3742...

output:

YES
20148 79062 91118 6873 88492 104066 26450 60168 88240 112342 73625 73198 59269 103926 42020 55752 32481 70059 49061 54207 41041 93550 36171 99504 115297 6821 118532 71378 57333 81267 70024 33613 91696 100567 26708 63780 57391 57511 76871 87537 30248 87210 59853 25743 113976 93273 44457 118555 75...

result:

ok all is ok (1 test case)

Test #218:

score: 12
Accepted
time: 291ms
memory: 110592kb

input:

1
250001 500000
1 2 15375 35256
1 3 7337 25438
2 4 93515 98693
2 5 2098 17459
3 6 37606 54404
3 7 2662 4692
4 8 96193 98739
4 9 24395 30970
5 10 89477 111526
5 11 72771 88635
6 12 22241 34603
6 13 19781 38305
7 14 33180 50114
7 15 74042 98675
8 16 70205 98759
8 17 105382 112095
9 18 108728 111180
9 ...

output:

YES
26696 16800 93516 9218 45914 2663 96193 24396 102963 80104 26058 29766 41641 90138 90233 105383 108728 9275 34274 79676 110217 100336 71921 62143 25191 62743 2838 32719 24962 22418 10972 63144 53609 19652 48306 65899 62286 17490 36783 93580 40914 21614 62823 60046 54265 55549 106330 15621 48407 ...

result:

ok all is ok (1 test case)

Test #219:

score: 12
Accepted
time: 263ms
memory: 96328kb

input:

1
200001 500000
1 2 95682 96842
1 3 16958 18340
2 4 24084 24206
2 5 48608 52560
3 6 52091 55170
3 7 72892 73204
4 8 84608 85198
4 9 1 937
5 10 41506 42521
5 11 40358 43074
6 12 86832 90407
6 13 67551 71562
7 14 89779 93778
7 15 54948 55472
8 16 67601 68175
8 17 84727 88089
9 18 74815 78034
9 19 7931...

output:

YES
95682 17062 24084 51282 53956 72892 84608 242 41506 41799 89169 70329 92529 54948 67601 86821 76741 79877 47960 84206 64849 29561 16155 10459 60252 82902 79979 930 31567 24472 31169 13737 42521 37520 31241 73863 31476 13198 12020 83266 42221 3065 32931 68359 31148 32460 2082 29272 40404 80131 76...

result:

ok all is ok (1 test case)

Test #220:

score: 12
Accepted
time: 275ms
memory: 124060kb

input:

1
300001 500000
1 2 24083 32751
1 3 78046 87264
2 4 57772 58560
2 5 5806 11707
3 6 39762 40475
3 7 56115 63554
4 8 115099 124534
4 9 28050 33782
5 10 61822 68270
5 11 65770 71138
6 12 103320 107811
6 13 92255 100637
7 14 116713 122575
7 15 102909 104621
8 16 57034 60230
8 17 119226 125895
9 18 10770...

output:

YES
29777 84256 57772 8657 39762 60584 121567 30795 65244 68114 104798 97636 119484 102910 57246 122900 13082 123725 93361 15371 80260 81888 129308 3927 49406 16651 62625 95002 81393 7373 112232 66926 48286 106542 6528 19316 46574 9177 6722 141302 94202 125539 100487 96659 108582 41556 60118 47033 2...

result:

ok all is ok (1 test case)

Test #221:

score: 12
Accepted
time: 245ms
memory: 84872kb

input:

1
150001 500000
1 2 54717 68969
1 3 70816 73428
2 4 39876 40795
2 5 69434 73976
3 6 13229 14557
3 7 16958 24471
4 8 20651 28300
4 9 1 13009
5 10 59571 70972
5 11 1 7486
6 12 32450 43199
6 13 60873 77878
7 14 1 10729
7 15 51657 60423
8 16 67510 72800
8 17 30628 47089
9 18 1 9265
9 19 1 3870
10 20 106...

output:

YES
63140 70816 39876 69434 13229 18683 22418 7455 65145 2943 37408 68793 5454 54687 67510 41276 4301 953 16713 21868 68632 22882 27059 41756 16074 48729 5745 71858 11090 44072 9970 34134 37940 16878 48105 13311 46235 49612 21724 16381 59946 41714 42567 68464 37398 69910 59695 4667 29746 20043 11482...

result:

ok all is ok (1 test case)

Test #222:

score: 12
Accepted
time: 304ms
memory: 143200kb

input:

1
350001 500000
1 2 194567 194869
1 3 124939 135045
2 4 56840 64470
2 5 1 17224
3 6 41668 61948
3 7 145515 157892
4 8 173476 177021
4 9 58012 80538
5 10 5890 19049
5 11 60872 77254
6 12 24864 46598
6 13 179896 187546
7 14 93849 118516
7 15 62516 81200
8 16 91067 98438
8 17 120896 146508
9 18 78805 9...

output:

YES
194567 126506 56840 9182 53324 149332 173476 71757 10842 68574 38088 179896 110019 72474 91067 137855 91128 4944 146580 33976 131513 126202 97039 61817 62535 130569 114250 187487 48573 50786 1610 97385 147764 104046 28457 106921 188088 174428 191058 7429 167113 59312 73381 152672 158170 86331 40...

result:

ok all is ok (1 test case)

Test #223:

score: 12
Accepted
time: 239ms
memory: 64476kb

input:

1
100001 500000
1 2 8228 19028
1 3 33644 51614
2 4 2763 22542
2 5 40468 54786
3 6 1 14278
3 7 26464 50403
4 8 593 9533
4 9 21401 43022
5 10 34337 42079
5 11 20987 30398
6 12 35980 45382
6 13 33199 36644
7 14 1 3696
7 15 1 6736
8 16 1 20190
8 17 28522 46981
9 18 27835 27895
9 19 23164 29098
10 20 107...

output:

YES
11837 42563 15209 42565 7601 42601 3869 35663 34754 23197 38098 33199 771 2237 12947 39723 27835 23164 26965 4690 34889 27670 39273 34129 21170 24182 34097 12844 29573 12881 27610 23552 27666 33670 17501 1410 25613 15030 9440 43584 35944 34744 42780 42564 31795 16901 29831 43204 14460 23397 2764...

result:

ok all is ok (1 test case)

Test #224:

score: 12
Accepted
time: 301ms
memory: 157828kb

input:

1
400001 500000
1 2 280794 288513
1 3 133637 145077
2 4 235379 238937
2 5 6494 11881
3 6 245810 256197
3 7 117167 121210
4 8 196538 205527
4 9 91312 95071
5 10 184653 192294
5 11 222484 229061
6 12 171669 172637
6 13 251158 258665
7 14 75451 78372
7 15 252339 258771
8 16 11350 21301
8 17 195560 1960...

output:

YES
285077 141617 235514 8426 252778 117829 202045 91764 188863 225682 171669 255237 75451 255336 17924 195560 132988 109021 195491 196319 178061 128520 58652 160681 176963 259965 276343 57572 14331 76959 264550 245264 80989 146041 148535 155762 221197 294992 113537 128648 79155 191980 57507 113685 ...

result:

ok all is ok (1 test case)

Test #225:

score: 12
Accepted
time: 332ms
memory: 110364kb

input:

1
250001 500000
145852 146401 20688 24081
145852 226745 69534 72529
146401 163860 50038 51264
76685 146401 40572 44260
90933 226745 56734 59710
156043 226745 4284 6547
22854 163860 26751 29561
66204 163860 61680 63746
76685 205585 32218 34941
1193 76685 31436 34242
90933 222243 20824 24700
90933 186...

output:

YES
22846 71286 50040 43027 58439 5305 28359 62536 33711 33024 23472 395 27923 27648 68246 15441 63016 454 12005 48420 65432 62507 54324 20337 64033 66214 95628 86053 14094 60069 20696 61906 62980 61500 665 42707 52053 70121 37237 71340 22836 78491 51001 15241 86218 24315 70779 14678 53447 54244 495...

result:

ok all is ok (1 test case)

Test #226:

score: 12
Accepted
time: 339ms
memory: 111860kb

input:

1
250001 500000
2425 169242 27480 28165
15285 169242 1 7982
2425 21295 36392 39266
2425 237076 44414 51036
15285 212565 32163 40283
15285 249252 76842 86652
21295 40288 46523 46878
5221 21295 50284 52823
89665 237076 3726 13342
120440 237076 18348 20924
212565 243394 56656 64846
97865 212565 5153 11...

output:

YES
27480 4767 36392 47700 36927 83426 46523 50284 10057 18348 61584 8549 27221 47310 38884 2005 93116 46656 21191 6077 18968 86001 48883 90491 81531 78093 8968 59024 16003 87464 23689 54042 37613 27832 3356 92632 67337 42973 24540 42540 69560 1245 11411 72929 17733 88629 80836 32952 88675 46892 277...

result:

ok all is ok (1 test case)

Test #227:

score: 12
Accepted
time: 335ms
memory: 110572kb

input:

1
250001 500000
16848 49128 80149 92543
16848 64159 41776 51365
49128 95720 52264 60212
49128 105029 81705 92713
64159 142064 6358 14887
64159 158414 31854 39000
17189 95720 84302 84561
26707 95720 81857 83640
16543 105029 63404 76798
105029 169299 7067 22025
99084 142064 1598 15355
142064 163383 17...

output:

YES
86909 45661 54585 87085 9264 33269 84302 81857 71169 16430 9722 20707 91586 19993 52173 88815 20347 91525 1254 40765 78671 7976 82912 5408 20791 48657 2092 64510 36640 74838 59624 92955 60106 3015 27857 25338 41191 67995 37071 7894 54308 34109 89515 8629 65 58893 6904 10983 78082 2670 74903 7634...

result:

ok all is ok (1 test case)

Test #228:

score: 12
Accepted
time: 377ms
memory: 112728kb

input:

1
250001 500000
151179 239378 1 1850
97538 239378 29121 38083
24015 151179 41247 62650
40143 151179 69440 88673
16039 97538 84515 111786
97538 182507 70785 78721
7142 24015 66820 95511
24015 175041 82393 84544
38460 40143 35931 59263
40143 59713 27417 33842
16039 230639 11088 37135
16039 68753 15401...

output:

YES
182 29121 53438 79503 88811 70785 86453 82393 50055 27417 27879 30561 90889 47535 12928 22184 79764 19893 45495 22970 46430 18472 12817 52305 30260 61522 14788 88658 70097 6262 6623 61016 89084 62037 54837 5727 24648 59449 73827 4623 36933 88493 35182 26214 10781 1237 4660 49318 75633 17311 8885...

result:

ok all is ok (1 test case)

Test #229:

score: 12
Accepted
time: 307ms
memory: 96240kb

input:

1
200001 500000
15807 124854 48576 49471
124854 175674 2616 4193
15807 60125 57415 59335
15807 53449 40021 41972
92384 175674 20694 25008
175674 186932 53105 54970
60125 74951 5863 6549
60125 103689 8120 10325
53449 182612 44474 47192
53449 75600 14386 17247
18523 92384 35436 38255
65061 92384 39992...

output:

YES
48576 2884 58036 40666 23733 53655 5864 9026 45890 15959 36956 41427 31390 50608 35590 27589 70053 33802 885 48302 43226 447 12 15965 14935 7099 27037 824 48531 26316 42241 34290 74359 72913 35598 39644 26378 24481 34967 5036 47756 43254 25140 8771 37120 59330 16171 10504 8276 49734 10568 19479 ...

result:

ok all is ok (1 test case)

Test #230:

score: 12
Accepted
time: 357ms
memory: 123320kb

input:

1
300001 500000
13896 286289 7168 12462
255924 286289 26932 31355
13896 29998 91263 98369
13896 169976 48973 50543
246221 255924 42829 45810
153608 255924 21579 28434
29998 138813 94525 98514
29998 73085 78506 88621
169976 207563 94125 99453
108150 169976 7723 15760
246221 258990 59341 65786
177703 ...

output:

YES
9272 28132 95127 48973 42830 25174 95272 85401 96150 12518 62648 42628 89289 12332 87575 85329 7401 113391 93845 22355 111024 89860 6278 53784 21177 43906 81882 47295 9776 4735 35449 80701 3728 80602 91365 26361 66867 55227 31092 113944 32316 43001 42667 114246 54135 14147 62255 23803 9767 91385...

result:

ok all is ok (1 test case)

Test #231:

score: 12
Accepted
time: 298ms
memory: 86936kb

input:

1
150001 500000
94726 130670 28378 40655
94726 111679 49336 55571
63127 130670 53544 60963
20446 130670 44500 49120
80229 111679 19991 39847
46478 111679 40491 41510
63127 77534 21868 24368
3710 63127 1514 2922
20446 22837 49900 60803
20446 101901 35848 49634
80229 129678 27925 33312
8324 80229 5526...

output:

YES
34459 49336 53544 44500 33620 40491 21868 1514 52229 43287 27926 55260 22633 53313 38358 21159 36427 1695 22774 27385 40719 32919 10608 13894 47902 47205 14342 13292 1530 18311 52332 52751 11099 45473 12945 49528 26984 3016 21327 41871 18447 19590 1109 41379 39433 53136 10316 11862 39200 14589 4...

result:

ok all is ok (1 test case)

Test #232:

score: 12
Accepted
time: 387ms
memory: 142632kb

input:

1
350001 500000
169760 347066 190532 210292
141915 347066 158694 184150
169760 217981 161521 178666
108957 169760 1 14939
141915 245098 87822 98739
39117 141915 3287 33281
58445 217981 70794 78941
217981 242997 70113 77467
108957 205020 64950 95468
108957 190092 146988 154983
132560 245098 141887 14...

output:

YES
191338 174991 169404 6959 89684 24027 70795 70113 86354 146988 141888 55020 7731 15219 176528 112683 191421 189070 124240 92826 145843 160723 185284 55724 184615 86067 8212 115323 46167 170638 116738 64797 9826 61768 73955 88428 25058 1353 31866 41933 10979 43521 56847 19549 113416 77779 12113 1...

result:

ok all is ok (1 test case)

Test #233:

score: 12
Accepted
time: 268ms
memory: 71296kb

input:

1
100001 500000
61017 87564 15099 28066
14656 87564 1 8831
20339 61017 6756 20244
55101 61017 36593 36807
14656 15971 37913 39390
14656 37144 21193 26358
20339 33114 24833 31046
20339 35094 2197 12788
55101 66365 29755 32473
6328 55101 28942 43914
15971 42944 2538 15257
15971 69480 5449 9871
34859 3...

output:

YES
23586 4593 15828 36593 37913 21810 26548 8304 29756 34448 10785 5533 31930 34343 27773 35610 17460 10725 28961 16543 15997 10665 36006 11584 34445 33438 33482 10116 1369 18703 26598 14422 8842 31080 9977 6177 33557 23026 32058 9185 8673 32108 34449 18912 24042 8131 24602 22776 30046 34351 31081 ...

result:

ok all is ok (1 test case)

Test #234:

score: 12
Accepted
time: 386ms
memory: 152680kb

input:

1
400001 500000
317460 347841 261558 274089
317460 372641 32332 39278
315720 347841 259384 275143
347841 385254 171072 186171
195256 372641 148725 149316
324652 372641 118911 130644
265698 315720 100607 103471
289976 315720 77283 82442
41505 385254 264911 271489
309170 385254 56361 66585
195256 2574...

output:

YES
268643 33928 269678 180672 148725 125180 100607 77283 266024 61240 7580 170229 281258 275274 252478 66663 176712 137775 31370 257773 46196 213075 253468 227708 6682 105239 4163 275186 20899 175879 157514 47727 83925 16861 60281 87024 170757 264563 35348 137747 15529 18674 263736 227653 125775 26...

result:

ok all is ok (1 test case)

Test #235:

score: 12
Accepted
time: 477ms
memory: 170884kb

input:

1
400001 500000
29802 168470 498699 500000
29802 171594 444740 446358
171594 290080 441888 447036
205229 290080 439131 445601
205229 284994 434179 451053
284994 386572 442940 450929
199246 386572 436620 444793
41905 199246 444089 447455
41905 382891 438975 452176
266054 382891 396391 401527
266054 3...

output:

YES
499863 444740 442128 440653 446055 445931 439829 444089 447082 399828 399822 399876 399875 399844 399787 399849 399823 399866 399826 399861 399877 399798 399808 399677 399843 399829 399857 399860 399850 399841 400028 399702 399862 399859 399812 399816 399799 399881 399797 399856 399793 399784 39...

result:

ok all is ok (1 test case)

Test #236:

score: 12
Accepted
time: 355ms
memory: 74448kb

input:

1
100001 500000
46540 78803 265535 290612
53748 78803 94464 119262
53748 90049 112874 123311
67343 90049 109830 134927
16781 67343 101368 122415
16781 51116 99490 109379
48919 51116 106184 116314
11181 48919 102157 111190
11181 19749 109067 109108
19749 20474 97731 114729
20474 30748 106457 111631
2...

output:

YES
282488 111441 112874 109830 107226 103470 107233 104692 109067 107222 106457 107227 105982 107234 106848 107268 107249 108957 106285 106499 107232 107221 105531 103259 107140 108043 104787 105451 107236 107228 106481 107231 107225 107443 105421 105939 106205 105145 101016 100191 100193 101023 10...

result:

ok all is ok (1 test case)

Test #237:

score: 12
Accepted
time: 431ms
memory: 129376kb

input:

1
250001 500000
94703 116316 147614 500000
43772 94703 1 500000
43772 110584 1 393532
110584 187401 1 333414
187401 208772 66517 409752
173880 208772 1 426511
173880 185644 1 500000
27481 185644 1 500000
27096 27481 1 500000
27096 161556 1 273838
161556 197583 1 500000
50054 197583 1 500000
50054 14...

output:

YES
264885 264871 255526 252059 256671 257939 264872 264873 264874 248596 264875 264876 252105 264877 264878 264879 264880 264881 264882 264883 253416 256115 259114 259115 259116 259119 259117 259118 253730 253731 253732 253733 252106 252127 250664 252126 252107 252108 252109 252110 252111 252125 25...

result:

ok all is ok (1 test case)

Test #238:

score: 12
Accepted
time: 240ms
memory: 118372kb

input:

1
262143 500000
1 2 86632 86924
1 3 63062 63167
2 4 41624 41881
2 5 86269 86397
3 6 9489 9686
3 7 60024 60363
4 8 77861 78128
4 9 25264 25380
5 10 30404 30549
5 11 103525 103609
6 12 64514 64777
6 13 25860 26095
7 14 51162 51387
7 15 91406 91642
8 16 6574 6717
8 17 24005 24230
9 18 59557 59807
9 19 ...

output:

YES
86825 63065 41781 86308 9591 60258 78032 25303 30444 103525 64683 25993 51293 91535 6611 24143 59714 80332 28615 101596 48958 102739 97335 49239 101912 49343 15995 49416 86918 39478 12010 91821 30844 64089 84191 13561 53898 26371 3873 61642 27687 36736 31297 53332 37 1127 51403 12501 88247 22435...

result:

ok all is ok (1 test case)