CT48662

The Calm Window Beneath Fungaldeep

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the mushroom groves of Fungaldeep pays by the answer, and Jatin intends to earn it. First: the full register of segments. 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 <= 3378; -1000000 <= a[i] <= 1000000.

Example 1:

Input: 2782 1110 -564863 660526 123304 -625620 -337928 658033 115221 -202842 -609533 715509 672773 446521 875354 -341958 690429 -491859 439963 769263 -469739 -673790 -384407 -960661 749383 -940911 -38789 363775 -507265 71496 58436 -504804 -190842 738570 -561989 107880 -188637 -359069 -421966 -80739 -1545 -487045 422338 -875532 256200 -317615 -251205 659221 285797 173582 659621 207226 -722792 -573362 781389 317819 -824930 808902 -601201 101484 45359 -674684 -667897 -944889 953219 -543504 271224 516670 -412909 -619235 -521142 -921920 -723429 75200 -244060 712131 -224779 -526115 961478 -412046 510521 545599 886975 964297 692021 -533380 -890680 -384435 -816215 779314 -839450 294177 -50151 625032 -314163 -340980 932648 774030 -874457 -290121 251485 13920 134762 -441517 510030 -193005 -782822 -767074 -…
Output: -41860124

Example 2:

Input: 3195 766 326210 312919 794468 -576633 702884 -416606 -277255 520598 -910596 325029 -648033 -396471 839691 71678 -76318 201966 534008 -124447 989498 383420 -760150 -63070 -664809 -288902 217045 899288 111184 -3151 -399605 -742744 874290 -418331 -348627 735409 -634724 853391 241649 635377 -265864 -627573 -363768 -684674 -890123 -637237 686896 -349152 -575821 -986647 -717104 -425037 -753304 -224422 446633 188203 325144 -536797 -378391 -974977 -90656 619898 -351104 -591578 -456189 -895932 922204 374279 318623 -696077 477050 -353763 23307 -171647 -817670 -900718 7767 937086 -517581 239589 -416145 356845 -864456 221644 948706 -826300 -341615 849022 -186150 487324 923183 -120355 -77511 252251 -452196 272425 -568080 -533106 -694098 -55298 -280241 369650 -368649 649905 789351 -945249 789038 615177 …
Output: -29162420

Example 3:

Input: 1936 541 800582 588298 -967768 449373 721603 105584 345675 70556 713956 338197 -645111 -617952 -560416 474207 370179 55432 -303594 459082 -1379 -464050 59618 898489 -516944 763021 478932 131299 592039 856768 353339 -974712 320973 702000 -636911 80812 -630832 -25235 548263 961485 986480 722096 -496246 867665 954796 -684573 -539301 -480397 182812 227036 -323907 -662931 -85717 -196507 340312 400564 -160141 -647022 -508081 126262 -624317 -976859 -840178 -849503 -372108 -873097 -901241 -111217 -886009 -297944 556497 864399 -724035 -673317 169504 261923 985887 -295052 -865184 45997 266463 51162 -954279 167382 170026 947780 213686 769744 -508518 512282 154296 995453 -194142 385763 -36097 835303 232203 842088 645783 -43375 -396936 103037 -617905 -679022 691056 -904649 -115019 -741823 997506 -11173…
Output: -16810693

Constraints:

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

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