CT36467

Clerk's Calm Window Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the steppe camp of Horselord Plains pays by the answer, and Clerk intends to earn it. First: the full register of ribbons. 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 <= 1090; 1 <= a[i] <= 1000.

Example 1:

Input: 811 603 936 343 578 214 465 62 314 18 371 842 445 10 342 703 952 230 671 234 434 267 308 664 230 836 770 673 696 620 325 726 874 18 78 895 900 649 170 779 859 811 734 83 279 501 499 161 618 776 302 262 887 383 185 205 536 521 717 440 865 427 581 847 946 936 579 899 799 730 199 894 635 679 569 370 72 412 47 984 884 555 278 909 253 237 587 467 302 203 916 556 878 52 282 752 170 600 891 420 308 462 907 655 540 641 520 876 226 412 307 280 454 491 95 718 34 425 36 966 30 296 732 423 908 718 889 129 978 850 817 862 334 689 989 485 599 372 518 109 82 278 519 481 710 704 188 152 994 564 768 537 817 803 231 116 894 341 177 691 173 553 625 561 13 182 647 780 429 317 798 727 763 292 194 129 812 562 530 673 660 592 278 228 731 618 155 33 804 12 13 842 512 280 137 343 713 793 231 974 906 173 173 879 50…
Output: 309299

Example 2:

Input: 413 74 773 317 409 261 779 746 902 650 768 780 271 449 16 150 546 515 204 212 939 953 110 677 634 32 893 724 931 404 228 418 197 947 87 4 14 88 100 740 556 542 430 187 65 541 985 115 301 638 399 681 239 475 393 449 389 937 884 800 684 431 737 616 352 848 354 656 350 475 808 53 769 603 808 103 753 437 861 18 655 739 998 969 991 430 795 222 240 937 511 973 799 42 369 46 713 490 734 538 548 563 418 779 970 655 589 809 319 776 60 725 921 550 837 610 915 494 241 359 308 306 171 744 265 100 650 837 248 809 820 488 860 157 214 453 381 680 801 114 368 627 454 438 681 103 214 236 392 3 53 171 322 116 194 627 28 984 739 854 414 595 924 236 558 81 463 236 618 182 913 94 845 285 15 472 962 133 266 71 216 120 810 739 145 217 365 523 790 537 422 762 291 767 809 167 336 730 516 526 366 10 906 885 274 629…
Output: 31351

Example 3:

Input: 535 406 612 551 103 643 648 508 557 764 335 457 895 219 8 16 258 913 420 271 941 657 614 886 848 512 652 686 35 374 513 332 462 545 968 876 406 295 25 870 297 915 630 74 116 207 509 233 489 276 17 71 5 944 539 268 835 953 263 274 543 996 793 92 33 278 727 253 512 581 619 920 421 517 574 82 615 410 178 22 48 987 834 640 71 195 976 653 164 536 883 333 367 886 392 603 764 742 915 154 350 731 432 631 853 73 970 350 577 567 473 726 460 68 114 963 425 683 469 418 233 291 969 675 221 642 359 662 804 524 163 842 613 694 225 95 538 819 807 830 43 506 862 992 501 78 398 960 140 98 479 895 222 131 773 303 364 306 326 981 774 863 741 83 791 144 132 387 177 796 775 274 182 177 674 484 307 687 331 658 234 477 429 825 204 780 512 427 361 184 929 500 75 688 452 304 47 103 849 279 287 162 879 319 716 562 1…
Output: 196261

Constraints:

1 <= k <= n <= 1090; 1 <= a[i] <= 1000.

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