- Time limit: 1.00 s
- Memory limit: 128 MB
Uolevi is playing a game with a dice. The game consists of n turns. Initially Uolevi has c coins. On each turn Uolevi throws a dice with s sides. The sides contain numbers from 1 to s. If the number on the top of the dice is at least p, Uolevi wins w coins. Otherwise Uolevi loses 1 coin. If Uolevi loses all his coins, he can't play anymore.
What is the probability that Uolevi has more coins in the end than in the beginning?
Input
The first and only line of the input contains integers n, c, s, p and w.
Output
Output a decimal number between 0 \ldots 1: the probability that Uolevi has more coins in the end than in the beginning.
Your output is correct if the absolute error is less than 10^{-8}. In C++ you can use the following code to output the answer (where p
is the probability):
cout<<setprecision(15)<<p;
In Java you can use the normal output method (println).
Constraints
- 1 \le n \le 1000
- 1 \le c \le 1000
- 1 \le s \le 1000
- 1 \le p \le s
- 1 \le w \le 10^5
Example
Input:
2 1 2 2 1
Output:
0.25