Problem K
Monty's Hall

However, it turns out that you are the first explorer to find him in over a hundred years, so he has grown incredibly bored. Instead of a fight, he offers to play a game for his artefacts. The hall has $d$ closed doors, but only one of them leads to the artefacts (Monty knows which one it is, of course). The procedure is as follows:
-
You choose $s$ closed doors.
-
Monty opens $e$ doors that were not selected by you and lead to empty rooms.
-
Among the remaining closed doors, you may change your selection of $s$ doors however you want (you can even stay with your current selection if you wish to).
-
Monty reveals which door leads to the room with his artefacts.
If the door with the artefacts is among your selected doors, you win and can take them with you unscathed. If not, Monty will transform you into a goat. So you better hope your luck is on point today.
Input
The input consists of:
-
One line with three integers $d$, $s$ and $e$ ($1 \le d,s,e \le 10^{6}, s + e < d$), the number of doors in Monty’s hall, the number of doors you are allowed to select and the number of doors Monty opens in step 2.
Output
Output your chance to win at Monty’s game when playing optimally. Your answer should have an absolute or relative error of at most $10^{-6}$.
Sample Input 1 | Sample Output 1 |
---|---|
3 1 1 |
0.666667 |
Sample Input 2 | Sample Output 2 |
---|---|
8 4 2 |
0.75 |
Sample Input 3 | Sample Output 3 |
---|---|
15 4 2 |
0.32592593 |