CT43152

The windows Calm Window Puzzle

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the maple sugarbush of Saprun; Xara weighs the day's windows 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 <= 3249; 0 <= a[i] <= 1000000.

Example 1:

Input: 813 659 997353 342699 855946 292008 328333 100502 590411 578246 307362 12420 287564 729519 406977 821814 758221 397740 963928 461102 450758 89438 375255 298700 893817 513327 361499 955727 32169 489941 383652 141037 182685 971220 116225 944967 276577 169585 188827 742539 73871 578107 800271 630788 170259 802271 614724 877936 438063 284072 344876 517830 485758 531771 388467 319547 253418 286870 748072 430066 771156 859951 859814 43904 860610 817420 2780 951287 960314 540943 738546 801342 169712 897527 449267 650438 782322 669316 89711 642219 687646 642520 381201 640599 62088 64096 944846 146868 106524 768139 339491 2682 404516 996442 899812 669723 271567 813475 745964 844842 580803 351848 600462 34610 575415 102805 552604 95122 874664 120417 20198 152656 920438 255358 704752 182041 774573 74…
Output: 327059087

Example 2:

Input: 557 125 953215 627591 445217 33789 363710 464374 117758 387176 640508 958461 634699 885823 371235 568593 560536 835700 495195 193388 395908 750231 971119 224162 192377 174479 393061 280817 395044 283294 413581 391617 260040 20751 512047 28995 469002 847295 508931 788928 84165 291310 846756 998157 634770 556769 148706 85807 338567 976607 466152 804821 620358 4207 502233 502650 520824 615284 252985 394173 446276 743368 173105 56088 431597 540808 710849 286973 760273 274881 173093 763962 110393 320984 513675 991939 794123 803785 598232 11878 234122 765746 672476 234775 712631 612736 628930 639804 563466 428575 532931 510116 456798 95979 748043 571149 796914 817746 826698 4208 937031 804692 624090 215731 911213 791298 10892 525054 25411 920642 580631 458453 455426 874419 960793 202277 4402 573…
Output: 60264421

Example 3:

Input: 1299 409 690064 715182 832743 232591 644874 378778 975241 758663 397138 70486 716195 386098 78302 668168 927504 494663 321721 999321 271949 744410 737790 107219 942973 516479 945975 601515 62233 259411 310717 316631 565311 687978 161864 802024 626802 733179 520354 994382 400815 808268 477253 320000 450453 618593 251062 348332 20029 883576 296168 356349 701031 229198 602541 812017 52725 292970 370651 804386 380814 778924 835096 510275 150967 916826 928783 800063 177755 841822 44212 635132 367879 769855 429060 3467 875555 346657 550431 207769 221513 240631 251189 509703 93859 279421 760363 505357 813982 524077 572592 190271 65695 451248 233989 193169 490218 40017 598524 587771 672092 300658 477443 41265 24906 523003 970928 299074 587803 720947 964058 772809 477882 463769 615055 970014 765123…
Output: 184485452

Constraints:

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

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