CT33416

Elio's Ledger of stretches

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

It is audit day at the shipyard of Keelwind. Elio spreads the stretches records across the table and picks up a sharp pencil. 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 <= 1312; 1 <= a[i] <= 1000000000.

Example 1:

Input: 30 6 370456702 900926560 165377425 293575045 93251992 578455576 910237084 475916672 595312669 757363454 74000527 368906857 310839238 245510436 197920485 338305555 218640256 631526637 204443108 636794005 210324270 332111894 618466567 603191843 857762457 32061046 464224609 319115898 211624192 453754373
Output: 1535483098

Example 2:

Input: 1308 1218 252936113 805402871 583696791 277482747 855871456 746379186 280032025 929423473 413406273 821503126 854464613 723472463 749917239 959914752 670123311 476375176 246396883 310529085 747880717 232519925 270301631 259511048 735167323 737760184 276481473 55854115 667932598 994410697 335806570 610699736 991661275 905637636 536670290 231802249 637824727 721474124 754964990 45421494 468993000 418806948 318330963 794958405 754153359 946035145 42978674 864927615 975903547 211708027 225180151 920163268 114542418 49592773 259767277 872358926 853175899 924446813 171799302 612688090 579109023 632159278 276002117 836916423 374631756 112916946 530113939 193059441 60850476 947476760 806079510 219602003 640470276 424820917 530415502 28956582 860967332 910722686 22612779 43281574 685163199 58198917…
Output: 596678944904

Example 3:

Input: 1104 506 201626823 234736477 525184420 624688290 486572319 239795859 532615815 399189608 103031029 543549372 133227701 3896139 963465661 165072522 164707352 166184328 691248594 481167935 798956380 510052114 79330259 711321939 189598654 22401039 294860076 666853333 224991093 387042211 419682200 21547086 217287513 565169960 856420667 654576398 117545481 627536741 539521857 692650526 606409378 698612088 430373104 281559573 704258451 985705070 11787843 927977038 909921289 330124024 788656732 889801082 909261809 494950344 784675878 998978655 28444118 36807021 123303683 603219659 838093180 243866602 198832237 244365784 251534456 580320236 70429197 382752934 720281292 766693559 547085796 11460264 943370940 641022679 737644405 289597754 109109616 808572977 473182911 857859301 805858438 385686330 9…
Output: 246655494044

Constraints:

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

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