QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#794592#9799. Magical Paletteucup-team025#AC ✓370ms54016kbC++2010.0kb2024-11-30 15:03:162024-11-30 15:03:20

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3
2 2

output:

Yes
1 4
1 5 3
No

result:

ok 2 cases (2 test cases)

Test #2:

score: 0
Accepted
time: 370ms
memory: 54016kb

input:

1
1 1000000

output:

Yes
1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok 1 cases (1 test case)

Test #3:

score: 0
Accepted
time: 367ms
memory: 54004kb

input:

1
1000000 1

output:

Yes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok 1 cases (1 test case)

Test #4:

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

input:

1
2 500000

output:

No

result:

ok 1 cases (1 test case)

Test #5:

score: 0
Accepted
time: 291ms
memory: 51964kb

input:

1
2 499999

output:

Yes
1 500000
1 500001 3 500003 5 500005 7 500007 9 500009 11 500011 13 500013 15 500015 17 500017 19 500019 21 500021 23 500023 25 500025 27 500027 29 500029 31 500031 33 500033 35 500035 37 500037 39 500039 41 500041 43 500043 45 500045 47 500047 49 500049 51 500051 53 500053 55 500055 57 500057 59...

result:

ok 1 cases (1 test case)

Test #6:

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

input:

1
500000 2

output:

No

result:

ok 1 cases (1 test case)

Test #7:

score: 0
Accepted
time: 366ms
memory: 51932kb

input:

1
499999 2

output:

Yes
1 500001 3 500003 5 500005 7 500007 9 500009 11 500011 13 500013 15 500015 17 500017 19 500019 21 500021 23 500023 25 500025 27 500027 29 500029 31 500031 33 500033 35 500035 37 500037 39 500039 41 500041 43 500043 45 500045 47 500047 49 500049 51 500051 53 500053 55 500055 57 500057 59 500059 6...

result:

ok 1 cases (1 test case)

Test #8:

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

input:

1
3 333333

output:

No

result:

ok 1 cases (1 test case)

Test #9:

score: 0
Accepted
time: 235ms
memory: 51428kb

input:

1
3 333332

output:

Yes
1 666665 333333
1 333334 666667 4 333337 666670 7 333340 666673 10 333343 666676 13 333346 666679 16 333349 666682 19 333352 666685 22 333355 666688 25 333358 666691 28 333361 666694 31 333364 666697 34 333367 666700 37 333370 666703 40 333373 666706 43 333376 666709 46 333379 666712 49 333382 6...

result:

ok 1 cases (1 test case)

Test #10:

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

input:

1
333333 3

output:

No

result:

ok 1 cases (1 test case)

Test #11:

score: 0
Accepted
time: 298ms
memory: 51432kb

input:

1
333332 3

output:

Yes
1 333334 666667 4 333337 666670 7 333340 666673 10 333343 666676 13 333346 666679 16 333349 666682 19 333352 666685 22 333355 666688 25 333358 666691 28 333361 666694 31 333364 666697 34 333367 666700 37 333370 666703 40 333373 666706 43 333376 666709 46 333379 666712 49 333382 666715 52 333385 ...

result:

ok 1 cases (1 test case)

Test #12:

score: 0
Accepted
time: 225ms
memory: 50892kb

input:

1
4 249999

output:

Yes
1 749998 499999 250000
1 250001 500001 750001 5 250005 500005 750005 9 250009 500009 750009 13 250013 500013 750013 17 250017 500017 750017 21 250021 500021 750021 25 250025 500025 750025 29 250029 500029 750029 33 250033 500033 750033 37 250037 500037 750037 41 250041 500041 750041 45 250045 50...

result:

ok 1 cases (1 test case)

Test #13:

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

input:

1
249998 4

output:

No

result:

ok 1 cases (1 test case)

Test #14:

score: 0
Accepted
time: 218ms
memory: 50752kb

input:

1
14925 67

output:

Yes
1 313427 626853 940279 253730 567156 880582 194033 507459 820885 134336 447762 761188 74639 388065 701491 14942 328368 641794 955220 268671 582097 895523 208974 522400 835826 149277 462703 776129 89580 403006 716432 29883 343309 656735 970161 283612 597038 910464 223915 537341 850767 164218 4776...

result:

ok 1 cases (1 test case)

Test #15:

score: 0
Accepted
time: 224ms
memory: 50428kb

input:

1
1526 655

output:

Yes
1 143446 286891 430336 573781 717226 860671 4586 148031 291476 434921 578366 721811 865256 9171 152616 296061 439506 582951 726396 869841 13756 157201 300646 444091 587536 730981 874426 18341 161786 305231 448676 592121 735566 879011 22926 166371 309816 453261 596706 740151 883596 27511 170956 3...

result:

ok 1 cases (1 test case)

Test #16:

score: 0
Accepted
time: 227ms
memory: 49868kb

input:

1
24046 41

output:

Yes
1 48094 96187 144280 192373 240466 288559 336652 384745 432838 480931 529024 577117 625210 673303 721396 769489 817582 865675 913768 961861 24068 72161 120254 168347 216440 264533 312626 360719 408812 456905 504998 553091 601184 649277 697370 745463 793556 841649 889742 937835 42 48135 96228 144...

result:

ok 1 cases (1 test case)

Test #17:

score: 0
Accepted
time: 222ms
memory: 50348kb

input:

1
12537 79

output:

Yes
1 702074 413724 125374 827447 539097 250747 952820 664470 376120 87770 789843 501493 213143 915216 626866 338516 50166 752239 463889 175539 877612 589262 300912 12562 714635 426285 137935 840008 551658 263308 965381 677031 388681 100331 802404 514054 225704 927777 639427 351077 62727 764800 4764...

result:

ok 1 cases (1 test case)

Test #18:

score: 0
Accepted
time: 213ms
memory: 50504kb

input:

1
6367 157

output:

Yes
1 528463 57306 585768 114611 643073 171916 700378 229221 757683 286526 814988 343831 872293 401136 929598 458441 986903 515746 44589 573051 101894 630356 159199 687661 216504 744966 273809 802271 331114 859576 388419 916881 445724 974186 503029 31872 560334 89177 617639 146482 674944 203787 7322...

result:

ok 1 cases (1 test case)

Test #19:

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

input:

1
1080 925

output:

No

result:

ok 1 cases (1 test case)

Test #20:

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

input:

1
36756 27

output:

No

result:

ok 1 cases (1 test case)

Test #21:

score: 0
Accepted
time: 305ms
memory: 50236kb

input:

1
23110 43

output:

Yes
1 207992 415983 623974 831965 46226 254217 462208 670199 878190 92451 300442 508433 716424 924415 138676 346667 554658 762649 970640 184901 392892 600883 808874 23135 231126 439117 647108 855099 69360 277351 485342 693333 901324 115585 323576 531567 739558 947549 161810 369801 577792 785783 44 2...

result:

ok 1 cases (1 test case)

Test #22:

score: 0
Accepted
time: 224ms
memory: 49296kb

input:

1
39072 25

output:

Yes
1 664226 351651 39076 703301 390726 78151 742376 429801 117226 781451 468876 156301 820526 507951 195376 859601 547026 234451 898676 586101 273526 937751 625176 312601 26 664251 351676 39101 703326 390751 78176 742401 429826 117251 781476 468901 156326 820551 507976 195401 859626 547051 234476 8...

result:

ok 1 cases (1 test case)

Test #23:

score: 0
Accepted
time: 228ms
memory: 48980kb

input:

1
38721 25

output:

Yes
1 735701 503376 271051 38726 774426 542101 309776 77451 813151 580826 348501 116176 851876 619551 387226 154901 890601 658276 425951 193626 929326 697001 464676 232351 26 735726 503401 271076 38751 774451 542126 309801 77476 813176 580851 348526 116201 851901 619576 387251 154926 890626 658301 4...

result:

ok 1 cases (1 test case)

Test #24:

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

input:

10000
6 8
54 1
4 19
77 1
1 66
16 4
6 4
49 1
10 1
16 5
2 14
1 84
2 22
8 6
85 1
4 13
94 1
5 7
5 3
9 6
6 2
8 12
8 3
5 17
1 60
11 7
5 8
2 48
7 5
10 5
13 6
1 60
1 69
23 2
3 4
1 20
2 17
1 71
26 1
28 1
81 1
2 1
14 2
14 6
21 1
5 4
24 2
19 4
2 34
7 13
2 26
10 2
50 2
4 5
11 9
45 1
7 10
4 9
43 2
85 1
20 2
1 25...

output:

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

result:

ok 10000 cases (10000 test cases)

Test #25:

score: 0
Accepted
time: 48ms
memory: 3600kb

input:

5000
30 4
8 17
23 5
9 12
37 5
32 5
1 163
12 14
25 4
1 179
65 3
139 1
15 11
4 27
8 20
6 22
24 6
1 109
102 1
4 34
4 42
7 17
9 18
189 1
9 12
13 8
184 1
1 149
11 13
98 2
44 4
197 1
1 137
1 144
21 9
2 59
1 103
74 2
1 175
37 4
31 4
5 36
131 1
1 134
14 12
1 154
31 5
56 3
3 39
5 20
4 33
129 1
15 8
10 11
1 1...

output:

No
Yes
1 18 35 52 69 86 103 120
1 121 105 89 73 57 41 25 9 129 113 97 81 65 49 33 17
Yes
1 71 26 96 51 6 76 31 101 56 11 81 36 106 61 16 86 41 111 66 21 91 46
1 47 93 24 70
No
Yes
1 76 151 41 116 6 81 156 46 121 11 86 161 51 126 16 91 166 56 131 21 96 171 61 136 26 101 176 66 141 31 106 181 71 146 3...

result:

ok 5000 cases (5000 test cases)

Test #26:

score: 0
Accepted
time: 48ms
memory: 3688kb

input:

2000
9 52
26 18
7 64
21 10
6 81
6 52
87 5
5 70
55 6
279 1
404 1
58 5
263 1
29 14
296 1
10 45
200 2
204 2
5 84
20 19
2 137
3 160
54 6
78 6
44 5
206 2
17 17
12 26
46 6
299 1
6 76
6 77
214 2
1 468
2 161
497 1
29 13
18 25
80 3
4 114
93 3
458 1
31 8
34 6
1 307
111 3
412 1
72 4
246 1
2 209
20 19
496 1
220...

output:

Yes
1 209 417 157 365 105 313 53 261
1 262 55 316 109 370 163 424 217 10 271 64 325 118 379 172 433 226 19 280 73 334 127 388 181 442 235 28 289 82 343 136 397 190 451 244 37 298 91 352 145 406 199 460 253 46 307 100 361 154 415 208
No
Yes
1 65 129 193 257 321 385
1 386 323 260 197 134 71 8 393 330 ...

result:

ok 2000 cases (2000 test cases)

Test #27:

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

input:

1000
1 654
229 4
55 11
49 14
1 711
6 159
16 42
191 5
4 242
276 2
73 8
6 109
1 527
1 781
1 996
20 43
550 1
304 3
1 595
69 8
1 674
146 4
257 2
88 6
2 378
1 906
116 7
542 1
1 552
41 23
294 2
10 87
297 3
251 3
951 1
128 5
49 17
6 165
587 1
37 21
175 3
157 5
155 4
1 505
545 1
57 12
25 20
1 632
35 22
5 11...

output:

Yes
1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok 1000 cases (1000 test cases)

Test #28:

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

input:

500
68 15
6 225
186 10
696 2
100 15
89 19
14 125
14 111
2 527
4 305
52 32
1875 1
3 359
6 251
93 17
351 4
9 169
242 5
18 108
206 8
196 7
1 1783
4 429
1953 1
308 6
1 1960
39 46
267 4
26 76
475 3
739 2
215 6
361 4
243 6
4 369
136 12
540 3
6 242
10 122
732 2
4 331
2 761
8 240
29 45
5 317
21 91
1 1220
36...

output:

Yes
1 886 751 616 481 346 211 76 961 826 691 556 421 286 151 16 901 766 631 496 361 226 91 976 841 706 571 436 301 166 31 916 781 646 511 376 241 106 991 856 721 586 451 316 181 46 931 796 661 526 391 256 121 1006 871 736 601 466 331 196 61 946 811 676 541 406 271 136
1 137 273 409 545 681 817 953 6...

result:

ok 500 cases (500 test cases)

Test #29:

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

input:

200
600 4
8 546
4 696
73 36
605 8
33 98
11 250
170 13
4874 1
4929 1
82 26
1493 3
61 71
14 355
1 4259
70 69
3 1534
1 4067
4 1145
11 197
351 9
1 2801
36 56
6 737
5 493
3068 1
1 3422
9 385
20 112
182 23
507 9
59 55
24 203
21 143
754 5
67 73
161 26
2481 2
95 46
1038 3
1 3743
1248 2
2001 1
293 13
64 36
3...

output:

No
No
No
Yes
1 2557 2485 2413 2341 2269 2197 2125 2053 1981 1909 1837 1765 1693 1621 1549 1477 1405 1333 1261 1189 1117 1045 973 901 829 757 685 613 541 469 397 325 253 181 109 37 2593 2521 2449 2377 2305 2233 2161 2089 2017 1945 1873 1801 1729 1657 1585 1513 1441 1369 1297 1225 1153 1081 1009 937 8...

result:

ok 200 cases (200 test cases)

Test #30:

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

input:

100
90 71
67 118
2 4452
5 1081
2678 2
558 11
1 8976
26 195
120 54
184 40
4 1454
1236 8
2 3819
7894 1
164 48
340 21
243 33
3 3186
2 3118
35 246
2564 3
110 48
1 7316
11 711
1 9851
299 33
6692 1
1 7204
2919 2
302 23
990 9
80 64
39 222
1 9235
8 657
6617 1
781 10
3 2269
83 63
82 116
181 36
160 43
41 227
...

output:

Yes
1 5042 3693 2344 995 6036 4687 3338 1989 640 5681 4332 2983 1634 285 5326 3977 2628 1279 6320 4971 3622 2273 924 5965 4616 3267 1918 569 5610 4261 2912 1563 214 5255 3906 2557 1208 6249 4900 3551 2202 853 5894 4545 3196 1847 498 5539 4190 2841 1492 143 5184 3835 2486 1137 6178 4829 3480 2131 782...

result:

ok 100 cases (100 test cases)

Test #31:

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

input:

50
68 185
1 11708
1 15415
50 323
16127 1
1 13310
1 12735
29 463
2846 4
107 142
1021 18
13 850
11192 1
11737 1
21 855
143 76
6 2224
81 209
958 14
2181 6
2 6770
51 387
3713 4
442 38
1 19201
63 246
367 34
11 1452
12 1536
7416 2
12 1196
1 19544
2 6529
1584 7
1049 12
17496 1
150 93
4 3597
601 17
616 21
8...

output:

Yes
1 4626 9251 1296 5921 10546 2591 7216 11841 3886 8511 556 5181 9806 1851 6476 11101 3146 7771 12396 4441 9066 1111 5736 10361 2406 7031 11656 3701 8326 371 4996 9621 1666 6291 10916 2961 7586 12211 4256 8881 926 5551 10176 2221 6846 11471 3516 8141 186 4811 9436 1481 6106 10731 2776 7401 12026 4...

result:

ok 50 cases (50 test cases)

Test #32:

score: 0
Accepted
time: 66ms
memory: 5928kb

input:

20
1 26703
10447 2
3428 11
1 30557
25506 1
3 14045
23 1241
1 38121
47929 1
6 6525
10 3843
2 18497
349 80
9 3452
5265 6
6050 8
26677 1
497 60
742 36
45384 1

output:

Yes
1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok 20 cases (20 test cases)

Test #33:

score: 0
Accepted
time: 108ms
memory: 8268kb

input:

10
1318 38
86190 1
89 756
14065 6
505 188
8 12423
2114 30
123 637
1303 70
4099 18

output:

No
Yes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok 10 cases (10 test cases)

Test #34:

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

input:

5
4 26499
11 13627
12 15726
146988 1
71136 2

output:

Yes
1 79498 52999 26500
1 26501 53001 79501 5 26505 53005 79505 9 26509 53009 79509 13 26513 53013 79513 17 26517 53017 79517 21 26521 53021 79521 25 26525 53025 79525 29 26529 53029 79529 33 26533 53033 79533 37 26537 53037 79537 41 26541 53041 79541 45 26545 53045 79545 49 26549 53049 79549 53 265...

result:

ok 5 cases (5 test cases)

Test #35:

score: 0
Accepted
time: 15ms
memory: 3648kb

input:

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

output:

No
Yes
1 113 225 41 153 265 81 193 9 121 233 49 161 273 89 201 17 129 241 57 169 281 97 209 25 137 249 65 177 289 105 217 33 145 257 73 185
1 186 75 260 149 38 223 112
No
Yes
1 407 183 589 365 141 547 323 99 505 281 57 463 239 15 421 197 603 379 155 561 337 113 519 295 71 477 253 29 435 211 617 393 ...

result:

ok 400 cases (400 test cases)

Test #36:

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

input:

100
67 92
91 65
59 66
99 60
86 56
81 55
54 57
66 85
92 83
56 70
78 72
63 60
99 74
91 51
93 67
67 65
78 66
95 69
76 75
65 71
70 99
97 81
89 80
69 61
53 93
92 52
76 87
80 96
56 90
51 56
62 55
81 83
66 71
79 92
82 73
64 94
52 77
53 87
85 51
96 94
75 68
63 72
53 63
86 75
100 65
79 93
100 74
78 65
88 85
...

output:

Yes
1 5429 4693 3957 3221 2485 1749 1013 277 5705 4969 4233 3497 2761 2025 1289 553 5981 5245 4509 3773 3037 2301 1565 829 93 5521 4785 4049 3313 2577 1841 1105 369 5797 5061 4325 3589 2853 2117 1381 645 6073 5337 4601 3865 3129 2393 1657 921 185 5613 4877 4141 3405 2669 1933 1197 461 5889 5153 4417...

result:

ok 100 cases (100 test cases)

Test #37:

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

input:

25
137 170
169 165
151 194
101 111
122 162
166 170
182 123
127 148
164 103
148 127
103 199
148 155
105 130
150 115
181 118
172 188
108 130
177 195
156 196
159 170
101 116
171 143
192 127
181 157
101 167

output:

Yes
1 9181 18361 4251 13431 22611 8501 17681 3571 12751 21931 7821 17001 2891 12071 21251 7141 16321 2211 11391 20571 6461 15641 1531 10711 19891 5781 14961 851 10031 19211 5101 14281 171 9351 18531 4421 13601 22781 8671 17851 3741 12921 22101 7991 17171 3061 12241 21421 7311 16491 2381 11561 20741 ...

result:

ok 25 cases (25 test cases)

Test #38:

score: 0
Accepted
time: 61ms
memory: 11120kb

input:

4
418 473
417 226
341 382
413 375

output:

No
Yes
1 64637 35031 5425 70061 40455 10849 75485 45879 16273 80909 51303 21697 86333 56727 27121 91757 62151 32545 2939 67575 37969 8363 72999 43393 13787 78423 48817 19211 83847 54241 24635 89271 59665 30059 453 65089 35483 5877 70513 40907 11301 75937 46331 16725 81361 51755 22149 86785 57179 275...

result:

ok 4 cases (4 test cases)

Test #39:

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

input:

1
564 698

output:

No

result:

ok 1 cases (1 test case)

Extra Test:

score: 0
Extra Test Passed