CT37674

The Calm Window of the Sterling panels

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Deep in the lily shoals of Padmore, Opal studies rows of panels entries. One clean number will settle the guild's oldest argument. 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 <= 3355; 0 <= a[i] <= 1000000000.

Example 1:

Input: 518 325 35284748 352930632 739838231 567067713 663752991 319856008 675982218 949629212 211309247 112062644 599660953 150276261 219745414 863031011 529702857 264514352 474749364 131976013 997019593 329052075 199828214 730122854 272083987 255479881 141578985 844985753 249146975 179047397 75115899 318258775 222626266 273368929 268667646 901545586 817197687 471167806 263679601 544928510 721993281 23903362 579222069 697038453 493091290 393314594 823787391 366266133 959062342 783424569 857458419 383601293 902035772 928830287 122819631 176839489 32440392 527761929 144819195 502750363 627419329 283207238 350873210 204555217 88337239 401907408 74443983 805235319 806528380 318745701 949748164 503990213 678844011 183311438 711583734 281523860 154858844 248868287 304841213 541785302 797054968 72478931…
Output: 161858357698

Example 2:

Input: 2897 1919 737824762 977208218 506792819 191167093 358832722 92719211 567502832 661872461 790793017 115588815 600475719 731849754 85447199 931824383 116913812 31092830 887949376 558241523 811599011 234139381 741681209 818514822 763356194 446483829 238886919 64911577 169626287 477470234 650525523 837857689 797709967 734853025 651558510 787178972 164460253 292402092 906561355 177376607 940498734 570356905 205766217 9797726 100688266 512072562 761472980 956594307 707410541 808872758 539115250 231343278 712587401 232668046 208346340 72269384 304797943 641415380 250628641 271295997 317566806 158512436 429482442 60930784 784177295 173007728 966924194 74279547 538095372 224052017 381643440 623739703 363717264 696904304 240241621 995461822 274970164 527429755 76007381 67452119 642236787 349780029 6…
Output: 938676509394

Example 3:

Input: 39 21 58506501 62633501 99459531 979222147 524814595 97176585 97266649 440645962 553761047 838409032 152423196 19608042 599526281 511515807 197815782 589203313 123691731 748092626 502566311 916669385 805272793 973186267 345355312 439648334 335963676 565161268 350208954 467260176 973536437 314529329 754545167 94912879 277345433 720877672 335438441 253599092 378460832 14134123 45512043
Output: 8918280817

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Calm Window of the Sterling panels - MEDIUM Coding Problem | CodeTikki