#P17259. [ICPC 2017 Urumqi R] Coins

    ID: 19649 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 显示难度普及+/提高− 上传者: 标签>动态规划 DP数学2017概率论期望ICPC

[ICPC 2017 Urumqi R] Coins

Problem Description

Alice and Bob are playing a simple game. They line up a row of nn identical coins, all with the heads facing down onto the table and the tails upward.

For exactly mm times they select any kk 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.

Input Format

The input has several test cases and the first line contains the integer t(1t1000)t (1 \le t \le 1000) which is the total number of cases.

For each case, a line contains three space-separated integers nn, m(1n,m100)m (1 \le n, m \le 100) and k(1kn)k (1 \le k \le n).

Output Format

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

6
2 1 1
2 3 1
5 4 3
6 2 3
6 100 1
6 100 2
0.500
1.250
3.479
3.000
5.500
5.000