CT39100

Zephyr's stretches Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the herring shoals of Silverfin close for winter, Zephyr must finish the stretches 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 <= 3126; 0 <= a[i] <= 1000000000.

Example 1:

Input: 347 7 132269239 791782540 728332754 785097223 139066350 656105618 23415458 287719090 778208770 624033983 483215356 435734522 563070869 806239183 723768218 476878508 112387702 409380232 945778962 872649223 164660602 693701602 489383414 900124399 736578991 135997864 312111581 655065592 581662102 383315212 736249526 284195620 206469040 238185036 124828341 47573344 258118091 920782309 435478598 372898799 623659296 26351694 807360546 694253706 150448254 566070531 363476995 57063627 731762794 105880676 645542895 995309349 308958958 880094176 78845593 964592881 400901988 710460736 677284025 898408548 387683723 812115370 949136505 88654581 247973412 737039952 426839461 221578404 936362700 486506668 433008088 388471182 401104348 222145426 853928544 971014195 162307443 955386752 35646270 311806350 7…
Output: 1250832330

Example 2:

Input: 773 525 883891027 504184022 394929532 144399190 976746143 663242159 140099104 380387063 46418468 439586410 158990491 548710354 629796881 588609356 53585558 654276052 803761864 573886567 556258713 330112418 268508044 338388277 331256872 969878560 725100753 184040535 678046779 110486707 892012859 62818427 631511357 509795164 267016417 190900919 579067259 202766599 188145324 388830970 428140083 636668772 50048250 817318594 319173856 923748754 449399205 55612367 795820161 726014987 506705107 884886300 586455031 305135628 270323201 700480363 50087919 656286700 813998915 512688229 720869775 383909414 92344412 684657403 247663607 851932007 130914132 135174610 386162158 114940628 726768397 358820437 139086780 323501852 933705783 467077015 785601795 372289035 308644325 911292506 635656033 986429549…
Output: 262226529781

Example 3:

Input: 2258 1296 257504968 160022038 404294955 952183890 354976590 682071414 25213580 712905361 645379176 242790626 506542225 776361532 775164279 318622161 356285926 503556549 989663567 428459664 867223702 103113170 62496966 352336325 291582828 64856595 20336169 122207141 786244228 296070806 280898695 338826545 181772784 137196480 819645407 249054107 559729863 874090010 29198953 541469429 216183809 294889560 206010963 158454777 80828275 975189965 467640805 200280567 788768957 958463284 985965432 958638695 726794647 332389998 634302045 937647216 875041192 111358519 855686973 99316167 608021597 79934347 58932754 496433291 895561573 422215129 798048723 439690660 367583229 189013090 386995817 391901778 985503237 193982866 126163409 698997981 651242090 201128201 64298575 697042384 8640106 673942908 10…
Output: 611783083640

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Zephyr's stretches Reckoning - MEDIUM Coding Problem | CodeTikki