题目描述
Problem Description
Aoki is trying to find Takahashi, who is lost in a one-dimensional world. Initially, Aoki is at coordinate $0$ and Takahashi is at coordinate $x$. After that, Aoki cannot know where Takahashi is.
Time is divided into turns, and the following actions occur simultaneously each turn:
- Aoki, who is currently at coordinate $a$, can choose to move to $a-1$, $a$, or $a+1$.
- Takahashi, who is currently at coordinate $b$, moves to $b-1$ with a probability of $p$ percent, and to $b+1$ with a probability of $100-p$ percent.
When Aoki and Takahashi reach the same coordinate, Aoki can find Takahashi. If they pass each other, Aoki cannot find Takahashi.
Aoki wants to minimize the expected number of turns to find Takahashi. Find this expected value.
Input Format
The input is given from the standard input in the following format:
$ x $ $ p $
Output Format
Output the expected value in one line. The answer will be considered correct if the absolute or relative error is at most $10^{-6}$.
Sample Input and Output
Sample Input #1
3
100
Sample Output #1
2.0000000
Sample Input #2
6
40
Sample Output #2
7.5000000
Sample Input #3
101
80
Sample Output #3
63.7500000
Notes/Hints
Constraints
- $1 \leq x \leq 1,000,000,000$
- $1 \leq p \leq 100$
- $ x $ and $ p $ are integers.
Partial Points
- For a dataset worth $200$ points, $ p=100 $ holds.
- For a dataset worth $300$ points, $x \leq 10$ holds.
Sample Explanation 1
Since Takahashi always moves $ -1 $, Aoki can move to coordinate $ 1 $ on the first turn and stay there on the second turn to find Takahashi in $ 2 $ turns.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分