CT53961

Wynne's stretches Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the savanna camp of Amberplain. Wynne 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 <= 3533; 1 <= a[i] <= 1000000.

Example 1:

Input: 1040 808 144619 360607 347940 531890 180419 224060 968078 490133 353366 480806 591210 789782 336049 724933 376005 427507 267497 766881 102270 919648 473579 782899 196865 238263 190603 783478 703798 731679 735674 993380 381648 794108 595597 182924 413119 353036 189541 184561 52120 193476 756676 72327 743725 759833 151458 457765 264092 104431 65434 996317 502828 430768 644895 315130 991081 747680 125286 164267 207733 734457 8656 729911 765037 979850 568456 272659 249447 966793 791716 536167 165474 942669 792334 20449 751040 184036 25249 328303 262567 789161 64747 869820 973085 196049 259487 971253 135278 485748 140466 393661 776050 165690 509019 620442 498177 433298 249065 421062 983061 379274 12811 366367 857545 70739 97383 742605 843245 838204 297764 730007 200613 638485 318526 804853 5272…
Output: 398146151

Example 2:

Input: 3033 115 978036 821722 715675 153428 955821 368914 570205 374791 834132 642714 830764 957946 269285 539770 986378 387126 402587 457542 29087 424172 664231 184800 140713 712180 609463 738162 722283 347750 872925 23291 551476 67591 389757 431589 753188 198160 864384 756162 371340 294435 396238 797149 420758 569164 152573 838239 601593 886268 551984 486502 316335 790093 706099 723220 698004 526183 601445 227187 35798 74143 183823 712540 973564 584357 111314 222576 818774 751996 27001 437806 192437 52502 994955 33420 534627 228820 348421 235459 653808 642854 963371 937688 219124 14837 361125 764090 418793 706235 351958 324567 954414 365633 483649 10423 828214 208906 340141 344621 119077 862060 250844 622658 436630 958770 809327 397370 420888 556505 666971 340320 35526 612593 69029 950658 87651…
Output: 51353770

Example 3:

Input: 794 100 784997 359256 553824 713344 154022 483254 508832 184228 474471 982509 777582 35371 24649 991789 468052 565677 365236 84412 351728 446823 402910 32156 266063 207388 803593 702350 837930 263852 466387 882924 727248 901895 965766 786251 560374 504663 712632 134566 435437 334783 875393 763318 717127 628909 501530 453258 624694 70140 626460 621808 594925 912327 106101 439792 955140 523075 575378 382269 839962 540853 312050 228008 476797 747219 39281 122081 149503 716222 891175 865266 960835 708519 787316 414583 234341 83837 634909 145335 888155 827290 431235 53527 21194 488395 426634 223856 343541 660001 988824 479666 203926 305402 663903 882711 570206 860645 373751 670023 843039 914326 991732 683124 578682 923638 507548 789167 322126 290680 706991 389379 108949 527223 938060 158004 620…
Output: 42950523

Constraints:

1 <= k <= n <= 3533; 1 <= a[i] <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Wynne's stretches Calm Window - MEDIUM Coding Problem | CodeTikki