CT46818

Wasim's registers Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Wasim the factor watches over the ember mines of Cindercrag's stores of registers. A careful computation stands between order and chaos. 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: 846 114 -845633814 867767964 -925562822 -442319663 -120610130 756360674 433999023 159466266 600690332 -436636416 456792231 636504502 164201865 -986613273 -10171541 99006802 -996524363 215603394 709626295 398604088 726418966 -624006326 281999490 788794833 -818079778 -646759678 124560231 592884896 952806972 -746895373 -206268998 888386275 -99752507 -756783901 535873597 -486973681 714128553 -861026266 -79550717 89385423 -248100598 921566907 327952946 -91680621 -199746963 -676725503 -153020286 -817534424 -333850185 -896719970 -417147650 549092977 -474331068 -986279572 -649397961 -386482709 -359576694 83358948 -107798045 320992976 -892902995 892090085 873587856 520818379 635933259 -67528540 -8254256 211660394 -179267206 -459103194 397676755 546951858 276316870 404566419 641937681 426548532 -345…
Output: 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 993574808 …

Example 2:

Input: 399 119 -435766545 -248536100 78384400 359826425 648399787 117354641 -365580531 -272761413 -317973383 930729828 778952055 872832484 -401306697 609641995 -493305405 -620452899 -697444391 -392756718 752916065 364483759 -387900073 -896642016 -665582367 -526081542 -99063402 -810626432 -264105131 81299252 -214890634 -283198221 408684635 -942469407 -776819292 -914203842 814913133 -102426079 -393141669 445965999 648126751 -192125141 230394426 589500952 822482653 592305797 410313103 65580383 -894438419 -554202969 -821389134 280436452 -683901579 339156834 -502018311 236706374 206966569 738234171 76676227 48618387 695689638 970064894 77675174 548158189 -831458559 205731463 -850833754 418965826 510612335 -238020102 123917749 746672172 119669200 -659620186 745745409 -427953871 694922780 -424212358 -59…
Output: 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 970064894 964404395 964404395 964404395 964404395 964404395 964404395 964404395 964404395 964404395 964404395 964404395 964404395 975144914 975144914 975144914 975144914 975144914 975144914 975144914 975144914 …

Example 3:

Input: 1082 558 -212921065 -321434558 656676161 -532509511 850860915 986035952 718890364 998427849 903626682 690924594 -327971879 548947984 -446552982 559674820 103549594 -369585128 -428052129 -658022490 599578295 -951910832 702474234 461001592 906929580 -429198045 707238096 -620830114 953578298 451677163 969111755 -403650521 -105611707 -425049115 510595399 -209802174 -317523104 -706704831 -872942187 -695232545 369336265 -262083577 241303389 -304256165 820694367 691537337 -58126494 -726655515 -299162582 -601805193 -755331531 -91927032 42596233 -25460180 -823847178 58557130 -140199377 629822088 -799375759 577620919 495436375 -172031491 904004966 72154629 -768534468 145557881 -7077303 563431937 926239863 797212607 -455680515 555775491 -551125271 680655622 637093505 780287686 -177239700 -90946420 -6…
Output: 998427849 998427849 998427849 998427849 998427849 998427849 998427849 998427849 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 998264157 …

Constraints:

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

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