CT29726

The Calm Window at Rye Hollow

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Before the gates of the gristmill of Rye Hollow close for winter, Tanya must finish the panels ledger - one figure at a time. 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 <= 2083; 1 <= a[i] <= 1000000000.

Example 1:

Input: 1019 164 356155774 283126327 542715638 917588244 676369077 719315485 927000963 301777478 162816299 640244687 832696479 138157473 88174369 929972639 849636488 251881878 150779599 508928237 296557245 581204389 619571894 668972192 72704558 541875101 499942997 804246299 15544282 69423283 151598070 326922559 934441854 38427276 29590839 820252126 906585254 39410111 496664699 137795558 642431591 698622022 908501056 408085821 404183781 795499583 305189833 983216161 18919448 227176704 37098683 293590395 341140650 982967204 832890479 401226809 813691514 685281861 154009398 501577695 107187409 508287137 388732182 388250737 835210856 300971406 44420273 89839099 831058458 357892204 466304286 255496249 150288838 766732731 401675666 257215485 957364501 12781964 483908148 826462159 200898940 982323434 794…
Output: 76995613742

Example 2:

Input: 944 236 705703940 59257400 402458351 161100652 271170447 184922536 590800664 163200330 214228097 496998312 88794503 761664080 686158686 913108570 348374203 895362277 832580301 376552887 697451182 553028910 646952405 233275132 101497847 251700743 135314753 168341592 429803008 567916703 783435504 936135666 922385042 345040452 668100372 1500836 547915199 511209985 406799364 984761315 315080191 308310990 459380585 124268569 505484583 329887303 122714021 191483425 384833915 171289424 811377870 339632689 736703540 623687329 414270035 478968984 155144537 131971905 848627435 703751945 191853137 329486364 491516938 609318014 811279203 435661939 738927365 824827419 163285893 268048620 680341596 849076921 733261164 11169222 991241822 243063017 289348197 217339209 842297221 563223997 932663 132505151 …
Output: 109704271872

Example 3:

Input: 325 255 111402995 998530406 147217913 881513230 645095582 413583949 109133996 359991922 72018387 470238578 216452560 182346450 102714621 453545421 555555231 976756477 152323283 357672688 839117574 809720898 201938877 465789040 953118874 246191899 50541522 62332201 910275466 978619386 790885837 702812086 977486480 538189745 311271238 248034740 291024636 193299689 361330817 407333764 97151939 933872399 394622261 902927944 853284014 595160113 98507250 874409675 955296875 736411823 565496492 275034618 985930655 212497432 852222916 335068242 182460041 544657986 700699025 942587119 151591702 505378309 186758677 193242874 440000553 635341306 556015510 55429512 904469904 192606783 105506973 511370532 789560418 899105991 115353661 379711366 255826368 858104106 120942529 126509369 326346851 87049358…
Output: 128011540784

Constraints:

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

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