CT31838

Quade's windows Reckoning

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The clerk Quade has been asked to rebuild the damaged itinerary. 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 <= 3830; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 1507 940 38442521 216231715 603307011 423411556 172058123 985060447 392751974 931591689 374110418 378494471 119955719 380905566 684759975 345640060 723089367 740988081 146297694 260894798 869174580 501759360 723401373 558406141 950793469 761381415 169707908 367750004 453534200 542300124 690024580 209291561 458523410 341168575 229836407 947412499 912727191 282263225 99847910 178712209 340545332 413195326 395946762 248840762 871750284 501632493 69195548 432982482 408063459 231058944 56491822 216104274 642372222 457041790 979735478 830942121 380232609 206914588 191472334 70567261 663869126 107311657 260781128 966939324 301711718 610540390 554987317 678511369 464412154 267347675 366797821 732068611 210330357 540172790 612029569 92148809 64006317 568686410 585122656 120312792 175157995 89949310…
Output: 465268685315

Example 2:

Input: 910 387 844701137 806765737 561573188 783946317 517453150 184338327 974587950 154893994 32122165 849706761 957091339 699602316 28251675 980739370 699736893 285758235 342086087 278657250 420127263 21284352 16938645 633990038 742575506 577425296 470947772 845699403 592047255 791845895 73931026 750471218 865595328 514540888 865450089 484312038 987213041 385412467 468263444 9389945 766766589 228263701 739424036 530679509 858865341 579779799 632561094 333722200 507128319 548028002 398658815 684559520 574609404 850534288 952950308 104510176 608058106 84964423 186247261 235459658 419955381 478274888 22986620 895123956 977157562 22247438 236495916 601965065 994174688 697174738 960821914 642056019 210751263 143346463 891526687 463837759 437280311 112493034 970456231 990196810 578420366 803592033 63…
Output: 184139492479

Example 3:

Input: 706 3 651842604 481364751 673833990 598281856 953681378 246860204 654607119 534833049 758116233 167875555 768964672 685545088 260933463 190288166 801071897 530351069 938522909 247182748 117108075 720155776 649753992 365564596 385679828 507429718 791247201 686099477 782370017 311015096 578653038 88412781 635486852 760728681 637548123 257640683 821316559 30635319 84949862 92941989 537850658 162482029 399176317 975191672 265571117 337015663 142407484 487397582 967128649 838473908 623910824 442536388 208158539 522876042 969713335 290144025 833258864 953285575 567521641 277923623 996559260 761853951 812406789 647184251 161051895 713592992 168647990 13936941 954317058 933892309 107564522 12167376 159154180 563045853 329456384 698682071 782605182 844377174 820134772 80971704 793874360 559277380 5…
Output: 208527170

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Quade's windows Reckoning - MEDIUM Coding Problem | CodeTikki