CT47062

Maya's Windward stretches

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the acacia flats of Thornveld. Maya spreads the stretches 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 <= 3188; 0 <= a[i] <= 1000000000.

Example 1:

Input: 428 155 110980345 835260047 884545569 76671913 858950294 257168160 568871309 802423462 500186466 286270489 138272075 628880374 590749141 939613315 780195334 50733918 232188504 546564340 921469717 366740052 33026258 141862259 713258315 630347254 588199721 424119479 331410195 9173202 116282492 94960707 347954231 201603078 475523406 465401534 966430023 565349755 873562168 339104293 820415895 851582520 399645933 816300668 447072137 489441207 969525097 697049416 977527305 547501258 578589483 679577513 162251690 617586391 249708991 803309138 552043820 748727893 659105330 139293828 349099293 878982731 978577666 366819820 472302716 396831766 438366789 189495611 973209553 470992191 754660408 225724541 971970411 578780462 877415292 467074405 999609015 919109122 989231371 735350303 166711377 16525123…
Output: 71225544783

Example 2:

Input: 1851 1556 63993872 556711775 992281811 513987048 736924387 746874631 540478704 899288109 520570266 650903296 303518129 956194394 729178498 562519038 653146430 516438004 855814786 483135339 915184328 796422898 275496851 19852703 205100850 243453474 364297601 631290230 370506018 620181553 10338139 146350845 187068049 657164432 487000915 964761537 219124907 569814139 771970594 770881821 776036328 219619590 98183317 741579870 821224138 982405936 995602833 716233786 349572770 712548572 760795664 531831143 760517179 954119475 935363759 695158358 585130859 222819639 907798975 321742691 898368048 671395537 488179613 566125365 55454000 274443439 424509821 439339026 790330666 218249432 101345410 792503568 118657408 853917263 79179525 648819477 641591509 446703022 9775022 142538887 927442392 82616277…
Output: 754241765541

Example 3:

Input: 1254 167 623262670 363011628 580010891 338915840 519728829 50081721 418872630 136569268 435079841 62602619 565563187 738678109 407102604 992817839 952353113 640039018 687256604 532749067 506857483 537844759 208511465 779424969 836941294 37289326 976896453 277537433 626627789 14241110 342686307 21906984 804017896 842429710 217991825 210299872 875293719 592656566 413947913 880119767 498146977 409295388 393422047 470285115 795540199 698222183 419532171 31445244 158096984 395786591 330492085 319779347 557366463 722363851 173939672 299373388 186855128 847226390 309114523 471286757 375941738 150843747 773913590 131633151 465241903 233158434 234978986 513793372 582666805 590390295 921401515 576201836 479555909 779234514 891679663 533727889 722659930 668986622 624956324 307897366 143484928 6007545…
Output: 74262202468

Constraints:

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

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