CT46410

Jaya's panels Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the tulip beds of Bloomhaven pays by the answer, and Jaya intends to earn it. First: the full register of panels. 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 <= 1819; -1000000 <= a[i] <= 1000.

Example 1:

Input: 117 14 -300925 -90674 -271499 -963159 -561006 -341709 -827501 -427161 -863675 -832271 -4033 -654390 -713356 -104987 -708941 -763989 -9011 -441347 -687037 -375701 -382805 -618042 -757254 -17908 -950938 -254794 -402786 -179380 -994186 -486720 -668328 -363325 -624936 -371778 -767086 -648695 -576924 -109572 -967794 -506508 -494437 -509469 -570483 -449844 -964588 -559008 -633544 -390212 -655305 -969980 -314134 -476542 -212578 -289807 -938489 -686450 -929112 -320066 -384605 -82510 -109692 -944484 -154288 -184939 -547775 -791697 -565953 -129702 -311991 -403944 -993197 -309447 -535323 -76405 -286824 -103277 -176633 -393232 -15770 -237313 -300753 -874299 -887883 -830648 -844276 -915870 -53787 -831637 -101559 -392234 -655444 -780542 -46002 -327179 -479073 -854674 -396186 -674168 -542426 -353534 -202…
Output: -8750519

Example 2:

Input: 1177 818 -131711 -406821 -430142 -326578 -223577 -628695 -980302 -610863 -894425 -297075 -954428 -463474 -340304 -42892 -273247 -850042 -514568 -613448 -47729 -493508 -524801 -10396 -89636 -930897 -216156 -703939 -465605 -750587 -65675 -709725 -568633 -42461 -673350 -578560 -813881 -545955 -345781 -613601 -338522 -508405 -751761 -921816 -971038 -714292 -579224 -933961 -554593 -156554 -923188 -478972 -658289 -342199 -606104 -211904 -98311 -977510 -946033 -759297 -558041 -108841 -712000 -907513 -332325 -57760 -346181 -537754 -766507 -361528 -91814 -802171 -598967 -765095 -944273 -817546 -893740 -406377 -222272 -561914 -231916 -317966 -441275 -833243 -597506 -986763 -540061 -718220 -337560 -903880 -757946 -482635 -416142 -801615 -41353 -481364 -912593 -419897 -52078 -737075 -393160 -537694 -1…
Output: -423181120

Example 3:

Input: 123 71 -124407 -24408 -523964 -187041 -869101 -761634 -182966 -128882 -543147 -288547 -226802 -427476 -733917 -12185 -623878 -202232 -354330 -406616 -655414 -271104 -614125 -666282 -821091 -898734 -596507 -511929 -860599 -691215 -668793 -698763 -194866 -272149 -521837 -535190 -990480 -767730 -188465 -803456 -122726 -167587 -555323 -61154 -346329 -588941 -155942 -612643 -744348 -379390 -868833 -484209 -640939 -848509 -610396 -251657 -239988 -419431 -226965 -783774 -328631 -698612 -869387 -77241 -482070 -669780 -354287 -247088 -411628 -880842 -883804 -670231 -81462 -860112 -784212 -842682 -238609 -133255 -799042 -658695 -842215 -678908 -628025 -122203 -690918 -181701 -157781 -565899 -128142 -230519 -647463 -351858 -276613 -157558 -859996 -286290 -207538 -75671 -129873 -59804 -467856 -492727 …
Output: -37604910

Constraints:

1 <= k <= n <= 1819; -1000000 <= a[i] <= 1000.

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