CT55561

The Calm Window Beneath Tuskmore

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Vesper the accountant watches over the boar woods of Tuskmore's stores of ribbons. A careful computation stands between order and chaos. Task: Print the minimum sum of any contiguous subarray of length exactly k. Input format: First line: n and k. Second line: n integers. Output format: Print the minimum window sum. Constraints: 1 <= k <= n <= 2854; 1 <= a[i] <= 1000000000.

Example 1:

Input: 783 327 821943048 311092242 664754191 932790343 94074079 906887213 359817980 637552098 643108315 395908114 971999733 490691988 752248013 471157282 225739439 159313784 3506246 142539263 830944954 912150215 743377331 131927493 334962811 326668458 630312392 788541575 915579368 454195615 634104753 861275378 575219059 690350236 342043619 557818792 455557793 28763231 412841325 720591759 21072711 468154605 132243854 819124508 157858080 750380017 991686829 758481707 949429619 835640621 233639281 628254592 621281351 523685321 197878468 995502141 85834642 620214605 3713874 978702981 102084909 99240779 160731955 533887657 414353461 540793324 543246895 921838054 830303037 525229811 442654432 341510856 124542384 349061842 316386065 178373609 669470552 389975134 355561429 738417496 498080483 217427136 2…
Output: 156757212368

Example 2:

Input: 1244 362 523816241 117918451 343863553 193502913 14338216 806291539 75408626 340884837 510306665 44698073 427928796 639128000 681007000 21762585 688016704 297954628 634575813 248071369 950194142 124810215 590779856 336933515 339551694 729084330 786879312 171181546 98652356 495995484 741174814 904348906 914601573 514160866 339044180 177363687 134823725 391704974 743975020 796514700 398649741 101101798 5386006 713058224 349603503 92120445 707381667 451402711 5874139 541075168 876540403 61161679 983943049 517216225 351432180 113745525 326135475 685407335 586266211 726869342 439956691 175955223 199526294 497110246 362783051 487395520 32906624 180258062 216700911 69999586 71848343 532789885 990351914 110239822 627745849 893734373 259921199 867930667 109296742 126210624 537724444 623078334 72875…
Output: 172863324956

Example 3:

Input: 855 842 159715288 748515469 69400808 737263769 579698587 208748707 921704769 995620708 293976798 605840640 935167123 71765750 313849869 965806811 595242754 487183193 687712522 142727079 478724377 189818436 988901434 727871046 821099207 628381810 844007525 371561838 447156898 298160678 852683763 322115212 783047456 500274827 704597259 272973264 394330222 821441462 825799315 433167448 255776236 672187015 981014138 981526951 663003682 239803587 606414157 135928362 875071321 939263321 660610084 574127684 472259067 297077080 538546684 138771781 134518560 447707224 305993642 187961760 173703407 606222245 7933428 582908829 805554319 939799558 522972287 17162337 532299787 264590482 259465843 697774947 923130470 468560235 867244945 805442466 514674490 692805543 300531432 527898601 523240451 2506809…
Output: 421038362080

Constraints:

1 <= k <= n <= 2854; 1 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.