CT32121

The Calm Window at Balmcrest

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

It is audit day at the cedar groves of Balmcrest. Yami spreads the panels records across the table and picks up a sharp pencil. 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 <= 1019; 1 <= a[i] <= 1000000000.

Example 1:

Input: 811 231 322740702 486152109 350309960 230674380 310859591 780241629 421979212 435198588 329999052 710385258 631654964 90055316 56675120 709324770 699926503 290239076 595675315 796837229 340636020 710436404 801320946 321962143 383587044 184140055 543502062 414407169 916900640 404495444 206665441 451427453 957086710 845324499 397873831 772532376 28553923 105043124 292689382 534587216 913552707 615466879 861092676 694929141 969904369 481453651 998533896 633525241 738205761 643910700 490714307 161659376 599125482 300483328 831169905 431301140 175522923 415172390 773222211 465754806 531528245 763405029 143039247 509164068 453632374 620216883 763287739 95483201 386504523 153288312 734116927 475462347 501596011 41526758 564191773 320172942 185685144 612745362 218267846 333913647 148472095 4822801…
Output: 109932489263

Example 2:

Input: 172 141 718923804 889613806 433201104 325312727 530395465 83089584 600949927 289166321 795378851 175511410 442979997 945955432 710050456 353545764 405312340 271854129 605984984 109794452 932495403 839042297 86898234 682215224 261379147 778735795 644993046 823258836 722300899 313860280 800197189 70787024 524527771 889524307 188029878 906872901 768713393 614732847 189762103 164763144 753948474 464967611 987346511 656828601 542018858 825940208 916589171 140780217 129826131 247481619 922123291 472142206 40937137 638870921 483450675 790407007 217543352 508332355 381268804 183500599 972304819 584601255 281923322 229001949 568822152 773837557 326487940 402511667 71131154 624108216 462239463 205083260 605167429 555388208 39271335 767189041 713365883 766816525 40099149 309693740 49412048 283540839 …
Output: 75155579778

Example 3:

Input: 511 143 363118229 50276014 920067767 339595495 899529980 281960827 377296678 552208477 689961949 77351953 889441608 126362041 402668126 348112792 469601311 436747573 902587320 268798162 886350363 90543176 222986858 563428040 480674890 463715846 928940388 366440557 48242445 786419736 51879435 352111842 721814217 61789453 466375634 882861837 829033534 956835183 211401791 79986242 893808506 874330167 196639294 159677054 764912773 729888336 904858936 590049736 306091593 814821576 932060293 73741782 922794112 450558342 295231398 572743484 34095744 146285362 360013268 416223782 118653751 490123821 379539585 798101112 900022296 148617950 131753759 727390549 886386265 601688685 780015648 112562837 118782413 737324134 327736206 71886986 436897154 851923658 369374518 225855512 428278089 685227715 75…
Output: 63443239990

Constraints:

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

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