CT34167

Last windows of Kate

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

It is audit day at the orchard lands of Applerun. Kate spreads the windows records across the table and picks up a sharp pencil. 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 <= 2976; 1 <= a[i] <= 1000.

Example 1:

Input: 1476 617 247 786 930 431 911 896 925 576 228 642 314 310 449 120 759 417 3 270 168 927 967 257 269 745 507 566 586 407 474 156 351 723 658 977 83 421 245 869 673 717 386 156 988 374 134 782 788 20 236 603 469 721 394 530 192 379 187 925 328 239 851 60 299 478 938 564 292 775 920 352 117 716 467 993 534 632 78 390 576 659 905 72 168 861 947 447 43 44 832 958 275 768 250 965 668 350 438 15 275 587 997 822 248 167 893 545 624 212 945 212 156 609 939 687 100 541 443 682 5 802 884 419 189 805 310 976 795 768 111 803 52 695 966 362 307 972 290 769 203 522 985 567 966 991 78 75 910 674 502 873 742 236 601 611 594 412 939 834 158 783 8 910 5 429 169 296 328 683 312 985 755 499 714 624 428 778 882 839 910 789 612 26 7 553 953 661 817 877 355 619 276 400 761 363 714 242 324 203 402 393 803 629 19 81…
Output: 297134

Example 2:

Input: 1614 141 738 890 549 136 327 606 2 849 534 994 395 161 625 536 104 169 39 948 529 40 843 434 455 631 636 465 924 855 313 859 612 131 828 190 972 821 306 771 785 219 482 699 438 356 562 140 121 617 702 385 350 158 128 244 728 613 140 766 727 746 963 685 676 547 758 100 50 572 309 672 945 816 866 860 953 24 366 78 712 994 942 293 541 310 505 262 156 148 609 156 359 246 648 226 76 351 509 30 784 34 36 10 257 641 408 647 13 777 975 149 808 731 318 192 274 485 588 857 703 776 687 724 344 408 22 864 616 818 82 133 137 491 451 538 979 917 664 280 684 802 902 683 643 803 201 755 198 95 357 373 808 923 516 191 565 936 761 129 698 71 871 483 711 320 731 885 234 619 807 755 545 185 878 961 234 38 301 4 85 653 342 960 991 789 590 302 323 45 682 536 363 794 498 694 541 393 85 653 536 245 922 175 916 10…
Output: 65217

Example 3:

Input: 418 333 892 476 865 273 564 104 629 821 932 391 614 435 5 252 971 138 321 157 981 901 795 710 256 473 316 681 829 408 764 860 86 488 770 501 842 669 229 766 535 577 397 724 122 644 907 371 579 531 616 977 903 270 315 14 372 910 653 220 304 219 675 352 94 123 871 574 461 668 278 65 157 988 286 953 567 411 195 941 369 130 395 53 550 768 622 429 408 760 610 330 406 13 183 442 1000 604 583 740 17 24 993 670 278 139 104 11 449 649 574 951 41 221 385 451 553 819 519 325 580 289 391 90 581 853 527 194 87 307 437 484 720 113 545 255 546 956 856 642 969 211 813 734 184 439 55 369 214 440 851 790 796 439 644 346 922 539 751 873 609 494 655 702 863 867 150 260 831 129 959 400 165 682 256 319 230 166 460 618 48 545 859 783 540 382 393 495 611 992 904 332 413 682 425 413 407 148 953 490 750 967 590 777…
Output: 165417

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last windows of Kate - MEDIUM Coding Problem | CodeTikki