CT38695

The Calm Window of the Honeyed ribbons

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the valley of Misthollow. Vesper spreads the ribbons records across the table and picks up a sharp pencil. 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 <= 2738; 1 <= a[i] <= 1000000000.

Example 1:

Input: 2468 864 759149545 652879179 726288177 933462598 90297461 575446629 762891915 392196264 826039924 645405754 27888234 200427800 212560447 235718296 991041468 367751977 839139062 853982739 405810793 90600183 954520756 749934522 524156124 96147295 45145332 59039999 49547223 498794474 116472262 940067668 507870993 111659061 907163227 56650478 817219835 37395287 815831968 600641209 309970669 691557157 397235456 457189255 524984784 425622809 50361079 477920562 95031836 937887248 752350571 608562969 149611322 477656162 417520102 69144827 616287460 632207716 635415772 828529886 696269983 647282304 675191024 568114448 487617633 566219299 907265782 935208940 848432170 442312249 357325277 404811483 40419145 900038630 598145235 300099124 612393593 784146528 931359285 591832859 620896590 933222618 2775…
Output: 416335043710

Example 2:

Input: 2280 2169 549474458 763358645 900365484 698174965 674916372 355737828 435945395 817756657 358150982 194854172 559228682 502868812 413465483 845599270 585641209 918564391 120996870 796704323 621956596 717125954 672388694 48385137 866856211 19671399 24232126 552523626 398867723 509654527 349697365 806440328 155420506 593526882 271525031 869977850 512752076 637046810 695599706 374347424 493888315 205037871 935262106 552847093 348305858 369413605 211379021 333640396 944066966 634374105 597076523 188140567 59431668 729249842 727669517 211622317 422778987 893250062 634127877 990194173 35996009 265102449 582763563 612495683 399754141 477783268 963344733 832678176 266013453 501135273 909156584 774159645 423871778 463623513 949330323 297432361 876883597 851707541 914496931 370312543 276267314 68942…
Output: 1054457057027

Example 3:

Input: 1004 637 899296280 72092628 739220170 663555501 849759142 147617107 946753549 28008096 755246708 529848835 308856737 378312044 451245047 754103593 795389895 45706120 616937938 548471925 401229413 720478178 721260691 996611041 367454544 69231665 564781765 750850689 814193975 722342026 497453707 801844860 403579972 181233895 264331081 125558540 921063959 412892250 608465290 680855681 504553610 536533329 603887735 874044944 978789289 834995597 119298190 234579548 562133742 917830484 863196182 585296151 501409148 144184384 514511601 540897895 209777243 117457526 83824483 46267838 548785563 812055086 420376199 34793002 248824 768170251 171031346 584519338 459509111 539864161 205843469 156174923 649515757 963601359 388549583 434317825 748015454 719178791 378583549 558549498 41888741 338781852 26…
Output: 305633967884

Constraints:

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

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