Bobo is playing a game called Brotato. The game consists of $$$n$$$ levels, each of which he can either pass or fail. Each level has a probability $$$p$$$ of failure and a probability $$$1-p$$$ of passing. If Bobo fails a level, he must normally restart from the first level.
Bobo is quite frustrated about the fact that each time he dies, he has to start over from the very beginning. Therefore, Bobo decided to cheat. Now, Bobo has $$$k$$$ special items that allow him to continue from the same level after a failure rather than restarting from the beginning.
Given this setup, determine the minimum expected number of attempts for levels needed for Bobo to complete all $$$n$$$ levels.
The first line contains two integers $$$n,k$$$ ($$$1 \le n\leq 10^5, 0 \le k\leq 10^9)$$$, denoting the number of levels and the number of items, respectively.
The second line contains a number $$$p$$$ $$$(0 \lt p\leq 0.5)$$$. It is guaranteed that $$$p$$$ has at most $$$4$$$ decimal places.
It is guaranteed that $$$np\leq 20$$$.
Output a number in a line denoting the answer.
Your answer is considered correct if its absolute or relative error doesn't exceed $$$10^{-9}$$$. Namely, if your answer is $$$a$$$, and the jury's answer is $$$b$$$, then your answer is accepted if $$$\frac{|b-a|}{\max(b,1)} \le 10^{-9}$$$.
5 00.5
62.0000000000
5 10.5
47.0000000000
10000 00.002
247489700298.2536834329
100000 100.0002
38767507133.2322179824