Fred has a rocket! He wants the rocket to fly high, but doesn't the rocket to consume too much fuel. Knowing the various relevant concepts in physics, chemistry, and biology, he has deduced that the maximum height of the rocket is the result of a cubic polynomial , where is the fuel setting on the rocket booster. Furthermore, you can assume that , as a higher rocket booster setting always corresponds to higher height. Of course, a higher rocket booster setting will result in more fuel being consumed, so Bob wants you to find the minimum booster setting (value of ) such that the maximum height (value of ) is at least . Do note that must be nonnegative.
For this problem, using double precision float pointing numbers (double in java and c++) is recommended
Constraints
Input Specification
The first line contains 4 decimal values, corresponding to , , , and , respectively.
Output Specification
One line with one decimal value, the minimum value of such that . Your answer will be regarded as correct if its absolute value from the accepted answer is less than or equal to
Sample Input
1 2 3 6
Sample Output
1.0
Sample Explanation
is the minimum value such that
Comments