#P17259. [ICPC 2017 Urumqi R] Coins
[ICPC 2017 Urumqi R] Coins
Problem Description
Alice and Bob are playing a simple game. They line up a row of identical coins, all with the heads facing down onto the table and the tails upward.
For exactly times they select any 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 which is the total number of cases.
For each case, a line contains three space-separated integers , and .
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 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