atcoder#ABC279D. [ABC279D] Freefall
[ABC279D] Freefall
Score : points
Problem Statement
A superman, Takahashi, is about to jump off the roof of a building to help a person in trouble on the ground. Takahashi's planet has a constant value that represents the strength of gravity, and the time it takes for him to reach the ground after starting to fall is .
It is now time , and . Takahashi will perform the following operation as many times as he wants (possibly zero).
- Use a superpower to increase the value of by . This takes a time of .
Then, he will jump off the building. After starting to fall, he cannot change the value of . Additionally, we only consider the time it takes to perform the operation and fall.
Find the earliest time Takahashi can reach the ground.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the earliest time Takahashi can reach the ground. Your output will be accepted when its absolute or relative error from the true value is at most .
10 1
7.7735026919
- If he performs the operation zero times, he will reach the ground at time .
- If he performs the operation once, he will reach the ground at time .
- If he performs the operation twice, he will reach the ground at time .
- If he performs the operation three times, he will reach the ground at time .
Performing the operation four or more times will only delay the time to reach the ground. Therefore, it is optimal to perform the operation twice before jumping off, and the answer is .
5 10
5.0000000000
It is optimal not to perform the operation at all.
1000000000000000000 100
8772053214538.5976562500