CT46009

Freya's windows Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the pine barrens of Needlepoint as Freya unrolls the day's manifest of windows. The tally will decide the next shipment. 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 <= 2629; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 84 31 477010545 933435288 300501327 133499058 638338717 415131368 51199869 562162410 358549213 989607711 813541722 594572985 520807607 579278827 149074885 976947807 872054511 144261452 861219993 86340017 683680759 320665442 753586407 689702803 74411145 338980761 351067347 617981159 975374633 397922476 263570339 455674285 458389796 775460282 534319888 871841043 749620169 459969663 482914353 204596821 422608381 445760292 422776 126575238 1010921 853660985 282800684 260142872 817014995 74037356 716272430 340865222 603244335 883151678 12481290 234782620 396909696 356570357 -900686 839598441 297664565 359012411 804038627 88019527 226497481 952608668 319677355 812552940 753621213 47958 328238068 607115094 381341327 291075176 603602254 102004282 685334174 449834402 283050782 213483131 896664630 4…
Output: 12485347449

Example 2:

Input: 93 75 724824429 505854033 163407733 211454631 499083388 418263094 227469307 639519892 880735863 527372613 758345604 560538556 599351635 346135981 853059177 144840476 552122403 755722405 241015005 298411433 333265921 787044218 625571281 921620672 595581038 54122605 419176041 710413245 564875335 803131074 609409831 257907644 450871877 310341112 12316323 96598054 451935747 679513648 86724754 861978690 582075585 249916644 632047134 949483874 9591623 803754196 74248033 306246818 209377948 92520030 31683653 904760737 946463969 683415301 295074014 301253103 252392447 607447527 309875197 602693158 227176933 494591349 371121169 785437365 425579983 970027153 762139800 108120194 230742843 885009602 713708179 158662090 552177910 609355192 128835282 699736071 685919437 684635215 -722204 769657023 48030…
Output: 33812968129

Example 3:

Input: 133 41 618215922 878830800 481110479 884485360 433675891 405332857 477337804 649308115 775920303 680417519 479742691 772717804 868051788 381285472 949987870 93448172 234679419 622645209 165940055 121326323 864292317 756112321 680317420 47420137 677554517 302859459 804785415 392029101 334832574 190158095 587724606 330414269 890542979 382325021 784333298 696813333 653358080 93031585 389339672 494343078 516020720 395154930 978546660 82907987 551779689 903548309 280046525 410761658 585641075 126801837 802092751 23337276 704282727 885826971 299412588 276307607 200908425 451167568 403092497 390184611 142040940 905506622 670722548 187909524 454317859 797042658 698564618 18063731 679802412 204782868 5135615 961159764 75517919 800040489 156023735 568968673 507134368 417215558 119755167 179838483 24…
Output: 16606262698

Constraints:

1 <= k <= n <= 2629; -1000000 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Freya's windows Calm Window - MEDIUM Coding Problem | CodeTikki