CT34702

The windows at Screech Point

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

In the gull cliffs of Screech Point, Botanist the registry keeper keeps careful count of the windows. reconcile two mismatched ledgers, every figure matters. 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 <= 1034; 0 <= a[i] <= 1000000.

Example 1:

Input: 220 108 702526 583054 871057 219098 528908 84387 689125 858199 452330 345071 578500 212718 688645 616793 248559 125170 633775 254472 171053 470415 987623 193334 189550 498019 742942 909226 365605 253108 182273 932306 562437 129024 839017 376312 411394 676356 33718 337405 726847 489184 722184 164618 397849 731719 436847 220225 271169 928197 459000 234555 481715 758654 355417 179137 51837 130286 599154 601287 643138 700742 541813 282266 422134 667420 544426 933000 915131 115338 183469 484091 167306 954393 148196 253993 236025 626159 148054 20085 304368 414885 212713 22460 199065 800207 711605 293873 437692 68829 404664 603427 219333 5623 653377 95182 396655 126650 808092 249677 37134 209648 61416 173102 176975 981485 337789 433453 773767 536132 450429 999306 314634 501865 727841 225257 35350…
Output: 45817640

Example 2:

Input: 592 339 596181 200960 835052 591958 418351 518536 309262 104559 185343 832961 485791 235677 857626 947923 927913 699103 322797 746744 475259 731211 892534 318741 11998 228273 717902 246165 623220 901337 530021 974851 127274 672174 359514 45454 277611 215752 580225 767942 440785 915688 762023 832084 493580 988194 638570 57307 356664 808403 671624 443239 200058 806128 113281 335871 923100 711974 695186 875405 944691 992771 505338 152245 633134 614065 47454 476043 535164 862189 585407 329191 118435 762554 829602 28221 773083 328464 30193 638578 734362 293994 684645 419126 942718 982530 298933 41728 408304 146813 440985 663355 664691 727017 593456 893220 531834 34405 754284 314034 475433 3607 289314 305498 304336 589274 532414 390396 202107 999626 647440 969968 79821 918084 224805 449510 49506…
Output: 165925730

Example 3:

Input: 611 109 152073 612515 923982 691589 301171 759964 317396 306649 789884 165768 355920 401536 113652 731179 675179 137745 580632 520960 949152 31103 176645 866746 284333 596461 560739 31931 417089 501542 44186 433298 630553 305719 350793 427576 635727 132802 85276 576657 733538 621497 263483 775266 346803 105242 713457 134619 537354 743491 547410 48827 887415 652498 856426 717690 710042 651626 760495 819272 231503 777206 344648 480241 295507 428654 980041 952069 421400 49297 268199 445924 216899 781942 47910 126362 676484 33304 222394 888850 754250 444001 899550 864743 616547 566349 588685 377091 515072 455772 654125 128979 872236 392444 135068 896891 290285 739979 615810 695741 238252 379849 107247 513290 376243 45448 332009 554241 177960 522084 431118 848625 740409 773694 357473 361579 809…
Output: 49759463

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The windows at Screech Point - MEDIUM Coding Problem | CodeTikki