luogu#P7795. [COCI 2014/2015 #7] PROSJEK
[COCI 2014/2015 #7] PROSJEK
Problem Description
Given a sequence of integers, find a contiguous subsequence of length at least such that the average value of all numbers in this subsequence is as large as possible.
Input Format
The input has lines.
The first line contains two integers .
The second line contains integers , representing all elements of the sequence .
Output Format
Output one line containing a real number, representing the maximum average value among all contiguous subsequences with length at least .
For each test point, your program will pass if the relative error between your output and the standard answer does not exceed .
4 1
1 2 3 4
4.000000
4 2
2 4 3 4
3.666666
6 3
7 1 2 1 3 6
3.333333
Hint
Constraints
For of the testdata, .
For all testdata, , and .
Source
This problem comes from COCI 2014-2015 CONTEST 7 T5 PROSJEK. With the original testdata configuration, the full score is points.
Translated and organized by Eason_AC.
Translated by ChatGPT 5