CT49758

Dorian's Ledger of panels

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the smokehouses of Brineport close for winter, Dorian must finish the panels 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 <= 1683; 0 <= a[i] <= 1000000000.

Example 1:

Input: 1489 391 215375978 484801038 801448518 400116782 882516751 330143606 268735091 494495254 935793476 840330609 692627216 463234736 421794809 405352626 640137385 402270717 199303160 676010166 910728770 259956753 634865095 382951987 623856611 486270681 638522288 318419818 629434194 499054534 851796416 592846205 314225387 624718579 456617132 927904572 91074823 763591505 639732575 928353100 458887704 668432526 991475137 941445316 861278002 811161303 362617305 625284167 205717868 930651947 412301774 467167177 981732873 515321263 360141559 970896836 330567673 847412501 714280657 209892874 471427284 286502750 574742389 570955046 611960554 779472426 83217726 883981192 330356343 977247989 547764358 801352480 858274961 62731620 255428291 355940865 292836322 667557482 320278616 380944885 428775719 2031…
Output: 184536987167

Example 2:

Input: 619 254 922417929 458002916 833304290 744603976 125028039 210779155 330925298 974799567 706564843 600309165 914728727 224302430 81426039 118998716 977488122 643843331 284770329 188413836 196988095 664870411 841340539 232539073 379242970 276163525 887436196 59160879 700065031 985759749 156401185 249342791 922880434 876881884 358551918 595838176 247099977 100189506 190992557 770190126 812062835 764111032 539112890 53145281 428331131 166671692 567025645 237959317 332281587 84877523 787496502 618946107 920062574 799480290 338426918 270033635 695086926 821063345 41815922 359872352 768876757 670170640 519722248 381533208 459706351 84995360 463260619 766565528 897733507 833371490 122592067 246907547 320606559 849873585 326559990 540182371 803091647 696341531 512557648 743997408 552835033 23544465…
Output: 122776635332

Example 3:

Input: 890 27 683302354 381193977 849195813 403751432 986348704 542113572 396803181 103883542 373923761 205244603 658844414 846628624 597214813 332289408 501415997 845215730 579148511 821596121 651320499 784989507 25688808 463498055 621727486 875722820 625719268 927125232 569803621 873416276 206566188 669464172 22466394 67838507 546666185 94449950 493969015 65342602 619961744 36904606 570873978 567279641 824514409 618748824 765786614 245729893 841661938 888183623 804073753 63102400 201389529 650537030 649066485 369810390 725512233 241565876 107114535 294322153 444363647 848654136 887662165 72907448 993816600 386822765 973256270 286717572 695277047 592274918 833121847 187799285 96558217 88372429 113810623 458393555 83501551 130481155 919660439 224550971 158111983 45543145 737140960 190732983 18073…
Output: 7704758555

Constraints:

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

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