CT46389

Miller's Golden Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Every season at the sulphur springs of Brimstone, someone must document the rare sighting. This year the task falls to Miller, armed only with the stretches register. 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 <= 3285; 1 <= a[i] <= 1000000000.

Example 1:

Input: 1003 249 814545060 250792966 6455194 764393112 174417801 846627213 969536881 358327839 952828212 56493712 988560722 128447704 260175095 320628988 782510828 948874849 24106410 244533710 790364088 333860827 870051511 757312887 756218840 200929991 215424201 322744245 221522620 258084230 275500840 648460053 336391241 207323174 879219175 230181269 459654919 417017297 728822107 130358237 156514228 242384868 606723697 50494668 729862263 609564326 344007753 126025693 133873345 142558775 606227759 643385667 663618836 542716308 558721103 428175743 540985192 867356255 299271737 249812784 981436093 218567042 200971677 997628857 281168666 239134458 338200414 340907989 30468353 298356395 833804146 295929707 888239271 193103551 459572385 794473004 412395043 268975889 851350544 817780199 787348508 9890481…
Output: 116296410478

Example 2:

Input: 2345 1707 368394857 93350165 461347293 461203324 200351207 47176172 95360134 59646518 749992311 728891120 864470681 1087310 602534546 216837534 640370600 756880952 403555116 895573534 164582568 356345422 126479845 455243309 514296023 60645468 944949763 899792610 992849728 396324110 623313383 157712252 554190185 855882200 952050724 415513038 573707098 53831755 525903006 372476045 366371893 323184290 100128691 651249176 502415762 172256488 833900306 799654876 661985090 140818373 376336918 21068805 177209588 299060582 185451796 564069886 818529749 33074624 470879390 682335667 369745219 688371004 823220341 393740158 490548550 622245693 875965268 151345524 377754793 839856072 447546890 388831461 976022646 30922981 644870624 964739661 140223924 768911962 347345686 18642743 948496565 905257457 88…
Output: 846318301935

Example 3:

Input: 2389 1327 11458556 775699827 912782646 276958321 871927949 902989692 625700735 494714947 224810034 478737456 876123650 640693658 485495940 299385369 96118296 202908188 498424433 455089565 538717744 51936225 247457144 188461385 681676150 678688972 642843309 868765795 96357559 181159353 245635858 97102343 704776476 347193145 679498357 299040340 393432982 533823505 906162867 133834652 969502551 561104096 202612915 252315881 706936433 23669822 629354241 957418178 34292031 346862215 813138047 397406533 190362978 188240107 120022944 980443907 339069951 576339793 573792395 197855628 518971193 401266508 671298057 593054171 272223709 304107980 255335825 499984069 816804977 209031046 228543669 250478590 281631077 36802906 638662763 964177574 227949469 253672908 404956323 781641725 721254741 76700170…
Output: 650222775853

Constraints:

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

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