CT59829

The Firewatch Peak per Window

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The council of the caldera rim of Firewatch pays by the answer, and Maya intends to earn it. First: the full register of signals. Task: For every contiguous window of length k, print the maximum. Input format: First line: n and k. Second line: n integers. Output format: Print n-k+1 maxima space-separated. Constraints: 1 <= k <= n <= 4000; -10^9 <= a[i] <= 10^9.

Example 1:

Input: 3479 719 42129071 -880611463 661877851 720866777 -842581137 547277382 -583125340 707789156 -435746684 201905366 -641518400 699868409 -347849086 592423013 -343482556 -923516360 224583732 -754111075 -714198791 604008245 -647125110 -981617811 -45695855 -146835750 -163094278 932569582 525912994 -508787776 801331208 -204577384 886399804 -763803260 -419879376 -258071163 768811019 951457980 -900636408 -329376523 -70633012 349455933 -996630337 317929203 243165606 -212125559 -528357741 -511423673 55622648 701965338 471451497 -735132264 482258497 55148842 -485243540 694332632 432958035 -180962015 -874513138 533788729 -541131466 -884193541 -320308259 832034147 -428631674 480951131 -88082487 775352532 18957347 881132127 627154286 544530925 509012863 -347286367 393716187 7396933 863733643 -267607278 18…
Output: 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 998412046 …

Example 2:

Input: 2264 537 -195619898 -68736453 -631244954 441374214 -359341134 357408359 -612773668 91606524 451529209 -738087809 164026448 4932209 -400845781 -376364478 -696388101 -912085680 -285021536 -157732110 238428066 -879681507 -460072571 276010037 -857359471 -437106637 -248987760 -478164416 869151154 560887414 460387955 444115424 -278886131 -683461717 -613040658 185427347 62806032 262840180 -11224314 -468182675 -22057272 -703067628 -242834047 356622489 896799582 -175386281 -780834747 -346202971 710132687 606166739 603472632 793663746 475486189 609369893 -233508399 738680933 358452892 3231023 -205225371 574453682 -347312238 -549086837 -585047814 943433555 211543686 416225332 61436918 -374786654 -953679735 596597505 78900134 -367826602 569875897 102883487 -627923993 433480232 882630513 -531750103 300…
Output: 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 999828651 …

Example 3:

Input: 1860 1666 -379887609 151427614 468041345 -916389528 -395103965 -470571976 119582176 740356674 455498081 -175698105 -559046301 -458426763 84472774 -787134231 -236790870 252317293 -558670381 990499985 319093593 623321823 609898007 49224302 264553358 208941170 694125975 -108640661 266066947 -538585251 -161325444 330122499 434948320 -789819918 807386189 -254795594 -700600374 -636620236 -822024392 562075853 -370817968 -596741431 -510866782 286313672 876143548 -840252320 -747113299 -34197430 -706114080 479697024 -77314338 -81368280 -844754975 928361863 -76665313 378675102 906185155 -593765256 169652907 83376616 924548031 412972251 -538251917 -9511615 -350472799 732105057 -61552753 -4245231 36637615 438802043 -381218290 453209162 -294025548 -5200990 461852461 146264142 -582728662 642217352 811598…
Output: 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 997807451 …

Constraints:

1 <= k <= n <= 4000; -10^9 <= a[i] <= 10^9.

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