#K61862. Maximum Average Speed

    ID: 31404 Type: Default 1000ms 256MiB

Maximum Average Speed

Maximum Average Speed

Given a series of recorded speeds over n minutes, your task is to find the maximum average speed of any continuous subarray with a minimum length of k minutes. Specifically, you are given an array of integers representing speeds at each minute and you must compute the highest average among all possible contiguous sequences that have at least k elements.

Mathematically, for a subarray from index i to j (with j − i + 1 ≥ k), the average is given by ( \frac{\sum_{t=i}^j speeds[t]}{j-i+1} ). Your output should be the maximum such average rounded to two decimal places.

inputFormat

Input is read from standard input. The first line contains two integers ( n ) and ( k ) (the total number of minutes and the minimum subarray length respectively). The second line contains ( n ) space-separated integers representing the recorded speeds.

outputFormat

Output the maximum average speed (as a floating point number rounded to two decimal places) to standard output.## sample

5 3
10 20 30 40 50
40.00