CF1111B.Average Superhero Gang Power

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations.

Initially, there are nn superheroes in avengers team having powers a1,a2,,ana_1, a_2, \ldots, a_n , respectively. In one operation, they can remove one superhero from their team (if there are at least two) or they can increase the power of a superhero by 11 . They can do at most mm operations. Also, on a particular superhero at most kk operations can be done.

Can you help the avengers team to maximize the average power of their crew?

输入格式

The first line contains three integers nn , kk and mm ( 1n1051 \le n \le 10^{5} , 1k1051 \le k \le 10^{5} , 1m1071 \le m \le 10^{7} ) — the number of superheroes, the maximum number of times you can increase power of a particular superhero, and the total maximum number of operations.

The second line contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n ( 1ai1061 \le a_i \le 10^{6} ) — the initial powers of the superheroes in the cast of avengers.

输出格式

Output a single number — the maximum final average power.

Your answer is considered correct if its absolute or relative error does not exceed 10610^{-6} .

Formally, let your answer be aa , and the jury's answer be bb . Your answer is accepted if and only if abmax(1,b)106\frac{|a - b|}{\max{(1, |b|)}} \le 10^{-6} .

输入输出样例

  • 输入#1

    2 4 6
    4 7
    

    输出#1

    11.00000000000000000000
    
  • 输入#2

    4 2 6
    1 3 2 3
    

    输出#2

    5.00000000000000000000
    

说明/提示

In the first example, the maximum average is obtained by deleting the first element and increasing the second element four times.

In the second sample, one of the ways to achieve maximum average is to delete the first and the third element and increase the second and the fourth elements by 22 each.

首页