CT51589

Gino's panels Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The scribe Gino has been asked to price the new merchandise line. On the desk lies a long table of panels 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 <= 1986; 1 <= a[i] <= 1000000000.

Example 1:

Input: 157 11 623615850 737143926 462114086 608530820 673409824 954512715 261893775 636452208 234177689 310423311 825599205 908800991 162823634 380396894 368612031 435134242 982959790 41349938 345621838 157487374 576394735 79003469 126099463 510843450 830882778 974837826 325660517 711426499 674765863 506215290 772126108 261180699 264653966 98050141 266358303 559747142 707823262 53216621 838250616 93474144 337422397 595768097 946989273 628635302 648348036 63906630 952287152 903087942 332747944 808956427 30603149 454244349 917110303 379146797 624600327 663275750 319330798 355753500 971761443 351068029 42583837 630539915 554743529 201523495 839325812 516246810 703167876 306479828 856959194 780617393 258607414 29604986 597728102 383998631 511590846 924781299 98012271 200945059 276016250 577014233 258…
Output: 2849498906

Example 2:

Input: 1145 668 126974024 672202124 485106395 120146551 278304196 175352705 889468673 370234965 661495602 320937858 985024925 932570922 766248321 222982235 81405517 462165334 236473951 487378373 133760478 147216306 233619766 776015285 661209921 97734040 942226964 11591487 193239053 514709646 605335652 627244138 940714731 410211350 70165769 968117294 610552895 922234266 350226700 217350581 376549431 399954992 293706028 563928225 617527018 568434629 547338113 899463299 280420733 241129750 300994726 144822284 589943623 454251983 447990295 432220238 533726590 228827628 294047340 309924264 741297159 179287728 499471994 333254233 749982540 478400844 103489926 835100060 198246469 729728448 738787261 32782003 575142625 826218948 642108998 617313668 901246082 140826248 286495741 170700986 360938784 927578…
Output: 311233310405

Example 3:

Input: 282 170 9369682 434631852 277482989 554556754 437479549 409399541 983653205 569269727 255379757 522417179 738411609 446134914 480142399 745504973 386679733 110892975 8027395 994204954 202508568 183570079 244595933 542899017 989821172 757937466 15993072 577432155 215100661 160360959 275888583 99680442 947144050 564287786 954669637 618205864 445254615 275969376 552478135 992962452 834460462 348314808 130881430 742393987 484600651 789489611 346862134 649058069 970813911 330325196 291074574 877655222 160970533 745059203 357188932 179749884 35433845 40665424 502189593 177059403 277928510 139205499 687648198 196159817 504838667 382797949 775094162 699758838 754227778 851887982 139779842 247488019 32039426 552516345 590458915 882734760 546357176 570914057 924331289 920154135 670860227 533221711 1…
Output: 79001592941

Constraints:

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

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