CT62497

The Peak per Window of the Wistful marks

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The harbor bell rings at the peat bogs of Mossgrieve; Blythe weighs the day's marks manifests and starts the calculations. 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: 821 759 -620719936 -564494738 169532471 143797830 870364701 -325187384 96402493 -668205133 -99635213 234732440 606687112 -318206934 30179644 -980491666 892046052 -215642559 -24756803 25018974 319610254 807320297 -846074842 156822822 21057412 967056184 637611368 516657736 730163040 -942147365 -367033395 948418286 -547455095 -632367647 326636703 888403221 -783111836 842364808 -694995562 -233576619 45887855 295867999 -836993839 573802013 783980358 910554619 -824894494 956034886 -821661905 496395158 205267932 881034819 328885419 716102921 158000960 -996490074 -967934008 -618767920 335667235 763516199 -51499601 -323259058 -241844278 378039258 190863105 999607762 417268961 283037438 -245821801 -767262928 -578888852 -669683444 -423830776 910152882 -170454020 277084052 247818067 739458539 -3724768…
Output: 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762 999607762

Example 2:

Input: 3568 2350 -367231382 988417448 334142646 -290420647 223040005 -847942867 -438512146 -279807393 581213125 -423799111 830519541 563310148 -895432965 691199914 495590130 656123006 868894991 -748544470 495923430 -804942522 -683936374 687524866 -700130857 -577127741 113953122 -900809157 -12314521 -833838877 192449493 -904555217 -135552671 193855625 753055622 929788341 -596811532 351131177 523739433 -596136177 -708780485 833080102 -453454091 -783571449 -835347751 649324649 -625372047 255247116 674108527 976411639 660695739 382900526 540317025 -598876065 422656808 -108249204 442656460 109990837 -138036395 -139827537 985450624 -643992185 679446873 252856401 699979612 594933780 -466058858 435838682 453439180 -153790452 -292660817 -549002153 -749195974 -547314822 -557169818 -532099609 886527763 -406…
Output: 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 997280479 …

Example 3:

Input: 2412 2140 -968131934 -335686371 443312153 660298076 -473490842 679092235 -546413374 613203163 875152570 -251490103 -858471092 290890303 389307192 -626527283 766834335 -31269768 54897767 242867596 -34728825 770047533 946073352 173794495 968312874 815666768 -198295226 993669665 -265950569 -457966364 -919628004 580720776 968981007 252427742 338458755 -17419810 161602286 106084735 -6730928 300380016 -758868192 494671006 305275888 827893890 378885405 -48400264 307415071 940674645 423052571 896999367 486790399 -57667847 -305432518 -238417870 -265831421 -30934314 776526921 -601003569 -63249596 114728895 -162599554 -420419263 -391050198 -947485526 462064798 -40222373 979080448 110560440 -350006439 390662085 -32480602 665565366 825913110 537409229 -386724735 269224330 499655823 836073477 582150297 …
Output: 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 999450472 …

Constraints:

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

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