CT52020

The Verdant stretches of Yuri

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the honeycomb cliffs of Beeswick, Yuri the assayer keeps careful count of the stretches. settle the inheritance fairly, 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 <= 3425; 0 <= a[i] <= 1000000000.

Example 1:

Input: 2561 803 192467551 411846522 10455222 21561843 377717936 406631494 253311857 968349967 731056150 193730407 371408026 616132391 238745382 108775590 369456959 901314584 877256837 783928205 516521272 545970566 62256465 490314265 762762541 425818384 86679523 364687992 876323245 720545063 363789920 695695276 994804549 692552118 883358193 989961343 401491935 747621070 434972868 643732454 374733849 966951271 364684375 170039565 134219281 905543201 896023292 680319626 988807822 246163709 520405033 512171038 593094155 737585791 642068882 312542064 710923344 459712902 453520524 787776233 32925758 648207536 504392131 220059537 12666603 638558354 697153663 523188763 474000227 746151794 326933425 29269535 781756843 40382527 186020766 728966160 872796878 410565607 946074869 333085672 504002776 357912589…
Output: 401487136887

Example 2:

Input: 3268 2673 158317071 361818644 323780981 927857147 885380728 188474663 561179678 737084972 93798351 468068842 154098253 262289077 969356184 210544624 695656118 92345732 956091709 633166515 430694369 944885299 899733536 359698568 486003266 856720384 442362963 897490358 561987694 304618759 278635052 684825770 525887339 144804273 800906539 500166407 863510303 850846505 752358721 817385911 948330147 674727169 225769769 375648761 465664519 47292511 738134187 42219421 309354572 787720058 829292675 897618196 52684955 928372023 857369352 177208023 786004074 400859646 912261263 489245106 560052291 389903539 250160361 169762784 771173247 115959796 459237458 661472796 772802327 493437765 852724887 629307139 846613758 439417994 378008144 365165628 159210604 910279050 240847985 190715436 13457061 898919…
Output: 1333712112050

Example 3:

Input: 1915 274 408853860 547470234 280698452 22678512 423765993 274122422 852932816 101856715 582305306 678351007 629118924 508822895 818541369 424560958 932269517 546995418 451611058 577587255 582169863 261766626 392964498 218876573 426856668 908584094 359761915 521316228 895094463 685164087 533506034 289144933 19322978 978003771 279543281 249204698 726716866 42104714 59872135 654219845 665596702 151016757 44343073 276422843 768237697 276872464 846284450 299097025 567327238 927491206 431373996 498226764 285644265 160457011 589095598 364753953 139291555 35703158 209354510 45584865 587141515 832050311 434358327 901789453 414483582 22226458 903053450 922057374 282603898 684430861 816148295 727903372 209353905 347159133 158336124 453537498 637017217 516087348 376596230 110850044 132524250 604320945…
Output: 125159774293

Constraints:

1 <= k <= n <= 3425; 0 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
The Verdant stretches of Yuri - MEDIUM Coding Problem | CodeTikki