Imaginary Date hdu 3569

Imaginary Date

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 125    Accepted Submission(s): 85

Problem Description
XMM met his ex-girlfriend on Double Seventh Festival Day. Though what happened between these two little kids was in the past, there did exist some strange and complicated feelings or something you can call it desire, which XMM cannot deny and tried as hard as he can to keep those things inside to ensure nobody else knows. But as his friends, just to be clear, it is so obvious to us.

So, today is a day. How could XMM possibly give up this wonderful chance? He once again asked XLZ out and then took her to a nice restaurant and prepared to give some delicious chocolate to XLZ to satisfy her which we think is useless.

There are n kinds of chocolate in the restaurant, XLZ likes them in varying degrees. To simplify this, every chocolate have a integer value vi(1 <= vi <= 1000 for all 1 <= i <= n <= 1000). This implies how much XLZ likes it. But since it has been such a long time that XMM Broke up with XLZ, XMM didn’t know it. So he’d like to randomly choose a chocolate every minute to give it to her. The total time XMM has is m minutes (1 <= m <= 1000).But there is another restriction: the kitchen is not so effective so after XMM buy a chocolate, it needs k (1 <= k <= n) minutes to make this kind of chocolate which means the next time XMM can order this is at least k minutes later.

Now we want to know the expect value XLZ gets on that special night.
 

 

Input
The first line is a single integer T indicating the number of cases that follow.
For each case, three integers n, m, k are give in the first line which is mentioned above.
The next line contains n integers which are the value of the n chocolates.
 

 

Output
For each case just output the result in a single line in the format of "Case x: d" in which x is the case number counted from one and d is the expect value that Xlz gets, rounded to 5 digits after the decimal point.
 

 

Sample Input
  
  
2 3 3 1 1 3 5 4 4 4 1 2 3 4
 

 

Sample Output
  
  
Case 1: 9.00000 Case 2: 10.00000
 

 

Author
totalfrank
 

 

Source
 

 

Recommend
zhouzeyong
数学题,要不是网断了昨天比赛时候就能A了……555
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值