CT41849

The Skyharbor Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Legend says the vault under the floating docks of Skyharbor opens only for a perfect tally of panels. Zoravar means to find out. 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 <= 2176; 0 <= a[i] <= 1000000000.

Example 1:

Input: 1958 994 153966936 762177239 110242980 56156899 730308363 118903862 257236990 587074247 993706622 606733338 908206551 545812713 206827955 588428723 949574884 531736363 858035494 242013081 490318109 338147859 387896047 407720482 306743886 100334915 363902151 8426899 350579166 356871820 339822548 352615350 900155287 331301628 337316155 768030868 26602521 133185871 510164846 634687222 785981193 134757155 590992322 507536023 754810231 824357979 80179827 686620444 178567844 735661536 37134735 538861218 268591679 506403517 677633517 909916057 686392386 314777697 707105585 405933986 817682972 343279070 494488140 596060742 178989923 632123352 478694460 667923052 135338521 78825456 173751385 186582135 857313985 98577965 988294760 810327581 281239090 228929752 317999275 897892105 393658542 884970282…
Output: 490830783256

Example 2:

Input: 2052 911 91564072 262582243 482282817 946415608 524891127 293927224 899666999 118105605 998224212 887942924 954323611 415269957 773395183 61716260 681947974 467624451 514532599 875144397 309137266 931168672 686671697 419676156 541716394 240489046 474767236 458318906 909963799 780363522 426823026 24741054 378123874 227194159 325117863 368534053 873535605 172614904 878344265 73812713 95978336 265089581 856884372 765627977 682062930 62444585 796172177 160107141 894587924 871932559 786784281 212969316 471322611 61044403 961051109 864487608 833006204 680968272 310758136 432001821 424601636 719498220 69852854 139160037 314551030 891403244 680414073 778520637 749013942 803748506 506922663 388021099 728233160 208404001 172576076 653133619 462400763 398775459 396799386 779283026 828115074 637333219…
Output: 458739752167

Example 3:

Input: 1022 61 574305344 836613695 109867624 689871196 587860193 524544728 724290083 779648594 718757532 101756253 79811662 826768339 306962344 483952071 94421483 119924005 333466786 561561123 990588025 790322348 445449210 930977101 314268929 418537782 949208348 264166303 481606578 118964634 258881405 926231775 222349134 214499410 278712110 715873499 459325790 940356442 634801324 718654790 361686702 801543429 593843173 484659867 568700122 320550407 296424160 428461827 244391944 236975868 144937962 776656453 438511944 646558848 219075811 495676866 41824647 644856512 807854912 592585401 554799140 530873663 997015505 935450778 630238423 998853129 52659100 38618335 865032897 144674866 669837162 999305698 564334438 815176457 838680814 129029572 346518150 33029517 920367428 823427370 9744572 656831473 …
Output: 25365979693

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Skyharbor Calm Window - MEDIUM Coding Problem | CodeTikki