CT35020

The Ivory windows of Gautam

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The harbor bell rings at the maple sugarbush of Saprun; Gautam 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 <= 1362; 0 <= a[i] <= 1000.

Example 1:

Input: 671 375 722 514 467 15 295 67 890 554 201 351 933 711 452 118 412 953 457 0 200 473 202 472 104 104 117 858 327 522 62 188 87 321 603 53 449 349 438 155 753 401 302 392 841 705 355 463 188 605 895 891 324 515 425 305 955 971 509 835 592 160 645 307 653 477 843 805 922 225 661 292 686 712 67 924 614 64 247 472 537 124 796 131 902 242 409 138 570 421 659 733 967 276 368 665 449 242 256 385 919 881 280 830 789 907 65 438 972 769 706 982 796 464 760 132 687 375 381 636 731 384 640 903 761 679 343 365 253 936 727 50 685 89 695 477 150 233 635 245 642 449 896 352 757 936 27 336 652 186 352 321 965 772 401 415 42 271 198 698 440 451 848 670 777 366 179 156 341 731 17 27 17 173 416 546 458 940 708 89 962 483 68 581 815 251 458 185 177 913 981 569 353 928 57 369 975 811 461 961 307 732 428 613 612 …
Output: 174049

Example 2:

Input: 1068 994 591 695 223 50 429 921 98 785 37 986 956 249 885 817 570 526 204 439 797 568 67 192 672 382 895 477 46 491 898 188 804 140 449 740 173 27 16 45 364 607 226 373 593 597 912 47 516 519 247 158 901 467 144 651 81 500 525 604 869 906 473 468 549 415 889 866 829 620 187 544 503 14 751 164 478 659 846 853 476 553 572 444 706 509 631 894 264 466 251 168 50 423 931 173 302 850 380 283 344 428 969 206 730 623 954 58 466 776 201 251 101 255 569 706 364 837 974 452 416 804 851 476 977 701 109 692 792 851 483 602 291 659 253 138 182 279 571 204 351 11 897 587 773 253 700 851 755 140 755 179 100 251 299 572 536 812 465 381 987 537 896 844 905 994 828 787 368 321 564 971 71 995 991 37 41 560 554 643 64 173 213 606 761 712 312 371 675 353 293 107 429 277 769 439 927 892 822 632 617 511 653 363 6…
Output: 500683

Example 3:

Input: 658 89 315 138 886 873 196 254 72 230 920 622 552 375 351 967 51 105 239 311 560 602 898 3 115 212 185 210 856 439 702 585 163 836 643 454 100 37 139 32 699 888 588 669 888 707 866 395 996 133 126 184 260 716 814 217 656 305 767 487 353 732 807 509 471 947 442 637 26 816 208 963 992 22 614 490 415 866 265 922 375 196 174 77 963 223 907 615 55 796 873 884 803 559 857 784 794 91 209 987 515 363 902 502 301 307 17 292 977 488 17 24 860 65 489 830 990 555 299 735 945 469 170 5 539 525 821 513 816 797 637 259 44 516 414 281 769 449 565 338 660 629 658 257 211 554 432 201 225 945 134 276 72 397 469 618 100 124 11 840 646 851 961 476 654 946 437 454 98 543 459 305 268 822 436 249 521 586 957 42 992 882 225 652 868 663 302 506 808 747 928 87 865 446 156 977 32 717 781 438 634 184 680 793 839 782 4…
Output: 39781

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Ivory windows of Gautam - MEDIUM Coding Problem | CodeTikki