QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#244786#6328. Many Productsucup-team864#AC ✓995ms6068kbC++232.8kb2023-11-09 15:51:352023-11-09 15:51:47

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 5256kb

input:

2 3
0 1

output:

10

result:

ok 1 number(s): "10"

Test #2:

score: 0
Accepted
time: 2ms
memory: 5836kb

input:

5 1
0 1 2 3 4

output:

120

result:

ok 1 number(s): "120"

Test #3:

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

input:

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

output:

658270849

result:

ok 1 number(s): "658270849"

Test #4:

score: 0
Accepted
time: 899ms
memory: 5912kb

input:

200000 999999999989
823489320 406308599 710963770 183707427 192930969 941365774 318564299 391028855 945374838 651744270 515755727 220857626 599403217 214957584 335628890 771694833 40989299 34892948 630275822 869708185 432704750 924850167 707864789 232688853 406616372 529994171 782650336 979286144 65...

output:

777405593

result:

ok 1 number(s): "777405593"

Test #5:

score: 0
Accepted
time: 903ms
memory: 5908kb

input:

199999 999999999331
969252353 737776924 108584656 914893031 394348303 484491127 481944452 120707790 396027156 912223841 673218447 285837840 782450963 144940963 892852383 782342131 655814479 1324532 794011279 219428289 470995270 489684781 347978895 102371386 546635675 585575402 940741300 644383693 67...

output:

573300948

result:

ok 1 number(s): "573300948"

Test #6:

score: 0
Accepted
time: 914ms
memory: 5976kb

input:

200000 742073813481
681694404 632869785 595996398 549654767 229574822 571126931 469341419 702184356 904366313 746328903 842820475 578092052 586236587 796973195 766841610 123554290 666934376 118830348 326368534 40766155 790927880 880528134 890721558 357539968 885997091 937508042 5345140 189162897 200...

output:

998002127

result:

ok 1 number(s): "998002127"

Test #7:

score: 0
Accepted
time: 995ms
memory: 5976kb

input:

199999 963761198400
124206358 425059813 396286827 293468808 45861386 890748681 587148852 2565459 137729579 865441288 710978415 682768035 62610967 490442955 426217252 132942846 314800009 680954919 208583546 438814504 79283475 26876485 718279429 714019319 799517726 874565672 262935553 180792133 654326...

output:

150795568

result:

ok 1 number(s): "150795568"

Test #8:

score: 0
Accepted
time: 893ms
memory: 5980kb

input:

200000 549755813888
154464482 922506517 440386473 592872114 740241030 65093066 195263806 140372279 686442905 168161853 216221623 831551102 203181658 450884227 451817602 487635386 545548989 216183567 218772329 189773367 217113749 131736290 966799162 875967103 93914434 521722337 383140644 765520582 20...

output:

437668137

result:

ok 1 number(s): "437668137"

Test #9:

score: 0
Accepted
time: 901ms
memory: 5940kb

input:

199999 847288609443
538909891 62076038 846297776 955237158 229420572 214839844 464344742 574620261 23649742 896004520 961950387 407664313 359473680 627261484 831142841 945051217 661150108 981408974 203662235 723004670 181370365 892341019 697801198 168588955 359516923 635650887 610379739 269713869 21...

output:

447937133

result:

ok 1 number(s): "447937133"

Test #10:

score: 0
Accepted
time: 895ms
memory: 5976kb

input:

200000 1
290147746 164378694 228549560 747798391 389830621 209441203 923599439 77021620 431222973 528286185 275375247 836375003 69912873 468084121 529508739 502012618 888546699 279196338 682945369 401271076 979959203 969856299 419354950 464199794 752797654 272356219 733648717 438501203 583809849 374...

output:

960581872

result:

ok 1 number(s): "960581872"

Test #11:

score: 0
Accepted
time: 900ms
memory: 5980kb

input:

199999 2
456997655 595523808 131854612 671431878 844457985 224729609 198554845 463291311 261989774 593117867 424503239 170351502 394072587 868548033 730651713 205230254 184158230 113347601 315207435 155734777 530360727 219655064 183851924 327130440 697250929 185601652 615062692 436902689 686638630 5...

output:

63413518

result:

ok 1 number(s): "63413518"

Test #12:

score: 0
Accepted
time: 896ms
memory: 6008kb

input:

200000 4
183814833 771524932 127252360 147996415 276875512 467951477 270825754 361030400 396200006 385596998 253829085 39158855 176152348 444150136 88618737 762684749 513984568 119516467 711633545 294128983 666436764 962527431 653397116 161978485 969639496 339650506 804701248 265124428 436768654 535...

output:

505383081

result:

ok 1 number(s): "505383081"

Test #13:

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

input:

1 762939453125
259588516

output:

540355949

result:

ok 1 number(s): "540355949"

Test #14:

score: 0
Accepted
time: 903ms
memory: 6008kb

input:

200000 999999999999
998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 998244352 ...

output:

0

result:

ok 1 number(s): "0"

Test #15:

score: 0
Accepted
time: 896ms
memory: 5904kb

input:

199999 999999999961
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

176607054

result:

ok 1 number(s): "176607054"

Test #16:

score: 0
Accepted
time: 27ms
memory: 5228kb

input:

5444 979109784549
317542840 257606014 611528707 126177718 286915086 352981581 180349438 918720981 846466770 881189740 804656840 288220977 815563574 608925421 791426493 951434988 211687220 369138592 982012491 436147815 370813603 243398326 484698310 748248736 234692620 975710978 760057732 56310212 386...

output:

777938190

result:

ok 1 number(s): "777938190"

Test #17:

score: 0
Accepted
time: 466ms
memory: 5544kb

input:

104191 649930523261
426749553 556214413 319462504 578340085 230651276 786821521 516064842 29130855 993243934 154639823 570658125 236813086 908601705 840337259 540712825 766585616 525080105 194679763 437526741 90021894 2867930 36405106 744852101 697563898 23384883 225169233 757084757 753261607 297204...

output:

91415686

result:

ok 1 number(s): "91415686"

Test #18:

score: 0
Accepted
time: 720ms
memory: 5860kb

input:

159809 160071327419
9765643 179924352 766250421 198764063 627481116 864065602 408619621 419491384 385520339 835489393 274296559 603383682 84554104 489106130 595755114 339726316 902460946 391726631 809524253 518639966 357705130 812061177 407370113 384068159 872219875 94447092 951040886 938590858 4597...

output:

199292153

result:

ok 1 number(s): "199292153"

Test #19:

score: 0
Accepted
time: 320ms
memory: 5436kb

input:

70784 120725086437
303023266 305300517 390974523 205809002 320790278 35030131 87019642 583637366 28480638 719646820 207731367 833653586 194588475 996952196 138557147 247596141 94302616 811532373 932136842 617373587 661485590 144713770 38454475 36133088 816965625 291810246 947417791 500642892 7781291...

output:

446643879

result:

ok 1 number(s): "446643879"

Test #20:

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

input:

82670 92816933754
842617490 854331672 933089997 706307979 38908687 39142538 977942806 830231656 255188773 763802635 68453472 129868110 1506480 716316451 622382872 231350022 296035854 944435176 935757379 926699416 475887580 933597861 513821041 919519667 956986936 783551755 867495601 812679807 1766130...

output:

535806507

result:

ok 1 number(s): "535806507"

Test #21:

score: 0
Accepted
time: 411ms
memory: 5452kb

input:

90836 816183702799
91526962 752056657 112684211 857470943 219511096 89273634 700213868 200376289 725594222 791607472 213183773 175588644 640626145 752406732 343001673 408461990 996859849 307660429 351310454 332965393 695856794 396386976 809211211 862569941 876655988 917522926 268079345 361325432 644...

output:

537956311

result:

ok 1 number(s): "537956311"

Test #22:

score: 0
Accepted
time: 882ms
memory: 5996kb

input:

195908 381028888098
715831484 109830651 955145309 615998142 37042842 374398812 853436909 579109074 365907130 772837894 660596664 797890492 103929907 100340657 675813031 854090103 887280483 748581563 596256710 702097435 458639096 484776433 348939514 491561649 36794688 462091924 588426554 978540845 26...

output:

237990056

result:

ok 1 number(s): "237990056"

Test #23:

score: 0
Accepted
time: 255ms
memory: 5940kb

input:

55991 339697193976
697367685 34325256 97821324 623311470 910498551 33423596 94588795 896289857 945584487 366491687 592486508 376802574 684029806 829246239 195665067 620651802 456350115 537397332 624517114 504510533 947019860 683814432 90754166 47873410 660643327 575319279 917747985 692683838 5469096...

output:

133060838

result:

ok 1 number(s): "133060838"

Test #24:

score: 0
Accepted
time: 649ms
memory: 5852kb

input:

143701 314646605906
342345051 461219138 399926079 40272422 202142831 414379459 565155395 512761915 431788311 448003222 213361959 18854418 962724984 510308631 868911101 283361979 948786113 254146120 750158934 198823069 449768843 622072401 186839238 183026255 868373646 677390904 701109511 712660384 26...

output:

698505012

result:

ok 1 number(s): "698505012"

Test #25:

score: 0
Accepted
time: 470ms
memory: 5608kb

input:

105021 572474782757
418995679 902129989 115521785 727119248 63759151 718586045 397949955 809164694 470799200 651727709 496257056 853520242 427836012 554859267 830943979 148996442 598501737 462118241 359112801 714862963 352337133 418299541 176421519 234976262 598424375 850352342 382929921 104269161 5...

output:

741161718

result:

ok 1 number(s): "741161718"

Test #26:

score: 0
Accepted
time: 507ms
memory: 5656kb

input:

112291 176666513693
825244737 752999655 193352590 838931787 966181870 220776765 366220693 296296899 829951208 690432368 809804109 942077446 591146581 705708169 968097802 288876465 498209448 778060164 536140072 181658288 388399960 777625454 140125996 408868275 572346260 433788712 370518255 402076377 ...

output:

997828606

result:

ok 1 number(s): "997828606"

Test #27:

score: 0
Accepted
time: 622ms
memory: 5836kb

input:

138986 406881283913
98154655 274290456 449322858 359679170 545575141 857635850 523735588 700136186 778933816 277260299 371149421 464173147 815682386 137918888 468897629 542695300 573722608 545141886 470559715 278655472 80059797 339767538 214326408 791570221 44697671 817881439 32832890 749094738 5967...

output:

938121504

result:

ok 1 number(s): "938121504"

Test #28:

score: 0
Accepted
time: 342ms
memory: 5464kb

input:

75528 884305106663
235308182 426435740 513339841 574019088 689127713 680852878 554784770 291116309 951958085 158759261 111912396 898869391 62693761 563905978 530883558 666455191 443935855 716509518 48812448 332336267 994894289 119302647 80434999 914358557 135446944 141958189 740520818 172394092 4043...

output:

666109838

result:

ok 1 number(s): "666109838"

Test #29:

score: 0
Accepted
time: 275ms
memory: 5472kb

input:

61470 160446908118
596146986 355427039 804886155 851914023 367961024 939422361 841755471 28047778 60648185 372489974 136495995 962600006 29081750 429011660 785974610 66872557 676350842 603283602 570042244 216288336 727480558 36493317 355449775 878226595 908845662 53621078 136990051 688644309 5335624...

output:

705278240

result:

ok 1 number(s): "705278240"

Test #30:

score: 0
Accepted
time: 855ms
memory: 5904kb

input:

190047 661885494751
20953880 745044427 566653833 260667361 377696283 1743421 99179377 135985350 90598840 229618870 997501982 370249463 142505147 299223761 720398097 400287070 228508049 130256168 893168986 509199451 100002963 288467848 919715570 292226208 92786443 523306172 305280123 27682332 9169227...

output:

771091520

result:

ok 1 number(s): "771091520"

Test #31:

score: 0
Accepted
time: 897ms
memory: 6008kb

input:

200000 208399615304
937745009 914200204 16148140 46313173 29043546 955054633 549754597 176364645 540853361 614787499 933723348 603087613 543873001 608545499 300595045 535995956 28152749 291168877 44339337 309921521 646601394 859284736 930953891 465195760 59268374 74270264 270142771 798309961 3811014...

output:

526967975

result:

ok 1 number(s): "526967975"

Test #32:

score: 0
Accepted
time: 901ms
memory: 5964kb

input:

200000 247003201359
980767385 128371966 818387520 969597765 367585004 785930188 609886538 760572731 348939735 485673564 454457065 22853582 883116381 764326889 257252604 935050010 378002292 873275556 191489191 253412956 867722396 411630102 895006341 910909774 415033042 941260580 537842895 264699065 4...

output:

731961689

result:

ok 1 number(s): "731961689"

Test #33:

score: 0
Accepted
time: 896ms
memory: 5908kb

input:

200000 284064379037
655785755 979223514 73584537 703070171 319626271 544078479 808957003 499687437 65167909 708092487 820081751 779676542 134764395 937206522 588371671 85947863 481847407 881119904 133979559 69164674 496495653 591724170 189400157 268079952 417104161 411284999 337761675 955940473 7477...

output:

271890899

result:

ok 1 number(s): "271890899"

Test #34:

score: 0
Accepted
time: 895ms
memory: 5996kb

input:

200000 835633602025
749619461 229154833 318423158 693312033 40273893 472571490 479671960 579203777 818323738 161926489 398306790 907831372 583430631 264023573 48884462 995066863 852109769 471196431 395248544 622100885 477816640 50727255 990430304 455913812 755804802 639820127 262141997 895283850 536...

output:

487195011

result:

ok 1 number(s): "487195011"

Test #35:

score: 0
Accepted
time: 903ms
memory: 5972kb

input:

200000 801796599883
5632765 747268704 305280541 334019350 225431368 449808428 200704529 960080456 368539186 209076854 622412605 782378675 50335604 620087098 868147626 585910607 485473475 416364785 196754977 987065064 783352605 90122577 397354174 486153354 23062820 851331579 250992819 794994499 25672...

output:

991203177

result:

ok 1 number(s): "991203177"

Test #36:

score: 0
Accepted
time: 901ms
memory: 6020kb

input:

200000 28079798604
947496562 428193582 988473363 48351774 316437390 984554798 290310258 509165150 994926221 3457465 891148153 52491897 345495567 963610150 963748665 543608622 135919961 21914220 182291011 216776973 602216746 9983014 222610259 450788357 932147464 186685526 367101196 127818700 51185995...

output:

111232278

result:

ok 1 number(s): "111232278"

Test #37:

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

input:

200000 65024983419
294217290 667210743 882473189 604725647 834566507 401463670 843514679 510258092 533785459 245695074 780324418 250123144 341293567 537290561 477680449 729019429 275496877 129275666 56462403 557995999 863255151 284129402 813791060 199191740 613815182 799614945 625200669 210332977 21...

output:

585663653

result:

ok 1 number(s): "585663653"

Test #38:

score: 0
Accepted
time: 896ms
memory: 5992kb

input:

200000 548749310463
695556945 894226546 820274625 402576079 515570009 607968482 635686618 861183979 818610997 77646017 293719402 617285942 302284980 382237640 448444838 339991628 450317337 416529690 208252705 979339012 790048600 192484520 118975431 40669222 899636877 116333133 764234560 538064070 92...

output:

373784974

result:

ok 1 number(s): "373784974"

Test #39:

score: 0
Accepted
time: 900ms
memory: 6068kb

input:

200000 593338883649
650056824 741361302 473971181 315752655 253545151 404077516 298431840 472515792 992528437 634755267 855488180 815881903 555390867 594836926 165187247 509917642 605308559 942423311 534933584 196281875 139718917 130634150 990166711 195396093 851826710 725504297 341951950 115220460 ...

output:

636463581

result:

ok 1 number(s): "636463581"

Test #40:

score: 0
Accepted
time: 902ms
memory: 5912kb

input:

200000 553945257293
172922719 350611277 931385579 868518615 991144179 796417942 27521529 337634748 182054673 957694406 478469927 232628588 292050176 158773088 367438290 941245395 816137437 391142379 482317133 568071922 743012605 108370695 1836960 758843701 79762319 114051954 893503400 664819932 5663...

output:

626936416

result:

ok 1 number(s): "626936416"

Test #41:

score: 0
Accepted
time: 899ms
memory: 5976kb

input:

200000 340513645533
343233770 596981937 716086645 719841514 433725418 213999046 233743715 571272179 912684243 102146743 942636445 786009009 97054271 816664115 164914148 363191927 691616760 872392557 73375003 567606699 758384059 845698267 422148257 805832408 756355997 335952418 786451218 205103773 14...

output:

630734223

result:

ok 1 number(s): "630734223"

Test #42:

score: 0
Accepted
time: 900ms
memory: 5908kb

input:

200000 986799716770
840031603 350454818 255366072 778978958 961930297 604425927 24441785 276029343 402175175 740340274 358687180 158002552 828471856 815045066 397486665 80208753 23856307 563137896 787487442 902783702 83924387 859508618 547410369 871369730 67471565 568558915 166832677 154392833 93855...

output:

888607807

result:

ok 1 number(s): "888607807"

Test #43:

score: 0
Accepted
time: 901ms
memory: 5972kb

input:

200000 100409873808
240678595 175496217 703549983 609587999 747972955 593672337 305246542 601176886 536664889 169264035 192779030 911328918 185437748 597550222 267560820 332542343 807230188 881758654 616451632 417476940 733204042 921960874 390535551 217820887 615126982 105225850 16570435 271870228 5...

output:

977979207

result:

ok 1 number(s): "977979207"

Test #44:

score: 0
Accepted
time: 900ms
memory: 5980kb

input:

200000 43271233261
720246418 993559475 870017178 398104964 85197442 880575314 103904240 705557283 959902025 44082069 607976973 632146761 816925876 84135345 431673364 149760491 291876631 90745163 908480709 992772173 258015595 28803871 446786150 637958642 609628089 385298052 646476887 390151198 252764...

output:

180307492

result:

ok 1 number(s): "180307492"

Test #45:

score: 0
Accepted
time: 901ms
memory: 6044kb

input:

200000 440883247557
382651965 86721694 846173120 265566085 576118833 460345437 961965158 475009105 825815381 401284452 740335832 915386378 968252132 820414285 922885414 852435010 729762311 424410914 248886045 251528484 757179129 629697907 616992649 891395599 329799149 384637203 461419192 969438523 6...

output:

159352852

result:

ok 1 number(s): "159352852"