「一本通 1.2 例 2」Best Cow Fences
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
农夫约翰的农场由 块田地组成,每块地里都有一定数量的牛,第 块田地的牛的数量记作 。
约翰希望用围栏将一部分连续的田地围起来,并使得围起来的区域内每块地包含的牛的数量的平均值达到最大,围起区域内至少需要包含 块地 。
在给定条件下,计算围起区域内每块地包含的牛的数量的平均值可能的最大值是多少。
形式化:
- 给定一个长度为 的非负整数序列 ,求一个平均数最大的、长度不小于 的子段。
输入格式
第一行用空格分隔的两个整数 和 ;第二行为 个用空格隔开的非负整数,表示 。
输出格式
一个整数,表示这个平均数的 倍。不用四舍五入,直接输出。
样例
10 6
6
4
2
10
3
8
5
9
4
1
6500
数据范围与提示
数据范围
来源
USACO 2003 March Green
C23暑假作业2-二分-基础题
- Status
- Done
- Problem
- 8
- Open Since
- 2024-7-5 0:00
- Deadline
- 2024-10-27 23:59
- Extension
- 24 hour(s)