CT52036

The Brass Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the rookery of Crowhaven; Nora weighs the day's stretches manifests and starts the calculations. 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 <= 1368; 0 <= a[i] <= 1000000000.

Example 1:

Input: 769 654 454596827 500125820 407762664 517566971 408645151 190840474 994665694 723308367 664510039 212362226 122273492 643209366 482182040 881458280 606089855 157817097 963532806 928125478 679126008 544980775 981341869 841664013 467540568 834901548 163794107 602027020 911327386 624559623 370919994 360552606 198277171 10794401 158223727 135549705 397933078 37903121 893862990 325381023 399242190 181508264 818457956 529183636 172925154 564297098 881342624 580018091 499666723 304053710 436307711 353054442 570461320 818232777 329501488 50134295 53243447 627225335 574721073 175367870 42924153 717557691 974836600 89207294 664351739 160651208 636604103 82208801 650908361 253718317 351589167 414900368 382565064 188260591 926356981 870272137 392617970 529849800 969157487 456034051 533670509 549243218…
Output: 319342318001

Example 2:

Input: 699 53 65315080 554799056 835079819 91126220 305364692 891219664 497250113 258223828 997462922 944372220 788880604 991782916 464307174 191515353 568393462 218079639 300127913 882773322 77011743 590307372 583458885 32248610 347451338 164431511 806940636 21219732 50509545 915548430 406950608 420866665 667091630 869678079 823867359 611708194 82497413 445020754 270178362 862278780 576614980 453386595 938225297 734967347 402180062 185038800 998123306 901819946 691638904 888581850 193193585 241613225 479374322 168587454 664244762 12902949 277791674 388117587 911758108 371362497 164542907 66945395 284925059 322361857 738849455 532328730 964322351 197308382 836069381 440306559 102611983 658773245 193712803 883630220 261146022 235403471 19668306 900914031 179020690 722577736 780947018 258151074 221…
Output: 21712279466

Example 3:

Input: 1056 741 538117966 624910259 522729475 585812966 564113272 285701299 258214415 982041004 887831299 47541740 871011586 286637748 431046965 381164669 493713248 169714555 375109545 938968543 567929087 455099193 522422965 332094458 875068258 427588592 610843030 796527242 837359814 453134182 735331563 567259090 437121825 660442807 629875286 633441251 707287468 452802789 176336339 393018953 388847608 645679730 84300982 570382977 77060669 864244646 923617090 434517738 782387293 938637070 431549614 911030525 660015694 715529570 98247799 247594622 725836638 598136908 593563610 794454424 114845966 111291975 655721375 346853449 825022075 791749070 960148424 752175703 151404194 183983150 351422684 721042598 974741375 440700869 339580105 88956940 592972569 966344739 353742035 493756829 280585990 135224…
Output: 371586606687

Constraints:

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

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