#K71832. Maximum Average Speed

    ID: 33619 Type: Default 1000ms 256MiB

Maximum Average Speed

Maximum Average Speed

You are given speed logs for n days and an integer k. Your task is to compute the maximum average speed over any consecutive k days. The answer should be rounded to two decimal places.

The average for a segment of days is computed as follows:

\(\text{average} = \frac{\sum_{i=1}^{k}{s_i}}{k}\)

where \(s_i\) is the speed on day \(i\). Use a sliding window technique to efficiently compute this value.

inputFormat

The input is read from standard input (stdin) and consists of two lines.

  • The first line contains two integers \(n\) and \(k\) separated by a space, where \(n\) is the total number of days and \(k\) is the number of consecutive days to consider.
  • The second line contains \(n\) space-separated integers representing the speeds for each day.

outputFormat

Output the maximum average speed, rounded to two decimal places, on a single line to standard output (stdout).

## sample
7 3
1 12 5 2 8 7 10
8.33