QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#794533#1796. Beer MarathonI_be_wannaAC ✓264ms11660kbC++20720b2024-11-30 14:48:482024-11-30 14:48:54

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1 1
1

output:

0

result:

ok single line: '0'

Test #2:

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

input:

1 1000000
1000000

output:

0

result:

ok single line: '0'

Test #3:

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

input:

1 1000000
-1000000

output:

0

result:

ok single line: '0'

Test #4:

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

input:

1000 14
-12601 -10081 -4327 -13175 -6301 -7589 -4257 -1597 -11845 -1177 -3011 -9633 -9087 -14113 -6203 -3053 -5713 -1135 -5139 -4061 -5895 -2577 -8261 -6049 -9059 -11453 -6427 -2213 -547 -1219 -9213 -1373 -6539 -5951 -8597 -12545 -5195 -4131 -11327 -10221 -13217 -4733 -1093 -827 -1835 -11677 -12657 ...

output:

0

result:

ok single line: '0'

Test #5:

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

input:

2 6
-5 1

output:

0

result:

ok single line: '0'

Test #6:

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

input:

2 5
-2 3

output:

0

result:

ok single line: '0'

Test #7:

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

input:

2 4
-2 2

output:

0

result:

ok single line: '0'

Test #8:

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

input:

2 3
-2 1

output:

0

result:

ok single line: '0'

Test #9:

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

input:

1000 14
-12601 -10081 -4328 -13176 -6301 -7589 -4257 -1597 -11845 -1177 -3012 -9633 -9088 -14113 -6204 -3053 -5713 -1136 -5140 -4061 -5896 -2577 -8261 -6049 -9060 -11453 -6428 -2213 -548 -1220 -9213 -1373 -6540 -5952 -8597 -12545 -5196 -4132 -11328 -10221 -13217 -4733 -1093 -828 -1836 -11677 -12657 ...

output:

500

result:

ok single line: '500'

Test #10:

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

input:

2 5
-5 -1

output:

1

result:

ok single line: '1'

Test #11:

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

input:

10000 111
131424 -90132 176600 615828 44178 -170274 -143856 194472 -204018 656454 208346 258962 -182152 464534 772560 148184 -65046 739148 338994 642468 664778 597846 -175602 35076 441668 -2220 126318 -34966 274280 713286 555554 352536 450216 28082 750360 185258 592296 882672 116660 547008 -214896 -...

output:

5000

result:

ok single line: '5000'

Test #12:

score: 0
Accepted
time: 258ms
memory: 11552kb

input:

1000000 1000000
-511652 -974281 -634347 -329103 -287581 -61571 -760215 -445366 -681166 -826603 -950899 -201249 -737726 -319759 -899906 -42481 -697782 -27118 -892233 -856889 -4690 -658243 -976305 -863537 -652451 -727997 -374905 -836604 -494180 -724390 -881657 -538639 -589892 -997745 -923386 -641894 -...

output:

249999750000000000

result:

ok single line: '249999750000000000'

Test #13:

score: 0
Accepted
time: 245ms
memory: 11592kb

input:

1000000 1000000
488349 25720 365654 670898 712420 938430 239786 554635 318835 173398 49102 798752 262275 680242 100095 957520 302219 972883 107768 143112 995311 341758 23696 136464 347550 272004 625096 163397 505821 275611 118344 461362 410109 2256 76615 358107 240210 816362 435838 829387 38878 3369...

output:

249999750000000000

result:

ok single line: '249999750000000000'

Test #14:

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

input:

14156 589
13141 1190 3593 7550 2400 468 706 3754 164 7916 3879 4335 361 6187 8962 11769 1416 8661 5056 13444 7991 7388 420 2318 13080 1982 3140 1687 10005 8428 7007 12445 6058 2255 8762 3671 12385 9954 3053 6930 66 672 3268 12870 13159 13368 5151 5134 3900 270 1268 1311 13178 10320 8401 8166 10596 6...

output:

29457673392

result:

ok single line: '29457673392'

Test #15:

score: 0
Accepted
time: 264ms
memory: 11552kb

input:

1000000 1000000
-511652 -974281 -634347 670898 712420 938430 -760215 554635 -681166 -826603 -950899 798752 -737726 680242 -899906 957520 -697782 972883 -892233 -856889 995311 -658243 -976305 -863537 -652451 -727997 625096 -836604 505821 -724390 -881657 -538639 -589892 -997745 -923386 -641894 -759791...

output:

249999249999500004

result:

ok single line: '249999249999500004'

Test #16:

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

input:

11825 6930
23397 -740054 -737651 20294 -738844 -740776 -740538 -737490 -741080 20660 -737365 -736909 -740883 18931 21706 24513 -739828 21405 -736188 20534 20735 20132 -740824 -738926 18725 -739262 -738104 -739557 22749 21172 19751 -736066 18802 -738989 21506 -737573 20082 22698 -738191 19674 -741178...

output:

237804667978

result:

ok single line: '237804667978'

Test #17:

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

input:

21777 485
394750 -211266 -208863 -204906 395801 398463 396673 398047 -212292 -204540 -208577 399749 -212095 -206269 -203494 -200687 -211040 -203795 398148 394607 -204465 -205068 -212036 -210138 -199376 -210474 -209316 -210769 -202451 397941 -205449 -200011 397357 -210201 396329 -208785 -200071 -2025...

output:

53095011709

result:

ok single line: '53095011709'

Test #18:

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

input:

14895 4999
13127 1176 3579 7536 2386 454 692 3740 150 7902 3865 4321 347 6173 8948 11755 1402 8647 5042 285618 7977 7374 406 2304 13066 1968 3126 1673 9991 8414 6993 12431 6044 2241 8748 3657 12371 9940 3039 6916 52 658 3254 12856 13145 13354 5137 5120 3886 256 1254 1297 13164 10306 8387 8152 10582 ...

output:

276810061556

result:

ok single line: '276810061556'

Test #19:

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

input:

100 406684
-461218 757873 610658 517499 529520 -599924 -430197 260235 -89520 -798689 -567432 -320041 -893748 -613659 -863443 -547918 333639 -198305 733463 -458503 827431 796438 -678721 765318 -179468 810416 757223 -275990 -888957 -858824 -644180 146595 759875 921204 -438364 675152 960487 984914 6364...

output:

963015935

result:

ok single line: '963015935'

Test #20:

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

input:

100 299094
516973 -477666 -389445 919781 -945779 756971 -365522 56024 -503200 -469164 730900 994984 724724 80430 972425 482929 526902 72658 -804583 151772 -274626 -245873 -572637 -397132 136300 785071 -65431 -278956 383245 -188686 -284930 174515 70803 -38581 934195 417780 541813 577180 744273 -68909...

output:

697969528

result:

ok single line: '697969528'

Test #21:

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

input:

100 648445
-925670 785588 489337 -779228 -226631 -360593 647188 579860 674758 -486336 576180 -666974 699567 -555446 -322208 -326707 972098 427933 437999 414729 415128 -527544 -437406 996321 950201 459691 -540999 -984108 -518217 -188488 -710691 -242460 520538 -515541 991813 742205 69405 -868580 -4687...

output:

1570141771

result:

ok single line: '1570141771'

Test #22:

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

input:

100 918266
688830 -334956 -458837 863390 -926048 -845551 724329 -117405 -544891 190107 954330 958505 -17342 -594843 -416550 -719069 -514099 -747907 -645722 -648312 -11301 706956 -707817 897432 963503 113321 993170 669043 -383690 -724971 -60605 -528933 -281191 -689123 625191 -535801 -494642 -372641 2...

output:

2246866159

result:

ok single line: '2246866159'

Test #23:

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

input:

100 168599
-975654 231542 -362350 89232 -159660 -727772 567900 543150 -357110 -668997 918873 588651 -647945 -629506 -18076 184007 -401625 -766941 -564400 33073 -563573 591547 -221406 978864 355747 -822290 -332129 -266290 973854 515914 302356 913644 632641 655605 241503 -653550 732193 -941965 -327083...

output:

371478246

result:

ok single line: '371478246'

Test #24:

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

input:

100 271450
-992310 878365 220250 465852 -687027 598539 916825 -522827 426238 -792651 970128 603624 646905 933204 162848 640236 -781560 587212 -122977 610967 344375 -365486 -568688 -244567 80848 587169 -287582 294838 -549570 -302534 -954784 -951042 932654 -535184 119089 -46821 113717 205512 233413 -2...

output:

631349344

result:

ok single line: '631349344'

Test #25:

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

input:

100 571912
-927488 -98577 -107207 205836 -719995 -422019 -987079 -580498 255249 -298418 29899 -392856 294932 403294 -871970 113323 252500 373669 905563 -282675 817227 -567216 385054 -107163 521088 -303739 761611 49116 -436362 872805 653552 -237322 -995465 -196506 -406650 144452 806246 -236154 798954...

output:

1383252065

result:

ok single line: '1383252065'

Test #26:

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

input:

100 411057
-368330 576088 -742459 311054 851821 -576929 -442700 753075 371681 -437262 983794 -199363 408205 819528 -397137 -561938 -586975 182423 429030 -152133 -447126 692014 609650 -965156 -532500 -537538 -796189 82036 919510 -508268 -407856 -245390 737911 953410 255362 -585442 694851 381560 48104...

output:

978754170

result:

ok single line: '978754170'

Test #27:

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

input:

100 631171
-855814 652544 743644 443844 -262589 -518305 451548 -201710 -406409 -646756 -966198 883300 813984 788115 611911 -297753 -979009 -71576 -584298 -911641 890920 -441665 33114 364387 504829 343645 817927 897878 227649 -677139 154931 -599576 -481087 -771431 -114491 -717764 739042 -325459 64027...

output:

1526232959

result:

ok single line: '1526232959'

Test #28:

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

input:

100 469903
247136 -948682 -294088 685611 630421 -558341 -543604 -912462 -972316 264433 787109 -134584 704526 -388947 -52781 -52815 -301408 822093 223004 -786334 -121853 845015 -925907 -770853 905617 195500 -363292 -925497 444955 -528608 -27574 871969 -204413 8072 411974 -294970 593505 -922861 718528...

output:

1123921170

result:

ok single line: '1123921170'

Test #29:

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

input:

100 364874
960756 -333327 615471 777994 537338 915939 -828003 -610985 90003 422792 671606 -231692 683919 -887706 579314 593545 -934165 -379569 -427472 -569722 686319 -474030 -334965 -503887 51284 468389 520408 -454342 -959159 -573086 -461060 620267 -27724 5861 561651 -15558 -589712 977349 -761710 -7...

output:

859001650

result:

ok single line: '859001650'

Test #30:

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

input:

100 252062
808587 -684374 138817 50146 -681293 866560 393904 -697810 941768 -441048 -234993 -257872 -895156 -101865 -285026 374063 441118 -767540 -208094 933015 -504231 -960809 465105 -555496 -365672 -765969 104031 683272 -187388 177267 -76434 -704928 -108379 -145919 -914363 593582 -127473 459061 36...

output:

583616373

result:

ok single line: '583616373'

Test #31:

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

input:

100 421558
243129 -211527 398811 -525918 413212 856183 -534324 -998997 -574399 -417983 106489 481000 274405 -71509 976126 610129 -954777 168184 -173282 358617 381682 -450991 -114629 312601 56053 -174056 -37604 99261 994421 782854 -284344 -626531 664821 -26652 485585 -973730 -528745 -902214 154972 36...

output:

1006114446

result:

ok single line: '1006114446'

Test #32:

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

input:

100 980518
-228522 749947 -879712 -703387 -493640 998393 -238775 645464 -635492 284922 -594620 -619035 556605 998821 -525902 924615 276898 285339 -724750 -887450 -251608 -834571 -480204 -838845 -54122 -137440 -142177 -404425 -928666 107094 264499 625381 372154 -990945 -511247 -332469 656168 -14114 -...

output:

2399645327

result:

ok single line: '2399645327'

Test #33:

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

input:

100 582132
-768327 739906 -484199 -570650 -643834 383740 284119 -912546 106838 885470 821902 -632899 37350 -861422 221200 -268753 762312 -785181 365872 -828392 885196 945747 932845 -420305 637236 -151374 -985915 -565227 -642493 -973546 -276693 -372417 857501 -230198 240591 -616879 -740792 945179 708...

output:

1397499459

result:

ok single line: '1397499459'

Test #34:

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

input:

100 172856
737919 296634 -701375 919240 -769639 -269126 -413187 -343349 -511633 -857675 -439941 926687 780877 39609 -510381 347889 269971 -228808 -489675 -832176 665370 -749501 -253516 467180 -630072 917177 -578177 211694 -295580 -160720 -790583 -167412 462437 638632 545687 -436200 719157 -590721 -8...

output:

377328435

result:

ok single line: '377328435'

Test #35:

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

input:

100 850534
-586899 -641663 356808 -169428 -912881 88065 307435 181204 517295 -229812 731604 -5264 -782927 215800 769874 -852787 -507910 263133 -570770 294650 882594 -45446 -674407 563775 -174454 -208927 120731 414061 791638 590421 -113642 -230269 -585957 408820 -411852 -468234 908176 10809 -853063 4...

output:

2077842521

result:

ok single line: '2077842521'

Test #36:

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

input:

100 565897
-469375 152054 630374 100194 613825 -352771 314571 -833309 -982235 -492674 307398 559351 815010 -509104 -802095 981257 -925497 -596294 -662770 -43617 -915754 236472 -948020 -839076 631501 241312 -892733 -954503 -289632 743495 -398426 -68589 -184932 -804330 867174 -35726 -947857 -156412 10...

output:

1359120359

result:

ok single line: '1359120359'

Test #37:

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

input:

100 671179
433612 104066 508492 -451882 -479742 -823056 -159276 765826 -762473 730176 344667 497356 431049 -347397 -554373 -146842 860077 964570 -705414 -740712 -623993 928022 -44473 262608 -257775 540950 448859 696411 -354966 -922557 897682 -277918 -44833 644770 988670 -192992 708435 -427332 981133...

output:

1631367545

result:

ok single line: '1631367545'

Test #38:

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

input:

100 315304
-570682 26661 338708 -629099 430775 -83624 -913370 170708 -654695 234667 -493959 585681 -764392 -794858 -933770 -572801 -268274 317666 307739 -364104 -69478 544914 30528 -310441 -852837 -753027 706312 648287 -663030 -493645 -300196 -281571 295819 339089 -860287 -455030 204447 -465909 -209...

output:

738406497

result:

ok single line: '738406497'

Test #39:

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

input:

100000 342514
-484735 -834238 437321 -561521 -643167 -751538 -957492 -787991 888380 240868 -931908 -504193 470174 854856 740116 -86459 -196184 -977626 882088 -459799 -994778 304452 -132396 490001 285322 -191631 -40155 261493 82298 -35865 686461 588118 354894 -88336 -72920 -878997 -473933 909753 7229...

output:

856235102179705

result:

ok single line: '856235102179705'

Test #40:

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

input:

100000 761971
820759 -902778 -82917 345961 -834260 791035 693163 -34095 -877423 -384247 320866 -943308 456600 -391893 -107760 378460 562628 -518300 765762 954605 -944582 -411962 -995440 118320 164122 -557139 -145659 969680 693985 -770080 -756155 -948833 -991051 291394 -482144 887171 -771148 -917717 ...

output:

1904877565122648

result:

ok single line: '1904877565122648'

Test #41:

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

input:

100000 421865
596624 -905953 -351909 983578 527897 -162814 -22298 -345246 781881 125472 863794 504121 -192443 -638411 628226 905447 439967 -661491 -231833 -85965 234667 289398 -213180 -213584 783593 -241852 770697 -278729 -347748 525101 -37346 -848648 716030 514434 -427007 378814 356903 914650 28174...

output:

1054612558085729

result:

ok single line: '1054612558085729'

Test #42:

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

input:

100000 666256
-671601 -331999 262725 -473238 -532291 656662 200754 611267 162009 -614545 472488 -959014 -72968 623064 314609 -516150 -635239 -351790 -900327 -60815 -59350 -248007 957724 73443 405939 824516 -429117 10974 217499 -391027 -414154 -418228 -684495 420152 -608012 781585 714564 -513399 8098...

output:

1665589975336057

result:

ok single line: '1665589975336057'

Test #43:

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

input:

100000 848286
958330 -318297 -881469 979626 -312554 215821 -79630 -748535 337014 -808075 43073 644212 79260 987772 464864 3634 4772 969009 25881 750859 862684 -321585 -709422 307806 74069 212743 -410552 891281 134249 -549156 30666 810232 -164967 351973 933646 829843 -350214 324703 467480 -530543 -89...

output:

2120664939154201

result:

ok single line: '2120664939154201'

Test #44:

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

input:

100000 809630
-794321 -600288 -859340 -557503 891089 -663638 572138 -881997 361488 -758484 -974368 737931 -295380 867167 -45554 576880 -892913 -376356 -436390 800013 -467249 619389 -938697 -858118 850670 -168600 -754382 -67080 650254 317352 238540 950416 146830 201317 -488193 418756 -890585 515710 6...

output:

2024024947464437

result:

ok single line: '2024024947464437'

Test #45:

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

input:

100000 41064
822801 835149 859942 -819832 980531 95050 -369872 -560345 -248552 385345 -616314 -338297 -375770 -772484 -366395 687109 -423943 -151896 -310304 74978 645538 -910366 424024 393257 -347521 151926 661920 -458439 646451 198167 317350 564921 815768 -281838 -560580 -413165 183930 664990 -4547...

output:

102610071723978

result:

ok single line: '102610071723978'

Test #46:

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

input:

100000 378532
307468 733294 -266908 -347199 99702 127606 976551 -471673 783611 232256 -402451 32418 946067 282643 26594 -152186 421620 708942 706168 -435069 -136576 -870532 896378 -688642 -763968 60726 170799 589455 150696 -952301 -108271 691068 400172 -100042 713219 -622175 -193299 533613 129547 96...

output:

946279926322388

result:

ok single line: '946279926322388'

Test #47:

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

input:

100000 247200
-400818 -894131 -303706 -32902 -384739 469487 754354 -612079 71723 -122448 -705213 220352 274194 979857 863520 628698 -926833 721801 88439 101898 -764040 -623646 -353234 392484 -955978 -495604 -188132 -10789 940583 -97446 414048 -379157 585156 -757850 508698 -635414 669782 -918554 -165...

output:

617949953129454

result:

ok single line: '617949953129454'

Test #48:

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

input:

100000 847825
134016 510304 929335 43738 -295899 297521 817948 745381 377954 -167122 -462134 -867292 -640387 -862186 404798 -353451 129325 165679 168840 -350910 622914 559712 932439 -697828 564697 277870 383323 -809711 -484118 214031 -110008 687071 995896 -13599 -514980 -424836 314614 437322 -78736 ...

output:

2119512579204035

result:

ok single line: '2119512579204035'

Test #49:

score: 0
Accepted
time: 261ms
memory: 11564kb

input:

1000000 977790
230400 552333 640076 -874741 -66609 -381205 -582473 -858180 646901 -811749 -983826 186581 -973059 -426088 284199 596683 -185212 964415 730017 -964607 -892621 149359 -57335 108248 222127 -714544 660306 -191975 -447207 -545339 -274590 16212 -551731 -34189 -690518 954184 -411706 725028 6...

output:

244446999958749240

result:

ok single line: '244446999958749240'

Test #50:

score: 0
Accepted
time: 264ms
memory: 11476kb

input:

1000000 164876
720246 224755 -665580 659218 -662 71811 347835 -376859 -901284 -519647 356173 -921683 -701743 -553712 964437 257010 -348021 721226 815138 328286 190466 31061 -619093 553333 308135 -657560 -377549 -618590 585551 602049 225548 -830591 -737022 284370 -757067 997295 777815 374768 -493113 ...

output:

41218499835305129

result:

ok single line: '41218499835305129'

Test #51:

score: 0
Accepted
time: 257ms
memory: 11660kb

input:

1000000 806281
219386 -983898 -40614 -457508 178138 -140346 -542555 -444212 -972811 983365 505378 939150 9549 978505 19401 -356618 -626987 -400555 -108665 474262 273714 -403887 -51645 -936618 -887287 -594015 -520353 349244 540210 289611 125143 -536157 -868181 -164020 -906282 -366290 -782178 752381 5...

output:

201569750081431165

result:

ok single line: '201569750081431165'

Test #52:

score: 0
Accepted
time: 252ms
memory: 11652kb

input:

1000000 451645
-921511 -721802 -208982 -801681 187738 -6083 458045 192989 207463 90178 -93912 -988178 -898402 -673489 931036 -641383 524355 -627876 -31531 892836 -720770 123437 69641 -594361 -755664 975942 544448 -705447 203010 -502324 35434 978139 -152967 -853401 171744 849404 -375507 -230305 -7810...

output:

112910750120412050

result:

ok single line: '112910750120412050'

Test #53:

score: 0
Accepted
time: 252ms
memory: 11592kb

input:

1000000 914601
909787 -97803 -35039 329324 373002 864358 -298992 82020 327558 283636 -461898 775924 615662 -637194 -205877 -565818 -520335 839198 315660 -642766 -478975 -368283 -771472 38087 -271352 641747 -268547 340341 787798 -319920 730943 668361 539464 -326151 997630 -77016 965489 671632 -632415...

output:

228649750265798209

result:

ok single line: '228649750265798209'