CT32357

The Calm Window Beneath Scriptoria

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The reckoner Morgana has been asked to balance the workshop's books. On the desk lies a long table of segments 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 <= 2875; 0 <= a[i] <= 1000000000.

Example 1:

Input: 2239 80 303986408 967616735 422859256 665929815 335739579 369826280 388367939 580736221 833648380 46919246 123641405 527086776 948584117 323238360 994745281 225298271 917507369 523488853 980379529 71267385 936773475 600321149 660369086 437076478 776333901 593481732 966530632 4192706 807435741 228713465 758346351 972290780 114227659 164553957 961555642 148183497 681638263 177554562 815543636 36876174 597533889 500924425 441121585 588968180 418482934 625378995 348247708 979894919 973613654 822592398 804194236 402740171 636387132 199931328 585356466 49380462 129124345 84921329 78868132 99843681 102986788 253507578 167787814 788395214 888703605 550159188 941946670 976216232 907756435 906608378 660306674 505974603 39222909 348274061 58321743 445527288 218157341 707269068 882120288 849103979 217…
Output: 34207394277

Example 2:

Input: 247 96 535790790 212516127 713492134 566952251 88959351 44567816 919750330 512098263 949055188 565119099 642888038 16812331 798106568 273719445 159500289 478183178 412047689 499915527 988378618 176025769 894762421 691171058 966648777 425735951 922613158 704553677 599658493 786441895 266173118 869152495 328389678 143144908 697329513 798426234 128638771 602123769 684843177 508220782 48357344 140244185 822816686 663731204 696723246 813961432 389631976 866182121 743834216 624783075 305445640 373658347 147674250 610511930 81764908 396444463 862716886 92797686 710355448 262417284 438203687 72737737 959228061 540036879 669048303 693847344 594734824 906474362 74189021 256989036 228600169 763976133 861524107 557670292 272034083 688018838 626322925 332030240 976410096 339180635 483447650 651466097 9…
Output: 47206001744

Example 3:

Input: 1233 499 771796120 56725391 750093996 304577047 674187377 664122649 303190565 661041707 782220658 687376845 506951825 156454258 416200660 642783686 74155367 314866358 680189793 241672921 727408723 866773508 952196648 483196011 331035028 408823767 706472885 525621740 578594082 719188625 617675182 310423951 735502615 988796233 571103346 417420052 143574930 305070346 427315553 124754339 321832634 536161493 314746829 382623313 880109774 473766808 671653329 696799410 23120550 290311973 549067229 187417542 632004218 678652704 766074844 812341743 149016583 883769645 922456311 708784662 212623160 697495237 244278549 489063257 939171085 245040864 665467380 836327441 761439862 332128412 570665977 415957262 582598969 407866842 640194642 724362768 638140037 24825398 85135778 728651963 330957681 407194…
Output: 244969726014

Constraints:

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

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