QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#785830#9650. 链覆盖carrotqq100 ✓387ms342112kbC++142.5kb2024-11-26 19:23:292024-11-26 19:23:30

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 1ms
memory: 9904kb

input:

1 1033582741

output:

1 

result:

ok 1 number(s): "1"

Test #2:

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

input:

2 615397207

output:

0 1 
0 1 

result:

ok 4 number(s): "0 1 0 1"

Test #3:

score: 1
Accepted
time: 1ms
memory: 7888kb

input:

3 788354159

output:

0 1 2 
0 0 3 
0 0 3 

result:

ok 9 numbers

Test #4:

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

input:

4 527696509

output:

0 1 9 6 
0 0 1 15 
0 0 0 16 
0 0 0 16 

result:

ok 16 numbers

Test #5:

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

input:

5 1047477317

output:

0 1 40 60 24 
0 0 1 28 96 
0 0 0 1 124 
0 0 0 0 125 
0 0 0 0 125 

result:

ok 25 numbers

Subtask #2:

score: 9
Accepted

Dependency #1:

100%
Accepted

Test #6:

score: 9
Accepted
time: 0ms
memory: 14096kb

input:

6 397487711

output:

0 1 195 560 420 120 
0 0 1 75 500 720 
0 0 0 1 75 1220 
0 0 0 0 1 1295 
0 0 0 0 0 1296 
0 0 0 0 0 1296 

result:

ok 36 numbers

Test #7:

score: 9
Accepted
time: 0ms
memory: 12168kb

input:

7 889104253

output:

0 1 1056 5550 6240 3240 720 
0 0 1 186 2820 7680 6120 
0 0 0 1 186 2700 13920 
0 0 0 0 1 186 16620 
0 0 0 0 0 1 16806 
0 0 0 0 0 0 16807 
0 0 0 0 0 0 16807 

result:

ok 49 numbers

Test #8:

score: 9
Accepted
time: 2ms
memory: 16288kb

input:

8 549326861

output:

0 1 6321 59472 94710 68880 27720 5040 
0 0 1 441 14742 77280 111720 57960 
0 0 0 1 441 12642 73500 175560 
0 0 0 0 1 441 12642 249060 
0 0 0 0 0 1 441 261702 
0 0 0 0 0 0 1 262143 
0 0 0 0 0 0 0 262144 
0 0 0 0 0 0 0 262144 

result:

ok 64 numbers

Test #9:

score: 9
Accepted
time: 0ms
memory: 12260kb

input:

9 987498487

output:

0 1 41392 692440 1527456 1426320 792960 262080 40320 
0 0 1 1016 77616 714336 1765680 1619520 604800 
0 0 0 1 1016 54096 573216 1762320 2392320 
0 0 0 0 1 1016 54096 571536 4156320 
0 0 0 0 0 1 1016 54096 4727856 
0 0 0 0 0 0 1 1016 4781952 
0 0 0 0 0 0 0 1 4782968 
0 0 0 0 0 0 0 0 4782969 
0 0 0 0 ...

result:

ok 81 numbers

Test #10:

score: 9
Accepted
time: 2ms
memory: 14344kb

input:

10 328708241

output:

0 1 293607 8753040 26418168 30560544 21213360 9676800 2721600 362880 
0 0 1 2295 439560 6612480 25192944 36847440 24010560 6894720 
0 0 0 1 2295 217800 3961440 21201264 39780720 34836480 
0 0 0 0 1 2295 217800 3916080 21019824 74844000 
0 0 0 0 0 1 2295 217800 3916080 95863824 
0 0 0 0 0 0 1 2295 21...

result:

ok 100 numbers

Subtask #3:

score: 10
Accepted

Dependency #2:

100%
Accepted

Test #11:

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

input:

19 103139489

output:

0 1 11624080 30771297 67633923 38648926 26692097 85413520 76396263 51796363 72312834 18383776 18143658 76958501 63040686 90425144 3215980 40730768 33722922 
0 0 1 2359278 62792309 95551019 80901602 77700549 6042464 88096626 11663760 52681251 62163370 65211259 65287276 68174958 55501818 79883458 3503...

result:

ok 361 numbers

Test #12:

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

input:

15 937882403

output:

0 1 680510166 6779904 292684576 697222660 197217345 608741012 380919310 629991923 761253785 233893766 318988222 847170117 893110124 
0 0 1 114674 776372282 629033371 746821312 437855135 523605947 331874181 762184407 153288444 610819324 375836396 262795034 
0 0 0 1 114674 143592540 421537369 8820850 ...

result:

ok 225 numbers

Test #13:

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

input:

19 474843869

output:

0 1 290796597 19148010 160928809 294278627 383137229 94599672 270994874 382122007 96777052 112881226 301437206 23612615 301660682 123462535 59880830 71981470 162643803 
0 0 1 2359278 145051597 112920521 130345136 77396818 431615648 214934274 57685354 172970869 384868508 1906584 314616519 62416080 12...

result:

ok 361 numbers

Test #14:

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

input:

15 314773379

output:

0 1 275608511 132867935 178856515 48042720 223219485 8946244 169555445 301065994 138265861 98211492 85835693 297975281 300838596 
0 0 1 114674 56697248 104238297 3690076 61545483 125576263 43717518 226820297 539772 129357606 108932984 138966038 
0 0 0 1 114674 143592540 183341211 31948068 157609591 ...

result:

ok 225 numbers

Test #15:

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

input:

12 850098287

output:

0 1 18210093 64283506 405589613 460570147 604022274 382094796 13750278 42837026 379209600 39916800 
0 0 1 11253 20307650 677805480 4111638 35965361 296700839 274301921 813749478 287530513 
0 0 0 1 11253 3135110 153772740 459642866 293113596 705644952 474533686 320629930 
0 0 0 0 1 11253 3135110 1442...

result:

ok 144 numbers

Test #16:

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

input:

20 141298853

output:

0 1 68839881 27636438 89202322 89884444 54389933 18598801 101813771 44020181 98540284 17650821 84948605 99284560 109875380 102603741 73048564 83787674 140097519 125081765 
0 0 1 4980717 99726150 15662794 76473480 22545188 134673435 23448101 79661713 3257746 103213931 86097167 24444057 14404191 43714...

result:

ok 400 numbers

Test #17:

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

input:

19 443521321

output:

0 1 98119531 341747623 108166541 239428661 111284774 323600146 410999963 28515886 192836079 238702839 1528891 117431268 198660948 306492718 102458915 82265644 179706317 
0 0 1 2359278 385884554 443301094 145931375 441121179 38829956 163488943 226138027 50206029 293568156 48331596 120179478 64673609 ...

result:

ok 361 numbers

Test #18:

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

input:

18 931152161

output:

0 1 230694986 520898633 106938344 609847332 364032467 377311321 912977142 682357155 71254508 647595505 486584031 33748863 433489273 466119272 594465132 338724254 
0 0 1 1114095 398962055 854428326 790817123 851140177 607748347 24498673 105237846 352260119 95301968 917346183 54147977 510562573 289151...

result:

ok 324 numbers

Test #19:

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

input:

17 245755819

output:

0 1 93817793 75825682 23216490 203130830 151105808 62208767 60592625 25081550 191941686 236044684 214567479 140179185 245632696 55692699 122481616 
0 0 1 524272 8494826 172250967 15586675 115740856 219080536 5097465 168862711 103863540 142255946 166742737 81698900 111104515 98704006 
0 0 0 1 524272 ...

result:

ok 289 numbers

Test #20:

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

input:

16 855188447

output:

0 1 765021651 433218841 641531 672700608 800355957 92817977 141566065 209409791 325757349 177703536 290381219 768884277 804045026 91232537 
0 0 1 245745 242674969 373792681 335789628 91413642 144102829 91720832 549009449 691721580 156318450 651691192 357474203 177404271 
0 0 0 1 245745 498771210 708...

result:

ok 256 numbers

Subtask #4:

score: 15
Accepted

Dependency #3:

100%
Accepted

Test #21:

score: 15
Accepted
time: 4ms
memory: 29032kb

input:

23 339989921

output:

0 1 128382067 55951455 39285694 255634249 36798575 332202757 192710475 107649991 38554274 256720102 286766617 72690060 295780969 225525043 108057832 309725534 224735581 124067149 177859165 31865929 208865363 
0 0 1 46137322 299930039 271917099 233207861 37064537 113506644 229636054 137833203 1431228...

result:

ok 529 numbers

Test #22:

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

input:

25 187044157

output:

0 1 175788627 52847729 88094570 28022559 127671549 81171328 43554146 84182578 7913574 2175256 173730871 102957150 83686625 84360932 58576766 32609699 94723890 133661796 2361298 21075257 10894054 154573147 185601001 
0 0 1 14282411 89260533 62421771 12706464 165778032 169390164 37102036 158729122 575...

result:

ok 625 numbers

Test #23:

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

input:

22 529921549

output:

0 1 73557520 239128655 461093214 423338402 489284891 429855657 41734166 528373725 443423895 423620229 91183554 260894134 329094316 166366540 234147395 417778987 224941519 354117701 97925348 154486865 
0 0 1 22020075 453327545 53461840 152331027 103438695 287342176 75748048 127592088 236330711 287282...

result:

ok 484 numbers

Test #24:

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

input:

25 375250783

output:

0 1 245550206 77142191 278405034 206563479 181502532 174406539 169881508 229170966 114003440 374404071 129643237 130707276 223546610 85401976 197625875 162316326 56312504 324886119 307131789 79880923 110368787 346599071 357299561 
0 0 1 201326568 373982633 264650191 79743295 372417904 127006408 2686...

result:

ok 625 numbers

Test #25:

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

input:

23 368087911

output:

0 1 364723028 185373355 82684440 247310609 134339090 274974156 118515129 253496474 33849577 132625916 82893865 218243177 310032133 330191574 161341406 301325589 33690102 157006973 96430822 195869590 27510122 
0 0 1 46137322 343926231 314383778 141557241 194034802 90667455 126485135 267428474 1358203...

result:

ok 529 numbers

Test #26:

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

input:

32 343354057

output:

0 1 313495617 53844526 231252792 128998566 174328751 224091529 138959090 216876142 179748805 338486546 297772823 72545316 248868596 69102890 100071585 170273050 275182012 257366986 146860831 218480045 319773419 116609402 166320727 57356042 235421098 66046800 303003010 14424855 251041175 223833601 
0...

result:

ok 1024 numbers

Test #27:

score: 15
Accepted
time: 3ms
memory: 30144kb

input:

31 777989287

output:

0 1 617145319 344494266 537537508 310008206 764250168 336711723 665317518 369953200 129030278 233169491 181652171 13810773 329554939 601147436 424218139 108853969 690329568 408501197 618860772 155170315 204442617 505304158 399261905 756675512 390527796 350536613 479848645 734562063 558082567 
0 0 1 ...

result:

ok 961 numbers

Test #28:

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

input:

30 625674299

output:

0 1 322847385 226756195 361363773 108510873 567786811 274960123 619134027 75736993 428525083 456951590 458386113 252499045 13271219 139014691 458996015 267125372 230707375 86117057 76018249 470306583 265136062 119348618 441291625 232261364 594752556 242529223 520184148 144050647 
0 0 1 276536607 122...

result:

ok 900 numbers

Test #29:

score: 15
Accepted
time: 3ms
memory: 33720kb

input:

29 517323109

output:

0 1 305623856 192862397 493212741 367368961 206858562 209356669 15815177 49445793 441673297 448194356 430205303 479295975 57516658 52761019 296802503 370710488 26987091 201025200 132470980 109542125 235290200 423765649 290157514 486040782 88877017 47914397 197024358 
0 0 1 136834593 208385649 392784...

result:

ok 841 numbers

Test #30:

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

input:

28 675877603

output:

0 1 121320378 412110920 579253090 450655308 664410311 380786364 344701457 480369197 56796317 215465464 265684382 277588613 207384898 263899563 466002600 19222025 350173665 289242160 472459704 669477494 556580035 224156581 501539770 515050946 48234862 531991644 
0 0 1 460184095 419114005 541309907 30...

result:

ok 784 numbers

Subtask #5:

score: 5
Accepted

Dependency #4:

100%
Accepted

Test #31:

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

input:

33 912833539

output:

0 1 336460201 89787143 519926149 759055713 500719750 1448710 273368302 628977164 581172641 638214383 171597605 299479112 36926728 319135039 590267839 677022578 307381724 879003355 547766898 54505021 381980145 422595468 349866597 651448522 808427003 56276086 442641467 609728829 481685693 721724448 59...

result:

ok 1089 numbers

Test #32:

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

input:

33 259085597

output:

0 1 143228704 258150541 107680286 232381072 228071640 41273452 15631681 158428409 140142968 185274466 69057621 6211233 159530152 250865398 150762271 127255042 78023509 253094186 71087579 239208168 242642044 245907870 130426575 206502465 188331033 258147311 151613974 149589244 46946206 189346639 2319...

result:

ok 1089 numbers

Test #33:

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

input:

33 636806579

output:

0 1 420623428 351979150 181156096 20032527 117453020 14952612 76182710 567364025 543497350 131271011 16266422 474221015 522233408 224513654 185093439 19913230 499472493 255051968 399865255 352365892 429608756 591545529 277387214 125467722 605807825 401425477 120563109 68991110 205887245 387798750 22...

result:

ok 1089 numbers

Test #34:

score: 5
Accepted
time: 4ms
memory: 40552kb

input:

38 681163097

output:

0 1 84925172 379141920 601750654 142669949 9650091 174158039 528208716 491545957 174629930 36223492 64890544 73999276 31065402 434924569 579149492 103598617 582257219 265751745 518385128 111020149 169442048 651293355 243588959 507301037 149649318 407946765 430707467 630368708 266973681 77423912 2354...

result:

ok 1444 numbers

Test #35:

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

input:

40 395652529

output:

0 1 178542032 26268261 122568406 179601645 370406080 394713538 308121251 360204816 149878088 348064758 66263441 86346635 252265057 214138192 120505320 155744633 133862261 99389834 337358128 157264669 270215321 306998049 126272966 226621425 351511331 74632139 19735774 342120806 253283066 179104731 13...

result:

ok 1600 numbers

Test #36:

score: 5
Accepted
time: 2ms
memory: 42880kb

input:

40 686144401

output:

0 1 45581726 334161046 420152003 446634050 349973443 444451740 588685978 664064510 306999554 559639335 17150128 185557947 132878431 580958973 219612265 420741444 531685593 185398126 401846333 445302420 188189874 394833394 353699207 629528259 538619415 405503105 569051450 433673783 321857107 40901759...

result:

ok 1600 numbers

Test #37:

score: 5
Accepted
time: 3ms
memory: 42952kb

input:

39 433419137

output:

0 1 41369656 410924975 178899348 50083397 388720872 109340546 91158768 128791227 212918635 78463711 345115727 162463588 72701424 279012694 78298400 103992983 414199621 131108922 236177190 52367797 89535431 58725654 282989927 394204545 269739872 10230785 59603847 192699485 357208642 359824079 4389063...

result:

ok 1521 numbers

Test #38:

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

input:

38 273743143

output:

0 1 24781362 72927091 127618817 111300997 227849658 26207264 96210674 99761181 2338147 133403176 178461918 222251505 113991348 211069857 202882795 241726473 47857444 35922117 926281 109630647 92041349 76938751 21075043 239014922 105036258 214906186 105543856 241636867 94493218 41343382 149193204 189...

result:

ok 1444 numbers

Test #39:

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

input:

37 486774317

output:

0 1 465256676 283479615 64537309 234142025 419018834 190749226 16515401 167408025 11736768 305156202 186158337 155468153 158197516 423013487 33467495 484120049 373102028 480540381 38877534 134204055 430547454 341231673 121552325 187128838 122470086 186767352 107108075 451678953 91895500 103101468 45...

result:

ok 1369 numbers

Test #40:

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

input:

36 123393419

output:

0 1 7534784 16373810 121151679 59009885 75032384 117726512 121512820 121001617 49329471 43243727 52643366 13229059 93033924 16029135 16402689 115348933 13310890 112746311 111367648 73591953 28527011 75392223 73548393 62393032 65939200 42391089 42752669 88941830 50458705 42737410 33862620 16356113 11...

result:

ok 1296 numbers

Subtask #6:

score: 15
Accepted

Dependency #5:

100%
Accepted

Test #41:

score: 15
Accepted
time: 3ms
memory: 47620kb

input:

47 889799149

output:

0 1 66764954 549260808 46596015 84062690 208818053 618084268 357637955 411617511 211048023 291826893 650511151 142754705 22132753 472031385 146691382 637907741 248140067 204739107 382507988 262230303 716148709 740666150 381802244 15607240 167146455 469300300 63509733 688675476 827668333 160583258 77...

result:

ok 2209 numbers

Test #42:

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

input:

47 636406607

output:

0 1 463154690 110460319 395855146 607140406 330598294 20093327 25170871 321286370 340487644 619403857 557370224 187500679 102528451 247218571 168591397 609134613 497997818 163323820 501984282 92905750 152487314 165508947 153067349 170418000 225906176 67108587 150509161 81216147 48648728 545556762 57...

result:

ok 2209 numbers

Test #43:

score: 15
Accepted
time: 3ms
memory: 45320kb

input:

44 801677689

output:

0 1 89264172 505845024 50256172 157294391 627777285 654227127 401530690 5538478 781987028 751218319 792968839 116232760 471128037 229778454 711984335 430280135 286539711 141560081 525289304 238142055 49114773 195565666 48837617 709265933 505562374 661321401 420103668 273319950 139852900 599140909 39...

result:

ok 1936 numbers

Test #44:

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

input:

44 656206483

output:

0 1 103876701 50126461 572675844 571144027 421241799 293880521 96777975 28952087 501042790 128778985 432799655 553437847 354198529 179419109 546365661 101350263 485018813 63468429 313302913 14581276 444383430 96617768 487039842 24634747 223652044 202952194 313946615 174602120 495093525 280866858 307...

result:

ok 1936 numbers

Test #45:

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

input:

50 992635381

output:

0 1 253425855 852768081 809211242 640795870 794423576 345278107 932916220 718059726 809354250 483785167 802678902 611705730 319241644 682095639 109154600 248177886 720821486 429976487 268010062 508430652 350490336 383984170 858853088 862183003 168022920 325894688 302945828 157225371 688449374 276542...

result:

ok 2500 numbers

Test #46:

score: 15
Accepted
time: 4ms
memory: 50796kb

input:

50 245638949

output:

0 1 43454128 171661734 159951809 92765978 212140588 18577128 74695706 143130599 140583008 72098407 58325390 95277752 64464219 7949016 194723367 101079192 196926901 148225464 96855384 183467209 213183997 229566127 74140177 200287678 116065963 236921493 215752723 125947080 125526131 215809705 14371231...

result:

ok 2500 numbers

Test #47:

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

input:

49 932619229

output:

0 1 270142554 674039219 481931252 871552184 160909473 494870787 368557966 398153744 368156694 189079166 699454192 158195104 209150649 893235735 367468073 503533651 203979504 242669038 260979052 126976787 680942898 332982195 836741115 62604673 783161446 680051820 541376420 362803459 183094376 8281855...

result:

ok 2401 numbers

Test #48:

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

input:

48 532121761

output:

0 1 124563019 357831570 56915384 13479062 305709843 97119144 56860372 35542797 405872184 259113536 56057380 424222736 490628774 418992987 410518847 383843102 56795910 317723649 120693751 54988725 309007787 383333758 483207450 441661556 287477630 385638712 111901895 325744714 170461105 242339227 4982...

result:

ok 2304 numbers

Test #49:

score: 15
Accepted
time: 3ms
memory: 47936kb

input:

47 458026537

output:

0 1 419394992 331677464 331772211 129498872 455408027 141498220 243818392 219578751 302529220 193968067 40054632 351620224 109015721 192098726 122096876 114772418 199238949 320862767 408311587 253819695 67037874 293185646 23568693 379566553 267641249 156469307 290197794 339468202 187940167 50152101 ...

result:

ok 2209 numbers

Test #50:

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

input:

46 858912577

output:

0 1 649082933 815755388 709752223 86619112 296858734 1937829 535962726 492377796 288256846 632408863 458134786 306956751 15707064 307709471 292164449 79312996 735109365 104554209 15690763 164115907 163348705 129325307 411476329 55809340 540920814 574863886 79026959 705518535 61390501 281730231 35893...

result:

ok 2116 numbers

Subtask #7:

score: 5
Accepted

Dependency #6:

100%
Accepted

Test #51:

score: 5
Accepted
time: 3ms
memory: 50368kb

input:

51 995655581

output:

0 1 414060562 199320338 307932054 831691576 366227206 409976126 934497945 745027808 909523802 837851807 182467353 963712859 503346294 644525187 340020201 195723887 957497538 680432724 334914139 48034876 122845662 559373139 550253167 777850066 980848183 620965995 263327132 718166553 776904533 7614250...

result:

ok 2601 numbers

Test #52:

score: 5
Accepted
time: 7ms
memory: 57484kb

input:

58 181855907

output:

0 1 175299677 117438219 108095421 12864106 104495350 158819480 122769815 52200454 8567101 44097147 67189077 61208356 26768162 50429861 167303685 130571638 94597012 151665255 2308655 57213059 150245160 82254091 156724959 122500857 138832635 181787385 15657597 11688624 36758610 164102552 114840921 534...

result:

ok 3364 numbers

Test #53:

score: 5
Accepted
time: 4ms
memory: 55204kb

input:

56 941852911

output:

0 1 792665770 163938207 52524916 15333272 590349849 682410069 505564302 163149418 143664287 422787632 631500491 903256371 927933328 617767378 234481336 366974748 629865389 105198986 890915977 61707647 468764274 733889402 236463766 704900320 721985089 617033110 334509605 577275007 825787384 161731720...

result:

ok 3136 numbers

Test #54:

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

input:

54 659446589

output:

0 1 481267696 279452636 182246663 616752674 369154516 527411155 522465774 259226236 171515408 112318810 542030792 577118393 129675101 36531042 587077209 174271245 209682879 179470828 259755637 281855327 627792588 623423808 480586146 109136094 232228684 542628229 581891342 155643983 436846220 3467682...

result:

ok 2916 numbers

Test #55:

score: 5
Accepted
time: 4ms
memory: 60720kb

input:

63 959797933

output:

0 1 245332495 239686359 840245118 77987730 246201590 168267745 127481578 406780622 446267598 850235809 243307040 189784078 717788448 805602900 139592975 484986133 428278275 1693265 588660748 633415939 546283079 260053111 627763361 308852241 506678703 16614041 538442570 469631745 625245325 308971733 ...

result:

ok 3969 numbers

Test #56:

score: 5
Accepted
time: 3ms
memory: 61456kb

input:

65 570076789

output:

0 1 310328804 294980678 365437294 200660137 395421648 61872119 466968891 3522622 327853984 173660946 458028044 297797149 342416231 266195608 320148543 370440828 258981715 364529815 459374107 22440616 246806181 397238936 26360731 433651520 90433318 140566742 38902952 281229233 178500662 558639261 558...

result:

ok 4225 numbers

Test #57:

score: 5
Accepted
time: 4ms
memory: 63088kb

input:

64 775108613

output:

0 1 596356662 171755335 552094446 773859240 134034335 717362522 52556356 271885992 447988787 532175727 458640228 344428261 370377530 420472378 113588373 651993051 377963323 588219135 323349803 748499961 25033599 562045058 424377766 378085438 51852840 452409629 738187923 91326374 137830645 705238522 ...

result:

ok 4096 numbers

Test #58:

score: 5
Accepted
time: 4ms
memory: 61032kb

input:

63 137625419

output:

0 1 65829402 7815283 127755639 36136848 6729351 54105084 5302245 22989549 53639024 46247934 29720169 109287150 69048505 89556194 131387755 78835785 64302374 135399915 99523319 15349724 50131487 104543276 24936980 104912940 47875892 30425158 116085976 19545315 14798836 83145508 126017858 56416572 127...

result:

ok 3969 numbers

Test #59:

score: 5
Accepted
time: 3ms
memory: 58796kb

input:

62 195857911

output:

0 1 42695576 69644185 49328469 19075152 42730501 162221338 86559278 125704040 93462371 47249286 173884694 43067149 72455575 5651862 25984716 9901739 47951176 72452733 91643324 68308398 28954711 162996275 4020319 17208725 9652784 76192502 41566299 33108352 84196604 13006840 18647237 63262061 34418109...

result:

ok 3844 numbers

Test #60:

score: 5
Accepted
time: 3ms
memory: 59852kb

input:

61 737824709

output:

0 1 128232813 272390695 508404346 551164364 14208589 726189688 729422941 377136204 679827028 563055906 363993809 703542427 16400884 442577104 55705867 558246093 133172983 596219043 217666646 172542280 223691796 727050929 266640862 733835725 722433065 595052543 388595152 532422815 680497909 127734159...

result:

ok 3721 numbers

Subtask #8:

score: 5
Accepted

Dependency #7:

100%
Accepted

Test #61:

score: 5
Accepted
time: 8ms
memory: 72328kb

input:

74 355734727

output:

0 1 172316249 207802534 184477206 127970960 279876067 11697525 68535000 107994264 207266665 285239522 318228653 40587558 167486589 273539944 169246873 249571178 223045274 47072079 49214711 67626859 258928979 103664286 287141049 252007654 14600543 305774852 121096410 279574795 190136708 268369666 319...

result:

ok 5476 numbers

Test #62:

score: 5
Accepted
time: 4ms
memory: 66808kb

input:

72 581749769

output:

0 1 144680963 558720839 43571909 38039108 517295341 525006844 473377773 427258547 263729717 410969832 9291548 237378604 439546583 153764911 122557553 418292158 542880687 415771543 98870144 308842405 411458385 370775573 418387291 35618784 513613439 223166696 431262473 292396087 35756040 223191733 235...

result:

ok 5184 numbers

Test #63:

score: 5
Accepted
time: 10ms
memory: 71924kb

input:

77 294573973

output:

0 1 116589077 63955156 145963520 152930188 252865372 141858148 16584984 104455818 71034651 274527493 269402484 250442066 188697051 145205741 199019307 256055718 27577479 275129685 86902972 136454745 276450114 258734718 125856527 284953823 15869772 62061707 15150577 172791080 13260200 91399169 183552...

result:

ok 5929 numbers

Test #64:

score: 5
Accepted
time: 7ms
memory: 67540kb

input:

69 444426317

output:

0 1 60540764 26853331 174448677 253263350 118580583 382234243 351241810 223182088 342597712 148100580 396772748 432133219 438313267 18226198 52989507 135166893 213093944 251409007 255394983 173708083 257855330 154831516 123895867 330081859 329946776 428945273 244165554 397903364 377922236 376256723 ...

result:

ok 4761 numbers

Test #65:

score: 5
Accepted
time: 8ms
memory: 70876kb

input:

72 903799861

output:

0 1 815253227 652297127 629750141 699057154 460230533 539958268 305316748 154138699 82235246 365162904 455533401 750557675 901923968 501373571 195987169 397181054 307212030 476508096 658185202 15405434 299370655 702411159 693472360 765615825 219927870 194821983 686388393 726726415 339698054 71997936...

result:

ok 5184 numbers

Test #66:

score: 5
Accepted
time: 3ms
memory: 77508kb

input:

80 1041077413

output:

0 1 376828053 798985234 1011269834 350407992 273926387 253328716 627397776 657900380 74015538 454143309 465084654 541884411 11086685 907741959 929086838 128584434 968218053 42381098 95541063 854905063 129292170 588134168 965827597 628742220 855388538 1026341486 172437349 53527597 960207838 776331810...

result:

ok 6400 numbers

Test #67:

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

input:

79 372523757

output:

0 1 350173130 193857108 205584488 261575310 255547180 107731174 347549048 258322079 144912815 173771063 243391295 174673843 51719983 48817070 223701148 113599172 309809173 206875059 99471166 87571187 18215000 370938080 45793264 328803227 110596387 65668498 75672876 83169639 40065256 59704942 3547533...

result:

ok 6241 numbers

Test #68:

score: 5
Accepted
time: 3ms
memory: 72168kb

input:

78 182742953

output:

0 1 98346030 98187521 164372336 51606791 165079232 61370909 114259881 10818654 154012064 43890399 16877522 84779557 20052768 14551736 49331158 158629250 15745576 98922441 107697951 145504132 99582358 74535134 6045268 174878371 38950503 106499777 158910923 70334372 122223920 8644236 159390688 5770108...

result:

ok 6084 numbers

Test #69:

score: 5
Accepted
time: 7ms
memory: 74948kb

input:

77 544024903

output:

0 1 50561459 384563619 309921631 82179460 543117475 126405371 148719536 157996042 525319950 347579384 296755770 364632249 531771085 271514442 198476423 203000600 355274515 51497751 142590952 14365535 227409408 543137791 331232395 30028514 424096850 473212265 357018304 438668891 204606768 28019602 47...

result:

ok 5929 numbers

Test #70:

score: 5
Accepted
time: 7ms
memory: 73432kb

input:

76 642285169

output:

0 1 624708844 180274792 411231524 411847231 621545399 574203455 45792563 180658965 475936556 516316903 111706536 629949895 483623683 253982311 550598909 249678528 436446616 258511882 373324437 238047938 336637303 17636510 319099717 518670467 333502626 174828834 556389198 369353570 626801810 50556855...

result:

ok 5776 numbers

Subtask #9:

score: 15
Accepted

Dependency #8:

100%
Accepted

Test #71:

score: 15
Accepted
time: 15ms
memory: 107776kb

input:

112 368918587

output:

0 1 255196764 54587616 198402417 239709684 218801074 82535015 123513515 59133289 119341529 356627842 18018461 212698819 346103407 215046096 167983884 80091114 94900732 62921321 232095093 178908320 7795688 262184498 19090085 318126894 55226101 86453899 286652046 62069627 310416303 197181040 21938341 ...

result:

ok 12544 numbers

Test #72:

score: 15
Accepted
time: 12ms
memory: 77788kb

input:

81 173717281

output:

0 1 83320222 57978163 158732434 74940165 123848689 14984779 147866314 87348057 19602536 14840306 22365977 35783627 6198414 168967027 30987030 120285263 7447341 130827931 16142455 101618214 131526854 140095267 140780060 54174431 169320667 134507569 105295461 81313851 113337079 163478339 21562825 1261...

result:

ok 6561 numbers

Test #73:

score: 15
Accepted
time: 21ms
memory: 103844kb

input:

108 682796591

output:

0 1 89343845 208950893 343976422 176498000 351002033 514634504 129264933 571153170 188877867 300808507 25996214 33968056 277528058 98557346 157269398 158728204 44180170 197309170 300034834 59180474 66754912 342205656 339880740 458482039 671352828 268984900 580137509 370625373 79288366 606779663 6793...

result:

ok 11664 numbers

Test #74:

score: 15
Accepted
time: 23ms
memory: 108224kb

input:

115 371081771

output:

0 1 5333433 231663236 236332648 296032878 338405405 96788769 309461007 328135878 287562293 330881570 151540943 169316770 214100046 274764938 139574672 226142450 80366535 206599458 342805058 46991811 211199704 214881059 222962907 123895526 65978386 306773252 316057019 165993815 126502189 232508669 31...

result:

ok 13225 numbers

Test #75:

score: 15
Accepted
time: 15ms
memory: 100856kb

input:

104 349453171

output:

0 1 235643763 83222339 11624535 290362261 156826605 249539057 166948 304035612 166377758 150541123 44014527 187162099 323232181 163364524 256788005 202689809 171859692 73800830 94598914 314980031 71046858 29646150 105396985 124636672 100867927 195782293 1335281 39668478 196316894 108747364 265035736...

result:

ok 10816 numbers

Test #76:

score: 15
Accepted
time: 24ms
memory: 115936kb

input:

120 984007823

output:

0 1 492395259 790856096 696603540 381939935 262018368 800177699 7520899 940730201 640112908 856120755 111411799 754809713 37156802 901144086 532478504 611124791 495223739 205609234 116842683 721333013 974187006 140968428 74423063 289630125 642737560 164376384 341046870 755961310 218873388 581681192 ...

result:

ok 14400 numbers

Test #77:

score: 15
Accepted
time: 25ms
memory: 116560kb

input:

119 1007878513

output:

0 1 84078810 153464365 823540122 346901239 63917801 945966621 983577875 578513618 521861480 968903392 702327306 940668291 835792067 43987342 795750897 453530684 778329408 790205841 31473244 62905522 428613725 87732818 527563917 430801288 456492867 934588297 712404575 362274964 829512778 571458502 21...

result:

ok 14161 numbers

Test #78:

score: 15
Accepted
time: 24ms
memory: 113848kb

input:

118 237046307

output:

0 1 193247083 99445709 227815730 55679611 95424389 162787197 125425174 16749097 226061629 74659415 70184721 204625630 101825987 223397883 128258704 122804303 207968058 175777506 55185438 123073626 91946091 212607684 160025851 111569 86857145 58181607 127084180 115889617 217486569 142742151 209175216...

result:

ok 13924 numbers

Test #79:

score: 15
Accepted
time: 24ms
memory: 114048kb

input:

117 609718427

output:

0 1 525760582 8747513 360335139 550653454 194188370 41659534 77024986 436157409 550721519 587886889 361415119 244605246 423437314 31837185 315853024 163056968 342654656 295012688 310553374 191109499 56552343 559515421 432303091 44343120 106377540 430210835 394470368 72969083 520513528 371575536 1811...

result:

ok 13689 numbers

Test #80:

score: 15
Accepted
time: 23ms
memory: 112424kb

input:

116 373770433

output:

0 1 16278822 153989887 45861405 187086459 115011009 196797613 20070526 342531598 83131495 173723430 68278311 167371964 43599467 332117246 41025836 20757793 323461003 289664647 99303555 83810700 343277972 50368485 271040585 312767873 337626341 229392977 269090721 277195613 368182996 183640463 2957485...

result:

ok 13456 numbers

Subtask #10:

score: 20
Accepted

Dependency #9:

100%
Accepted

Test #81:

score: 20
Accepted
time: 276ms
memory: 297248kb

input:

269 746901971

output:

0 1 135893920 417882568 611496136 649454546 423925382 460131014 140146244 175796008 5591807 322812554 79762725 167194651 181495842 39211294 623252581 559874540 115522521 642557001 20650648 4854859 711986056 142826193 288195531 288147629 723511457 5941236 391946908 115814035 382462386 602330631 73491...

result:

ok 72361 numbers

Test #82:

score: 20
Accepted
time: 232ms
memory: 281000kb

input:

257 853402663

output:

0 1 97532477 453594399 520673221 741825303 663584428 118625413 244111962 463770973 384091465 729565942 245515928 480646703 690820427 313472485 177634566 41021208 628064302 472880230 713067919 824576546 435970091 719275669 205864022 530681030 308653590 71340688 283208862 374436095 355581065 671957925...

result:

ok 66049 numbers

Test #83:

score: 20
Accepted
time: 79ms
memory: 167452kb

input:

169 800200853

output:

0 1 242538569 755299007 347813336 598601974 743873822 435099704 122058683 104915933 291563530 633725213 697378675 331275675 263021229 522827929 538092277 463877890 337419945 113083333 725100387 518593451 107916119 547363805 732928380 770883586 29544320 93410822 588113151 86248026 138190492 144355167...

result:

ok 28561 numbers

Test #84:

score: 20
Accepted
time: 159ms
memory: 243260kb

input:

229 541442687

output:

0 1 128194429 511772303 306065491 393753037 70832459 519898545 51088339 175334129 282464111 101288055 35645380 504404072 293960482 363278829 175807418 56368535 33871917 502843831 285519570 287791673 315718521 251153293 42507825 86168997 230288270 7558460 209781597 159515089 254653538 96301426 366208...

result:

ok 52441 numbers

Test #85:

score: 20
Accepted
time: 35ms
memory: 128360kb

input:

133 421095511

output:

0 1 125287692 257001830 41112462 412470856 272458386 269908837 291377448 330079996 15198367 127330574 405695977 4072370 183446072 82632034 142564572 242463259 309565140 260296313 118051152 160356070 140788959 148038159 89191750 132451910 49229800 109316872 278926833 268173730 105546258 372676269 269...

result:

ok 17689 numbers

Test #86:

score: 20
Accepted
time: 344ms
memory: 328988kb

input:

291 289308937

output:

0 1 106969263 96291705 23104001 147407729 38677557 246757164 186908791 271307084 32799462 11677387 113467386 179485776 112690954 170453047 69518757 15629310 232854060 164975924 530604 66959370 139220185 202429569 236020692 157546497 170911493 42749810 145945558 137249202 231578170 136080416 22314888...

result:

ok 84681 numbers

Test #87:

score: 20
Accepted
time: 185ms
memory: 258480kb

input:

239 331138033

output:

0 1 141610813 289433503 302117154 113471253 200124875 139373575 267950605 185113866 259133718 237520368 317448901 304403303 61684940 135209017 325985550 19022848 90545530 64657958 217683312 320120216 112281782 273786615 163344359 43113492 92362354 245171023 320125947 158384999 170724718 51895323 235...

result:

ok 57121 numbers

Test #88:

score: 20
Accepted
time: 344ms
memory: 331912kb

input:

294 459799667

output:

0 1 191717261 356059276 141704257 285882597 252874547 164913376 388240687 29301075 118100486 139091647 174392502 155876927 80524064 67254316 254786857 165283283 368581184 21489553 128734324 260439291 185466552 105757920 202969377 3168631 227360075 135385122 209041638 252623764 127154276 376451765 26...

result:

ok 86436 numbers

Test #89:

score: 20
Accepted
time: 135ms
memory: 229436kb

input:

219 192774311

output:

0 1 42702299 131175578 60986332 101264859 96121240 178311626 149278633 147860288 82006452 8324858 9070228 169927542 96443358 10302490 179234010 96420845 189180410 169013113 3416325 27791057 95473394 113857203 126843296 168476732 171672743 165668206 1625368 171396298 139447017 115786830 7024436 23383...

result:

ok 47961 numbers

Test #90:

score: 20
Accepted
time: 139ms
memory: 220600kb

input:

212 886741099

output:

0 1 809524337 375272985 69069351 160479263 170346734 175148363 61559969 76890944 272089446 840693458 405535211 207862088 241343686 393913646 824004171 451770148 412396530 249377473 852428111 395666829 575798030 417194075 733856064 673167162 123178760 727465249 223344837 2766872 670236768 535224802 6...

result:

ok 44944 numbers

Test #91:

score: 20
Accepted
time: 208ms
memory: 274540kb

input:

253 966086857

output:

0 1 504087748 767933163 155297132 518626729 888622040 211637378 738054710 181424820 618399596 54031847 608996483 433591593 491157367 53116816 365334697 620044289 355892918 117473560 162383907 666465839 170924733 301969121 54866362 443102799 307650368 735085913 644831478 75706527 588021907 674787761 ...

result:

ok 64009 numbers

Test #92:

score: 20
Accepted
time: 226ms
memory: 272880kb

input:

253 320301689

output:

0 1 94585242 307689017 108099346 272881223 35725744 201753880 219261337 207374741 150787464 221222135 172528137 196410565 131921477 128986885 204565446 110254978 224578265 9581932 143176511 268084980 169797133 298541719 206453140 56322324 194783384 119386698 7073131 269452094 225967517 283429625 251...

result:

ok 64009 numbers

Test #93:

score: 20
Accepted
time: 215ms
memory: 277524kb

input:

254 893975699

output:

0 1 456208889 821302662 372069476 259424620 235002952 839307514 265076190 174292787 81652136 18241348 34379934 748780823 799092159 122654141 664032317 688305039 883564587 134767966 428502172 184574761 38988655 887407038 217724676 292411510 361562821 651049183 401358908 693619779 620408716 70358842 6...

result:

ok 64516 numbers

Test #94:

score: 20
Accepted
time: 342ms
memory: 325968kb

input:

290 187910999

output:

0 1 154521411 173183133 152601393 10285657 140501902 153127701 137932593 70381034 137309798 13752389 135030988 96813951 84386269 146020814 143877200 23495965 145863777 40123406 101585342 88396666 109622757 147373289 79252836 6841259 162384946 157122447 78076381 83566043 151209941 147279934 172126871...

result:

ok 84100 numbers

Test #95:

score: 20
Accepted
time: 342ms
memory: 332456kb

input:

293 1046285447

output:

0 1 315140593 903603984 977582140 694222881 903986140 420803571 967454644 141718913 394723088 359704284 984935220 821263715 597914790 543770156 408929709 928842596 514078923 693883027 870416522 911187646 125758791 314434847 965571960 801762867 448517203 571430483 1038435467 443686615 24908930 402575...

result:

ok 85849 numbers

Test #96:

score: 20
Accepted
time: 387ms
memory: 342112kb

input:

300 912431407

output:

0 1 722797353 556782748 39576509 852084299 685278336 361363701 108401659 529026814 453632509 569609367 376535961 59225807 221565425 633276938 162576406 255324570 23741653 236151248 621956281 708194003 264933122 641525723 865202286 818613937 708698458 56925225 195682346 776333922 521015810 464320840 ...

result:

ok 90000 numbers

Test #97:

score: 20
Accepted
time: 382ms
memory: 341312kb

input:

299 751182847

output:

0 1 623924752 262624206 243146497 425094190 405149820 353511338 85145 710606510 584977466 166825690 523961779 417071810 456543819 420773358 213089759 20327658 627313051 439854394 679761122 540673874 218661338 13493544 39971797 720813274 519154397 639901728 254334610 588616791 212692153 544493561 180...

result:

ok 89401 numbers

Test #98:

score: 20
Accepted
time: 377ms
memory: 338312kb

input:

298 930312907

output:

0 1 382131490 71746745 38800862 140760983 843044218 244089083 694783585 645548763 738886633 332208970 755737407 845967589 686114233 349413936 125662229 145006411 528260705 337620033 262515402 349517975 923763108 402525208 430088068 609119906 421473985 337505017 179339406 124818750 143743374 52695737...

result:

ok 88804 numbers

Test #99:

score: 20
Accepted
time: 354ms
memory: 335464kb

input:

297 698839103

output:

0 1 37690510 339422807 673534527 415197953 129457739 601237622 88534620 421995219 95999738 109140240 635995261 428979577 145689020 91464387 439601453 100327940 510922527 491842951 422106486 222500741 558292034 262613801 240508646 258607197 180394980 145289811 178365411 195056943 339295279 159549800 ...

result:

ok 88209 numbers

Test #100:

score: 20
Accepted
time: 356ms
memory: 336436kb

input:

296 142137293

output:

0 1 135178246 98809692 23477274 607721 75065421 79888736 15932837 80871411 104458750 38629562 18505869 111432992 1599176 37685258 4192976 109958872 121628242 736755 83180727 43541318 61306529 41041440 41391140 92697413 90217224 78219711 39381683 10385798 29928203 44402227 7735300 97437226 58411518 5...

result:

ok 87616 numbers