PivotOJ

Monty's Hall

시간 제한: 1000ms메모리 제한: 1024MB출처: GCPC 2021BOJ 25257

문제

You have explored the deep catacombs under a long lost city for the past couple of hours and finally you have reached their end: The hall of the undead wizard Monty. His restless spirit materialises in front of you and you prepare for battle.

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 dd closed doors, but only one of them leads to the artefacts (Monty knows which one it is, of course). The procedure is as follows:

  1. You choose ss closed doors.
  2. Monty opens ee doors that were not selected by you and lead to empty rooms.
  3. Among the remaining closed doors, you may change your selection of ss doors however you want (you can even stay with your current selection if you wish to).
  4. 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.

입력

The input consists of:

  • One line with three integers dd, ss and ee (1d,s,e106,s+e<d1 \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 your chance to win at Monty's game when playing optimally. Your answer should have an absolute or relative error of at most 10610^{-6}.

예제

예제 1

입력
3 1 1
출력
0.666667

예제 2

입력
8 4 2
출력
0.75

예제 3

입력
15 4 2
출력
0.32592593
코드를 제출하려면 로그인하세요.