CT46333

Saffron ribbons Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Every season at the tulip beds of Bloomhaven, someone must verify the safety inspections. This year the task falls to Rhea, armed only with the ribbons register. 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 <= 2732; 0 <= a[i] <= 1000.

Example 1:

Input: 2541 2490 593 268 604 948 577 35 66 353 716 816 766 821 56 562 745 698 119 165 14 909 174 775 600 785 752 591 324 920 111 232 477 752 703 46 483 116 508 655 63 191 828 585 529 897 492 684 154 64 471 357 463 59 999 842 780 913 436 749 388 122 705 247 713 156 994 697 671 957 447 809 47 134 598 484 674 114 821 824 972 792 609 840 50 130 492 45 91 547 434 956 767 407 439 176 564 800 980 695 222 489 297 80 837 67 591 129 321 848 454 720 195 241 980 920 478 508 141 420 36 804 279 736 634 791 457 449 786 609 682 198 263 683 947 323 795 898 26 172 55 172 330 128 204 184 446 688 526 0 309 22 179 576 568 660 40 173 293 214 123 891 74 210 162 791 381 163 445 430 117 840 932 773 238 707 434 574 493 680 103 826 43 747 72 392 45 391 691 411 665 483 776 783 580 991 75 908 568 827 833 299 91 873 165 513 4…
Output: 1258998

Example 2:

Input: 445 378 702 316 797 62 14 62 133 468 604 182 899 406 456 941 760 237 669 57 429 404 844 394 75 645 851 887 837 69 787 278 539 879 866 448 244 993 762 549 765 456 817 596 137 564 60 859 285 721 970 993 892 686 490 832 405 47 699 883 464 694 845 140 815 396 827 679 903 241 704 816 700 992 845 811 150 120 212 262 625 856 449 775 678 889 397 850 329 494 584 313 116 529 372 971 623 625 764 956 748 911 830 44 381 341 604 390 586 130 657 573 107 263 899 113 537 978 207 207 858 438 943 795 504 732 130 545 833 259 419 65 208 253 556 999 449 120 46 356 947 229 374 19 318 552 807 373 293 915 859 999 713 132 962 577 426 668 406 891 723 781 594 362 307 720 228 298 25 19 495 224 63 731 623 609 769 988 539 925 35 530 957 410 479 387 101 800 834 909 929 716 480 654 725 798 782 942 233 850 255 771 531 385 …
Output: 189785

Example 3:

Input: 388 27 947 867 775 433 426 133 932 429 158 985 459 818 843 245 485 619 548 650 297 969 97 750 377 869 861 34 603 185 868 629 889 518 112 908 520 785 798 827 853 197 274 169 141 589 29 19 962 956 826 378 590 198 843 545 774 100 414 67 254 622 39 291 287 760 934 716 466 39 870 67 78 948 114 540 193 246 318 433 664 896 122 551 778 666 476 482 715 624 564 320 959 61 413 895 360 324 128 840 963 389 138 197 88 941 513 91 901 703 551 251 430 275 806 58 238 439 215 855 324 312 580 704 913 891 461 569 439 925 224 263 26 526 775 427 354 396 10 497 74 48 459 237 854 955 359 288 278 6 803 116 388 696 620 269 117 541 234 887 876 911 698 733 545 126 515 43 496 24 739 440 989 897 329 364 216 717 827 8 73 246 192 716 124 545 807 124 45 146 402 436 61 705 407 355 195 709 965 692 152 13 86 372 414 590 18 73…
Output: 9580

Constraints:

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

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