#H. 「一本通 1.2 例 2」Best Cow Fences

    Type: Default 1000ms 512MiB

「一本通 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.

题目描述

农夫约翰的农场由 NN 块田地组成,每块地里都有一定数量的牛,第 ii 块田地的牛的数量记作 AiA_i

约翰希望用围栏将一部分连续的田地围起来,并使得围起来的区域内每块地包含的牛的数量的平均值达到最大,围起区域内至少需要包含 FF 块地 (1FN)(1≤F≤N)

在给定条件下,计算围起区域内每块地包含的牛的数量的平均值可能的最大值是多少。

形式化

  • 给定一个长度为 nn 的非负整数序列 AA ,求一个平均数最大的、长度不小于 LL 的子段。

输入格式

第一行用空格分隔的两个整数 nnLL;第二行为 nn 个用空格隔开的非负整数,表示 AiA_i

输出格式

一个整数,表示这个平均数的 10001000 倍。不用四舍五入,直接输出。

样例

10 6
6
4
2
10
3
8
5
9
4
1
6500

数据范围与提示

数据范围

1n105,0Ai20001 \leq n \leq 10^5,0 \leq A_i \leq 2000

来源

USACO 2003 March Green

C23暑假作业2-二分-基础题

Not Claimed
Status
Done
Problem
8
Open Since
2024-7-5 0:00
Deadline
2024-10-27 23:59
Extension
24 hour(s)