创想实验室
我们都是梦想家

Coins

描述

Alice and Bob are playing a simple game. They line up a row of nn identical conins, all with the heads facing down onto the table and the tails upward.
For exactly m times they select any k of the coins and toss them into the air, replacing each of them either heads-up or heads-down with the same possibility. Their purpose is to gain as many coins heads-up as they can.

输入

The input has several test cases and the first line contains the integer t (1t1000) which is the total number of cases.
For each case, a line contains three space-separated integers n, m (1n,m100) and k (1kn)

输出

For each test case, output the expected number of coins heads-up which you could hava at the end under the optimal strategy, as a real number with the precision of 2 digits.

样例输入

6
2 1 1
2 3 1
5 4 3
6 2 3
6 100 1
6 100 2

样例输出

0.50
1.25
3.48
3.00
5.50
5.00

代码

 

网站所发布的代码已提交通过,代码可能经过修改防止抄袭,未经允许不得转载:创想实验室 » Coins
分享到: 更多 (0)

评论 5

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #2

    dalao

    77yy11个月前 (12-13)回复
    • 0.0 no no no 你们才是

      shysimon11个月前 (12-13)回复
  2. #1

    dalao

    taoting11个月前 (12-13)回复
    • 0.0 no no no 你们才是

      shysimon11个月前 (12-13)回复