#P1404. 平均数
平均数
Description
Given a sequence of length , find a contiguous subarray whose average is maximized, with the subarray length .
Input Format
The first line contains two integers and .
The next lines each contain an integer , representing the -th number of the sequence.
Output Format
Output a single integer: times the maximum average. If there is a fractional part, truncate it directly; do not round.
10 6
6
4
2
10
3
8
5
9
4
1
6500
Hint
Constraints
- For of the testdata, it is guaranteed that 。
- For of the testdata, it is guaranteed that , 。
Translated by ChatGPT 5
京公网安备 11011102002149号