Problem Statement | |||||||||||||
John and Brus are bored.
They have n+m common friends.
n of them are bored and m are not.
Every hour John and Brus randomly choose two different friends A and B. If there are several possible pairs (A, B), each one has the same probability of being chosen.
After that, John has a talk with friend A and Brus has a talk with friend B. For each of two chosen friends, if the friend is not
bored, he becomes bored after the talk.
You have to find the expected time for all the friends to become bored. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The returned value must be accurate to within a relative or absolute value of 1E-9. | ||||||||||||
Constraints | |||||||||||||
- | n will be between 1 and 47, inclusive. | ||||||||||||
- | m will be between 1 and 47, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|