Weightlifting competitions at the Olympic Games are about to begin — it is time to impress your fans!
To perform a sequence of lifting attempts, you are given a constant strength and a decreasing energy reserve .
For each attempt, you may choose any positive (not necessarily integer) weight .
If S \ge W, the lift is successful, and your energy decreases by E_{succ}.
If S < W, the attempt fails, and your energy decreases by E_{fail}.
You may continue making attempts while E > 0.
As soon as E \le 0, no further attempts can be made.
Your result is the maximum weight (in kilograms) that you successfully lift, or if all attempts fail.
Ideally, you would lift exactly at your strength limit. However, the exact value of is unknown to you. You only know that you can certainly lift an Olympic barbell weighing kg, and that the maximum possible weight is kg (i.e., up to kg of plates on each side plus the bar).
How close to the optimal result can you guarantee to get? In other words, find the minimum value such that you can guarantee a result of at least S - d.
Three integers , E_{succ}, and E_{fail} (1 \le E, E_{succ}, E_{fail} \le 10^7).
Print the minimum value with precision up to digits after the decimal point.
Example 1
Example 2
Example 3