CT37793

Indu's panels Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Indu inherited the apiary at the observatory of Starfall along with its curious bookkeeping system for panels. Time to make sense of it. 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 <= 3666; -1000000 <= a[i] <= 1000000.

Example 1:

Input: 3285 2406 -667114 20063 -260194 -762134 -398635 526727 696975 546758 320058 -893234 12192 -457041 75867 -469823 777203 -540532 149078 -694824 -231112 -465804 -830028 440949 -203193 -712745 -809222 988480 -675718 -456969 750790 -61852 116097 704736 -445562 -234090 -296920 191159 -258344 -35129 265098 -261541 924392 -435089 -704760 -449752 -331648 -149130 -112104 563206 388200 -146282 629811 481125 29772 -378870 783217 728402 -747972 725711 908183 -674304 -327162 966722 548843 101173 -515973 -497822 112232 645666 -73023 -916914 536680 -499800 277408 -8878 -391016 368867 436771 -942035 -972014 -775971 -685911 189730 -52066 -834615 478429 -566495 -455739 -52419 -68439 476375 -565799 -704723 688520 743640 340180 927117 -603093 803380 437830 -482527 455970 -655703 487029 -390793 -35220 40754 674…
Output: -41960929

Example 2:

Input: 342 274 806322 746713 990248 402203 -396817 258400 -191856 -953331 -596642 214094 -271528 348118 172855 743932 -21840 -110081 -572986 -278892 447788 443622 -416208 -896518 -891179 139550 -114363 389077 -504682 -758930 825518 -53851 848705 -428893 -770528 242181 229483 806814 512781 -971823 -77411 -457650 -113663 463432 492640 496517 -707631 130954 680922 -341776 -845239 758573 -99435 278715 342164 106694 -696651 -306251 221191 -796657 -498720 649500 301412 654832 -165279 -610278 -668355 -382903 905769 -165433 809154 25347 265779 565501 656311 269814 165294 916470 -976708 761398 558021 791204 -8283 -825865 -746362 961958 284782 16281 229936 -466783 114127 -440177 403304 -82648 -662416 -79560 32006 -74342 5993 -672379 -836329 350230 -29076 -329880 -304731 -638943 873814 772583 -216431 -57943…
Output: -6199843

Example 3:

Input: 2029 304 701149 806563 -71977 706987 -779534 201537 736923 -402177 519164 35744 628953 -22559 -189822 -982399 -219650 616099 640935 -69175 -248756 -741634 -984066 232384 -289692 558911 472720 537453 409858 50599 -733695 530005 700233 431074 491226 175969 -413675 292509 44915 685387 574227 636864 543173 526893 -67143 -759140 59213 -400573 908668 11764 -652108 -570501 194679 -480118 988059 658515 937135 166496 -842496 -527832 229753 35942 419046 -649734 360516 8136 572910 790158 -594135 166369 426856 256067 620739 -791507 376398 816704 158041 -401752 -78160 663218 409268 -73672 -564809 750285 -949403 -864205 206349 454648 338853 263706 763544 -329082 697743 -153789 -264229 -164613 936450 495806 254561 -799193 776481 392752 -40490 -88184 328074 993660 -404902 -132962 -956063 3943 956325 -5609…
Output: -22839921

Constraints:

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

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