题目描述
Problem Description
"In the casino, the cardinal rule is to keep them playing and to keep them coming back. The longer they play, the more they lose, and in the end, we get it all."
(from the 1995 film Casino)
Recent economic downturns have not been favorable to entertainment venues, including the gambling industry. Casinos are fiercely competing to attract wealthy players, and some have started offering particularly generous deals. One casino offers the following promotion: you can gamble as much as you like in the casino. When you finish, if you have lost any amount compared to when you started, the casino will refund $x\%$ of your losses. Obviously, if you are ahead, you can keep all of your winnings. This offer has no time limit or monetary limit, but you can redeem it only once.
For simplicity, assume all bets cost $1$ dollar and pay out $2$ dollars. Now suppose $x$ is $20$. If you make a total of $10$ bets before quitting and only $3$ of them win, your total loss is $3.2$ dollars. If $6$ of them win, you have gained $2$ dollars.
Given $x$ and the percentage probability $p$ of winning any individual bet, write a program to determine the maximum expected profit you can make from betting at this casino using any gambling strategy.
Input Format
The input consists of a single test case. A test case consists of the refund percentage $x (0 \leq x < 100)$ followed by the winning probability percentage $p (0 \leq p < 50)$. Both $x$ and $p$ have at most two digits after the decimal point.
Output Format
Display the maximum expected profit with an absolute error of at most $10^{-3}$.
Sample Input and Output
Sample Input #1
0 49.9
Sample Output #1
0.0
Sample Input #2
50 49.85
Sample Output #2
7.10178453
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分