CT53094

Ivo and the Brass scrolls

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Ivo inherited the loom house at the island market of Coralcove along with its curious bookkeeping system for scrolls. Time to make sense of it. 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 <= 2575; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 1695 1289 95655612 108435914 82691399 968201131 612071776 84336880 731628682 177254339 41392318 136081900 557913470 176347531 490175569 498826534 853471444 88289361 830626911 433676660 871434828 200973291 333614986 877883512 415155426 727785317 982988 383345826 306146042 692605596 456415985 710173758 405307331 860217683 951863994 720055381 36994204 595617001 712886575 510722262 398074412 540827116 821134396 383726890 628969919 338338749 716641839 169706456 839457552 582927846 622550130 500663035 44926624 446784381 476416698 573259962 326658880 930898517 915265759 613901155 245833535 745074160 359913916 899058313 662659464 724155010 662510587 659302124 334734316 799438349 712164574 24407124 490085220 727858103 710608911 34440259 792794907 46872488 417548621 247574043 690064635 585038175 572…
Output: 639284394819

Example 2:

Input: 265 61 131304936 712884177 726138123 170351939 735015970 473645471 403037543 983093244 359534006 425344874 308505042 195632512 429634738 720446340 932940941 142404462 49120423 756938453 401586758 573087787 347643191 807317096 959396035 603248469 863612737 774144120 136680696 777930843 134512533 726565132 215986089 444744761 746705461 888362096 276993342 177804583 576890273 993139619 18907609 492466564 361785987 863519839 501702098 979306931 816461098 321097462 478474869 167759111 973762073 -911776 196111646 372085988 441147744 375618928 341915097 136004097 792897055 523459343 190697192 277484771 432281149 16560475 576965538 149434244 447316978 926613363 522348008 337986635 701795014 171151191 469870396 30298190 479309252 196221474 266800748 424366857 917460858 451784667 247924167 586764857…
Output: 27261027310

Example 3:

Input: 1846 1591 299890949 341248191 233548017 839481770 158333792 119748882 71883485 734035396 209998947 993584297 487735523 462304857 32656962 171127169 224917057 640192261 898777330 674466739 585913604 139451866 178450875 60016873 287227875 606469451 765652143 393377410 817899016 43349820 611805969 73337352 554590347 819465559 781447766 234571453 753266304 806161619 526036187 313261591 659005973 217149475 567555969 962687769 32006550 120140116 791058744 141118873 643034477 230816277 307735815 98231331 505965807 714826598 51981347 502333827 251784296 540532993 340117958 812032623 843940191 286170598 657405258 337809534 337746305 459283541 223353028 760372406 989295341 814456938 36432297 365750930 49442958 102028229 206757019 225193278 266617131 517418260 45868044 982812017 721171728 740350135 1…
Output: 782874435108

Constraints:

1 <= k <= n <= 2575; -1000000 <= a[i] <= 1000000000.

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