CT44370

Jasper ribbons Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the ribbon falls of Cascade Vale; Dante weighs the day's ribbons manifests and starts the calculations. 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 <= 2456; 0 <= a[i] <= 1000000.

Example 1:

Input: 420 106 68797 426857 113162 706100 161520 691951 779197 567023 957677 799004 227390 827766 247477 296203 529030 687126 572214 953946 316019 342529 238946 740968 391079 715225 266046 740555 92203 849424 469976 625551 935743 44688 159824 467869 278025 833409 409391 625864 593376 761775 226360 601002 438085 710087 548748 795769 951135 243633 879993 869633 772148 485034 883922 790853 7573 55352 346813 893459 334934 785094 140613 148516 606004 847230 36608 8907 524504 998306 449784 16483 375299 116357 173252 477405 440228 775927 347199 827632 892454 349031 977111 623630 420723 462316 887886 556329 152523 468629 846789 69504 548787 767313 341567 420164 74756 982757 158940 208198 600630 367513 98759 682615 957820 669976 556994 700542 374005 318596 141195 836451 139103 66020 369635 172374 695575 9…
Output: 51696352

Example 2:

Input: 1501 139 545987 641660 318313 3338 622371 215361 160110 555801 719600 452723 782225 629090 600975 498956 702525 51400 917795 531104 318289 847548 633270 531329 912405 235999 955267 802540 290171 770532 542280 606156 934085 25190 616378 182529 300747 6352 245371 786479 520258 601061 381321 370870 182175 390154 183275 336032 936829 512584 823428 493436 225239 939651 779321 699925 884391 792624 169300 907311 808016 938523 33913 599364 271900 91738 940672 657306 582948 242724 259236 378631 486735 910300 519891 783370 959143 59357 355665 501623 799136 373270 792497 361159 648689 402400 621477 872915 602171 903876 751979 314329 705663 850639 422480 55193 101177 529958 266887 260355 247697 451126 615925 63062 902901 13772 852720 243822 7230 721274 402360 889873 447503 287930 868782 776417 826313 …
Output: 64295530

Example 3:

Input: 552 259 738103 158931 615172 763593 424698 13733 187180 333202 996220 505473 270629 610707 39379 968521 530931 313770 168717 855854 958750 134349 476205 713948 160693 898091 188231 847071 19489 306752 685368 579083 426441 362913 658067 443775 635913 859772 706379 317262 432396 288514 813479 775108 627335 100260 365651 407449 868277 898096 286221 355429 363939 802869 668454 561083 940483 758779 926333 769215 411927 165446 353397 486531 962217 67246 115355 297370 363751 541395 401590 307485 295053 226699 31649 138686 88083 980640 380550 858234 608839 370332 194924 39231 380066 168077 158504 296610 782443 932880 146908 465907 528116 76972 385257 686166 671423 690141 635389 729959 542999 145052 459021 764212 859519 995231 474955 592464 671007 429059 782441 631083 805654 860304 709321 994492 38…
Output: 125774699

Constraints:

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

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