CT43400

Last panels of Miller

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the moonlit lagoon of Selene pays by the answer, and Miller intends to earn it. First: the full register of panels. 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 <= 1845; 1 <= a[i] <= 1000000000.

Example 1:

Input: 1422 746 264905665 536292545 170290134 347523691 539729261 385367932 577284522 995382534 796895790 393128160 448356816 673355552 213845073 27813463 907707056 809093259 327452011 575386690 815591650 305005576 575886128 894927349 971857986 232513351 115414504 2431568 77646285 543335548 342417225 958494771 175503283 506848237 464243569 700771509 474910603 908618371 784561 319022404 267858979 480050160 909755682 637083165 941474863 6507033 707781413 80655685 65779791 108581995 650632075 372577567 440435875 738980990 607361798 896030181 407593887 502819727 958318241 800547103 662423081 622063104 308030998 923938826 577590496 998759858 868948018 883427132 208867079 631596864 447420637 970339181 297651848 668620168 510795493 492881040 345445854 744361730 75543196 897992673 807932526 32805317 6250…
Output: 362992478594

Example 2:

Input: 226 101 420047291 144765912 689424716 197395586 266171319 467056524 781369029 357765308 754672278 722297864 815533761 947240814 476223499 216967540 109830477 87019857 294492526 735795212 28551610 546183698 524241930 332546290 296669020 807204357 8077806 930952646 166669328 800498976 866288454 436698381 788562441 856531688 14625630 295505214 213285541 706286989 783452643 387213916 720175130 485336703 436502155 747312058 79789785 429233425 704466090 531247643 501016 652488558 842395733 231120122 142752804 952530059 753715037 690258220 836711793 284214329 494468095 957155530 635410285 993375753 274186028 805686196 879615210 748655041 819902964 524178897 241748194 65859831 632334607 457980358 13041901 403642618 928665019 374274024 101249945 92964843 292303279 338197029 643643466 595053329 9094…
Output: 51305034064

Example 3:

Input: 1801 1697 148043837 463874847 943059972 538737942 159206666 531383024 898486266 576062706 876102219 136837247 319989450 425932885 790858584 323484274 86752323 581613922 983427549 180086906 537272548 17728337 697165800 200835581 935082049 866952068 229790343 317543927 987729442 951597339 965546648 280481486 956959642 41706151 39438870 122202594 26273214 703032715 993575343 309873708 61054436 349441106 376162983 823192900 544554543 426096605 42152290 43830239 610173183 185615107 121364068 993410715 779149704 674496983 474747987 504018235 281986843 408392820 176684407 595211553 539065936 779282177 793186467 446490812 411323561 946248109 136913842 920566950 305563396 104774662 343375886 27768010 492658191 344411764 604704661 661247498 872611264 40978475 109897211 418517838 399072677 751690940 …
Output: 828567125983

Constraints:

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

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