Problem C
Mining Race
Notch is holding a race for Steve and Alex to see who is the
better miner. The rules are simple: they must each move
Steve and Alex do not want to take the same mining path, to
avoid getting in each other’s way or mining blocks for their
opponent. To avoid this, Alex decides to move
![\includegraphics[width=400px]{miningrace.png}](/problems/miningrace/file/statement/en/img-0001.png)
Notch wants to know whether or not their paths will
intersect. Assuming that both Steve and Alex choose their path
randomly and independently (that is, each chooses a
randomly-ordered sequence of
Input
The input is a single line containing two integers
Output
Output a single line containing the probability of Steve and
Alex’s mining paths intersecting. Your answer will be
considered correct if its absolute or relative error doesn’t
exceed
Sample Input 1 | Sample Output 1 |
---|---|
5 3 |
0.0318877551 |
Sample Input 2 | Sample Output 2 |
---|---|
2 1 |
0.4444444444 |
Sample Input 3 | Sample Output 3 |
---|---|
3 3 |
0.0025000000 |