Dice War

Time Limit: Java: 2000 ms / Others: 2000 ms

Memory Limit: Java: 65536 KB / Others: 65536 KB

[显示标签]

Description

Dice war is a board game. In each turn, the attacker will choose a pile of dices to attack the defender's pile of dices. They will roll the all dices, and the attacker will win if and only if the total number on all his dices is larger than the defenders. After a successful attack, the attacker's pile of dices will split into two piles, while one of them has only one dice. If the attacker loses, this pile will lose all dices except one. An attack cannot be made with a pile of one single dice.

Input

Multiple cases. Each case contains two number of dices in the attacker's pile and the diffender's pile. In the game, number of dices in a pile will be no more than 8.

Output

For each case, output the probability of attack success in a single line. Error no more than 1e-4 will be accepted.

Sample Input

3 2
2 1

Sample Output

0.7785493827160493
0.8379629629629629

Hint

None

Source

ZOJ Monthly, February 2011

提交代码