CT45130

The Calm Window at Buzzwell

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The tallyman Hestia has been asked to document the rare sighting. On the desk lies a long table of windows readings. 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 <= 1768; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 299 266 426420356 648289925 744959281 13186052 580218622 674933474 295492481 482498482 312929685 847618824 855638771 443770211 41569412 827711580 993616411 497823946 618770095 138495527 28213189 491429924 146259661 541522548 686730317 688670202 452421215 604559817 982933941 301302041 540168212 544838592 646792574 927198781 677512648 927378225 487667120 950210877 801335502 -772623 575696056 175092115 760283011 131215709 832267560 734460782 752933677 308737632 942114479 292367278 507763796 175371000 931930695 596289104 343464364 928935824 556241096 666982041 219876190 900920761 663802081 458222698 566760105 87245822 978655443 880083181 775149688 392388121 559598516 454698147 385793366 546303244 195818779 128291927 828365865 604408749 554451061 858289229 598446527 690315429 117576907 69919628…
Output: 131089471856

Example 2:

Input: 151 128 196025824 314129805 959801135 330049681 117735001 284345955 188320256 26624865 922390415 23396304 744416112 876143273 667133446 919978619 99180872 925005255 53245278 945816029 440034218 145529992 825458678 167923152 245459077 954778727 553995060 895798787 593141914 285902695 847995687 134017375 685595700 200995730 920701935 145647524 857402449 459616651 926727932 352246214 606088282 394167462 25659402 748943040 56472841 407778771 59148471 403565888 18093222 727287975 237928089 933880462 794968380 738466003 858976423 28647231 582816478 584060800 574390490 498156754 787896350 298146918 302114189 658658718 974159974 127984570 641565231 912368489 340963112 341347740 408087276 792984421 815627844 526555168 106583436 491344622 62845257 46772311 488449489 35029100 112334378 824489732 3894…
Output: 58792370377

Example 3:

Input: 655 178 352993911 192324792 797707540 80676604 660121337 759772647 964033644 390901410 224669256 119664147 667672158 856313499 24249756 293212197 896233962 672059718 129602407 362283521 889478626 154659922 858549274 889350923 57223868 405773812 186154052 825958105 403899913 968731547 264431050 571244650 897634549 379223124 937684585 801827560 171287157 948877677 748084449 400154514 937783109 259985495 46206432 797497667 320523213 446217010 503210691 700090238 707262923 890350905 144918298 728001420 164277873 228307464 739407441 120990650 501012832 529977916 789639047 264837457 465862586 342053772 964655844 147588286 631014258 531883506 255265611 507324584 844835941 72887470 859207106 40797704 794451194 544940538 455591185 380197071 374611287 155767459 45296476 705708000 412206727 711483168…
Output: 83544609193

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Calm Window at Buzzwell - MEDIUM Coding Problem | CodeTikki