Since UCup is also short on heads, and the AI for generating the next-next problem did not perform as expected, the Fish King Qingyu retrained a New AI.
The Fish King Qingyu's New AI refuses to work 996 hours, so it demands that Qingyu play a game with it first.
The player plays a monster-fighting game where the player has $n$ health points and the monster has $m$ health points.
At any moment, the player can choose one of the following two operations:
- (Attack): The player performs an attack skill, which requires $1$ unit of time for cooldown. After the cooldown, the attack succeeds with probability $p$, reducing the monster's health by $1$. With probability $1-p$, the attack fails, reducing the player's health by $1$.
- (Restart): The player gives up the current round and decides to restart. This operation takes no time, and the player's health is restored to $n$, while the monster's health is restored to $m$.
When the player's health reaches $0$, the player dies and must choose to restart. When the monster's health reaches $0$, the player wins.
Qingyu wants to know: if the player adopts the optimal strategy, what is the expected time required for the player to win?
Since Qingyu's playing time cannot exceed $10^9$ units of time, if the player cannot win after $10^9$ units of time, output $10^9$.
Input
The input consists of a single line containing three integers $n, m, c$, where $p = \displaystyle \frac{c}{100}$.
Output
Output a single real number representing the minimum of the answer and $10^9$.
Your answer will be considered correct if its relative or absolute error does not exceed $10^{-6}$.
Examples
Input 1
2 1 10
Output 1
10.0
Note 1
Since the monster only has $1$ health point, the answer is the expected number of attack rounds to kill the monster, which is $1/p = 10$. Note that since restarting takes no time, the player's death does not affect the answer.
Input 2
2 2 1
Output 2
5125.12562814070456340687
Input 3
50 60 99
Output 3
60.60606060606060606355
Input 4
114 514 19
Output 4
1000000000.00000000000000000000
Subtasks
This problem uses bundled testing; you must pass all test cases in a subtask to receive points for that subtask.
For all data, $1 \leq n,m \leq 1\,000$ and $0 < c < 100$. The detailed constraints are as follows:
| Subtask ID | Special Properties | Score |
|---|---|---|
| $1$ | $n=1$ | $10$ |
| $2$ | $n\leq 2$ | $10$ |
| $3$ | $n\leq 3$ | $10$ |
| $4$ | $m=1$ | $10$ |
| $5$ | $m\leq 2$ | $10$ |
| $6$ | $m\leq 3$ | $10$ |
| $7$ | $n,m\leq 10$ | $10$ |
| $8$ | $c=1$ | $15$ |
| $9$ | No additional constraints | $15$ |