题目描述
Problem Description
Physics enthusiast and Hirakichi came to the game center to play the highly popular music game, "IROHATHM". Finding just playing the game to be uninteresting, they decided to play the following game to distribute their money before starting to play.
- Prepare boxes \( A, B, C \).
- Put \( A_1 \) 100-yen coins and \( A_2 \) 50-yen coins in box \( A \).
- Put \( B_1 \) 100-yen coins and \( B_2 \) 50-yen coins in box \( B \).
- Put \( C_1 \) 100-yen coins and \( C_2 \) 50-yen coins in box \( C \).
- Starting from the physics enthusiast, they alternately perform the action of "choosing any box that contains coins at that moment, and randomly taking out one coin from the chosen box" until all coins are removed. Both parties can know whether the taken-out coin is a 100-yen coin or a 50-yen coin.
When both parties play this game to maximize the expected value of their final money, please calculate the expected value of the amount of money that the physics enthusiast will finally have. Assume that the 100-yen coins and 50-yen coins are very similar, and the probability of taking out either is equally likely.
Input Format
\( A_1\ A_2 \) \( B_1\ B_2 \) \( C_1\ C_2 \)
Output Format
Output the solution in one line. However, the error is allowed up to an absolute or relative error of \( 10^{-9} \).
Sample Input and Output
Sample Input #1
1 1
1 0
1 0
Sample Output #1
175.000000000000
Sample Input #2
0 0
0 0
1 10
Sample Output #2
327.272727272727
Sample Input #3
5 6
7 8
9 10
Sample Output #3
1686.539074960127
Notes/Hints
Constraints
- All inputs are integers.
- \( 0 \leq A_1, A_2, B_1, B_2, C_1, C_2 \leq 10 \)
- There is at least one coin in total.
Explanation
Sample Explanation 1
There are two boxes that guarantee a 100-yen coin and one box with one 100-yen coin and one 50-yen coin. Both parties can ensure 100 yen in the first turn, and then the physics enthusiast draws one coin from box \( A \), which results in an expected value of 175 yen.
Sample Explanation 2
There is only one box with coins, so they can only alternately draw one coin from box \( C \). The probability of drawing a 100-yen coin at any time is \( \frac{1}{11} \), so the physics enthusiast has a \( \frac{6}{11} \) chance of drawing a 100-yen coin in six turns. Therefore, the expected value is \( \frac{6}{11} \times 350 + \frac{5}{11} \times 300 = \frac{3600}{11} \).
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分