CT53813

Tina's stretches Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Tina the cartographer watches over the herring shoals of Silverfin's stores of stretches. A careful computation stands between order and chaos. 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 <= 3415; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 404 26 322634378 257333370 514808712 443834578 209162598 296261862 794355507 484347657 920279821 499623749 896155098 248318543 865692809 593199071 867039451 478463686 319782280 260793211 231654628 227742837 544693902 667178721 396788647 423042747 849384889 68008824 554406147 798289446 819639569 135652132 639800082 463221027 769221369 111406514 157786272 636497642 202009322 274664963 848097565 716907419 340381723 615837011 476491463 625103034 287109258 512398999 944164236 265928874 437213405 693332136 423869826 551577010 758970421 191741931 113326877 785599675 351872396 984628951 85537984 841107304 405431317 464918342 610775757 613133346 446803043 711268022 365228016 725463249 655667017 4515633 652977893 22628793 316787331 964818183 135717294 170564230 755382579 8000392 54699735 46503121 35…
Output: 8719553799

Example 2:

Input: 1154 396 142320476 463237201 755767059 838551388 591697983 410232274 930953470 605071903 942674919 39434179 281500581 788165054 58629187 609460237 514646218 291294002 599555957 439829542 620195950 333028972 215489841 845665151 678416452 893905628 702480181 985942956 533518614 390416550 470173284 854816709 518249218 39860990 612700678 223776357 205732634 155252508 420865991 949089678 95470090 165708909 117374986 732082455 914321685 994667024 795724875 962779635 295905701 30298209 521357181 106260610 511874869 40870530 917528963 156273431 192363034 328715604 824269887 417923048 286972461 395437445 166431352 915903225 342675258 654619569 405444706 882970987 143302868 428226158 621213102 134291172 705299550 553043296 88649252 420795216 886851585 89258963 235023232 88457578 10931713 89961824 15…
Output: 192965118563

Example 3:

Input: 2460 721 695178492 133865394 55364657 513575212 538141499 862762445 790231230 801852687 259790545 765093912 797144032 578162013 286261146 14340959 715086992 1189055 95686033 813874303 314418552 807925938 145713378 291083380 216478283 482418377 13356117 661118300 526378434 282285839 973195387 379783750 783134798 797166968 188309889 977050428 522698004 48021476 880054013 829324834 172361756 861016616 364280778 848198655 836271928 730405286 198815965 845984719 721032217 658136923 777782646 102877296 384416675 86294088 736566992 326270289 58080526 402843501 521581330 350540385 770781730 16864951 977983910 642032532 875726557 595673401 423356024 962943572 975479948 300443064 573402944 332622437 169848871 521503318 195323958 45734190 302019314 850555546 46780585 958533302 231267960 76986380 7126…
Output: 356334779147

Constraints:

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

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