CT43454

The Whispering Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the mountain city of Highreach. Lothar spreads the stretches 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 <= 2620; 1 <= a[i] <= 1000.

Example 1:

Input: 2347 1255 464 952 263 220 227 218 680 516 475 838 885 45 762 505 492 807 426 384 658 310 908 388 541 296 219 261 389 327 414 596 409 281 308 947 407 507 294 767 562 563 852 685 824 874 202 95 756 589 126 27 921 302 9 535 716 406 739 467 894 645 369 236 715 689 991 445 848 227 184 783 526 785 578 714 180 18 74 857 180 690 643 366 969 132 220 741 391 412 986 526 956 49 143 352 759 126 466 120 907 851 126 425 12 775 625 46 723 157 292 266 322 248 713 283 286 75 239 666 118 894 96 909 285 790 451 959 120 833 987 285 499 655 692 569 514 261 72 867 631 291 129 27 125 560 333 829 489 918 529 780 989 25 207 173 720 857 754 514 143 71 857 899 216 601 745 998 191 907 310 333 189 15 823 25 861 564 381 177 357 935 408 774 18 194 547 436 629 856 671 687 914 739 518 571 206 681 808 378 113 577 713 87 68…
Output: 622703

Example 2:

Input: 562 353 854 466 946 673 859 891 812 489 877 771 959 836 779 278 651 404 30 397 629 965 229 770 299 334 406 166 561 356 703 951 576 887 152 460 257 855 933 866 544 327 543 731 87 702 423 965 209 655 901 198 896 590 705 9 214 755 290 727 349 577 365 604 52 669 423 486 297 129 721 661 62 488 955 299 900 932 317 670 832 199 723 370 268 412 308 364 181 133 267 83 405 703 72 919 866 668 990 572 30 832 533 224 584 548 775 961 759 408 522 241 382 466 765 311 601 996 535 699 765 885 350 198 85 944 651 704 153 515 241 682 592 396 648 281 277 206 20 92 852 913 227 222 201 855 401 929 5 73 636 105 91 555 214 405 940 969 961 55 771 527 407 673 355 937 268 798 267 334 760 623 25 806 535 996 888 743 309 577 752 687 755 86 110 518 443 313 75 387 272 605 501 226 398 385 480 631 5 774 428 566 282 45 755 77 …
Output: 166616

Example 3:

Input: 1621 1045 618 225 427 484 277 469 934 325 715 284 128 63 696 119 249 964 416 99 327 410 337 35 533 203 836 935 810 767 374 474 45 413 675 816 717 812 997 136 470 366 19 504 811 51 843 926 420 799 55 311 45 496 401 925 24 5 233 257 32 365 516 246 818 962 383 654 383 641 59 324 641 74 229 251 540 712 159 131 91 251 182 453 572 731 436 709 621 796 880 184 678 409 597 257 200 454 620 273 130 313 516 843 88 957 615 376 26 941 627 925 602 432 234 916 734 545 986 18 814 231 298 556 776 178 18 977 705 590 828 322 819 565 967 251 481 133 781 379 890 985 348 402 407 919 680 599 976 115 623 810 835 209 190 521 94 769 801 162 49 294 889 637 554 365 178 420 418 602 413 242 745 350 331 341 395 898 857 709 667 795 72 177 474 393 686 164 812 216 327 380 408 229 988 509 567 501 88 940 324 22 311 271 27 617…
Output: 511911

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Whispering Calm Window - MEDIUM Coding Problem | CodeTikki