CT49721

Last scrolls of Hestia

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Deep in the tundra station of Whitesnow, Hestia studies rows of scrolls 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 <= 3768; 1 <= a[i] <= 1000000000.

Example 1:

Input: 108 48 890778445 38459152 718160898 545606642 75244890 406361423 745440415 208039017 39023140 231046314 600229325 71767535 382263763 584089413 207950319 231356365 324706884 873497279 62716190 938302348 515543891 343856675 116216227 632960932 404102426 976364646 561765694 836220799 934302325 415359302 638899914 564449463 704115854 29909390 999544520 610564512 142942420 851854723 232340386 409458627 260068074 55746742 996364899 563910145 965492646 905797109 87330065 28889262 406568394 519346722 675680654 933552682 212983876 323982227 786708493 365114372 469184328 580949062 388413176 450338789 492762964 856411785 371271905 319373902 212299512 684988579 775527753 955907544 537181483 947521343 662850013 522194648 281238852 891476849 268008345 812445325 411397922 376946257 218919724 476215465 41…
Output: 22475201374

Example 2:

Input: 2142 1013 375446332 303561201 846596589 941268904 719078178 569059002 214060354 650259803 406828504 716861293 767389589 624933778 643867183 544760510 14345862 63720856 603767569 815852300 868827127 692890524 392241476 347750141 541634865 704498531 135838113 931833226 628267849 958571359 398844881 372038337 961326643 397409381 436434131 344826093 951135918 688238831 409061107 249853666 964139227 102363245 351507882 911241639 81561667 852891223 188762268 59942169 97945829 655523471 882826058 449523081 695181810 403881363 983501502 926421083 266847016 483175215 311898904 139629164 915567631 47015246 650648179 185373412 281752955 423008425 255769775 797641272 766131296 450920461 299346298 698800855 572591760 946518497 867116452 333230126 764970986 119449932 299499838 502433767 685993141 731114…
Output: 511721519657

Example 3:

Input: 241 66 952400956 900062980 952441759 747283381 879038338 343392099 284963776 870622917 758859209 821636964 388800980 389083099 304465886 739062246 85722290 640761991 665827405 87630716 748929608 800635232 40821443 419123258 858594305 651845976 238238057 855947810 820532478 980673663 999768876 451152259 866303822 553853795 213131956 172384735 756494703 1006557 429839861 214465192 353492424 930500384 770353380 152498194 833839514 495182409 467931487 645626174 458227461 247255610 485763904 458372292 69315461 863067084 105088111 165773400 700694748 231801039 555736153 394724156 484555198 740028985 562330751 580267330 880204980 156418288 609759798 766427046 350929529 490832453 697886587 430500998 424752796 365036997 379999176 636898332 634756020 507142240 620390040 306945365 859780011 551488178…
Output: 30525166365

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last scrolls of Hestia - MEDIUM Coding Problem | CodeTikki