#P1404. 平均数
平均数
平均数
- 时间限制:1 秒
- 内存限制:512 MiB
题目描述
给一个长度为 的数列,我们需要找出该数列的一个子串,使得子串平均数最大化,并且子串长度 。
English translation
Statement
Given a sequence of length , find a contiguous subarray whose average is maximized, with the subarray length .
输入格式
第一行两个整数 和 。
接下来 行,每行一个整数 ,表示序列第 个数字。
The first line contains two integers and . The next lines each contain an integer , representing the -th number of the sequence.
输出格式
一个整数,表示最大平均数的 倍,如果末尾有小数,直接舍去,不要用四舍五入求整。
Output a single integer: times the maximum average. If there is a fractional part, truncate it directly; do not round.
样例输入 1
10 6
6
4
2
10
3
8
5
9
4
1
样例输出 1
6500
数据范围
-
对于 的数据,保证 ;
-
对于 的数据,保证 ,。
-
For of the testdata, it is guaranteed that 。
-
For of the testdata, it is guaranteed that , 。