CT47373

Zia's signals Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the railway depot of Cinderline; Zia weighs the day's signals 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: 8 8 72584107 809246842 81362491 -592368471 239485792 173538684 -787857469 -668074277
Output: 809246842

Example 2:

Input: 1307 468 -447023619 744476531 -369548499 30946583 399255671 295015239 -768804753 -26546933 -405134371 -680857312 -132436519 -616671003 975100352 980812735 -779495860 439609462 485748207 -887621661 316143496 709121022 -64630550 -358291985 -459170299 -775949168 704407959 -612037396 590141994 447803923 -475676018 234729196 -6085196 267807633 -449048719 509908319 -306824679 -162948938 345958450 465228526 925511344 737403528 852515992 -533709739 942845294 394098506 510004127 -147893219 -689059669 96244326 510974929 -504916672 833505280 -445463182 758842587 -102992841 -115589402 596733063 250509906 139802490 -730013376 438227546 857262396 539937755 708925262 -14494131 714782467 -72372641 679508271 620146345 -309834955 -948356664 -23163506 416731744 -72506626 540277557 -54539127 88638611 57302271…
Output: 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 998958915 …

Example 3:

Input: 322 73 -133553126 974020700 -701188286 -622095832 -868916669 -117604310 -870574069 -12837126 -88014045 -728148862 482734789 596474523 670627167 -28875182 392485515 255003893 777754390 237485100 510805361 850329377 719272670 -371000394 46088207 -813762629 83228615 925882390 -296488580 282209019 653221278 916028148 528882528 -681995118 500142134 -608710335 823756381 443028835 -838961041 503600069 268120539 -846062518 26494400 -376982679 -703455747 -467052794 -299504781 -670289059 709720279 322612231 -476827941 837502966 593765866 901233736 -942493984 -858103630 -724417912 291543909 660559390 -984097734 551622797 -693106789 746558534 638294362 638627877 66840575 -742248773 471941790 -420233795 -156789709 -599266947 625976726 28360580 597205320 -659418174 302438690 -602057387 256962003 8412054…
Output: 974020700 974020700 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 925882390 952734019 952734019 952734019 952734019 952734019 952734019 952734019 952734019 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 968483929 …

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Zia's signals Reckoning - MEDIUM Coding Problem | CodeTikki