Problem K
The Shaft

Ivan is exploring a planet in Stellar Skirmishes: The Game, and finds an old abandoned mine shaft. In order to gauge its depth, he drops a rock down the shaft (being careful to let go of it so that it starts with zero velocity) and starts an in-game stopwatch at precisely the same time that he lets go of the rock. He then hears the sound of the rock hitting the bottom after $t$ seconds; the total time $t$ consists of the time for the rock to fall from the top of the shaft to the bottom, plus the time for the sound to travel from the bottom of the shaft to the top. Thanks to SSTG’s somewhat realistic physics engine, he should be able to use this information to calculate the depth of the shaft, given the gravity of the planet and the speed of sound in the planet’s atmosphere.
Although SSTG’s physics engine can accurately simulate gravity and propagation of sound waves, Ivan knows that it does not simulate drag due to air resistance, nor does it simulate changes in gravity due to distance from the center of a planet. Therefore, he can assume that the rock continues to accelerate at a constant rate $g$ all the way down.
Input
The first and only line of input contains three space-separated floating-point values:
-
$g$, the gravitational acceleration of the planet, measured in meters per second per second ($1 \leq g \leq 50$).
-
$c$, the speed of sound in the planet’s atmosphere, measured in meters per second ($1 \leq c \leq 1000$).
-
$t$, the time from dropping the rock to hearing it hit the bottom, measured in seconds ($0 < t \leq 10^6$).
Output
Output the depth of the shaft in meters. It is guaranteed that the shaft is at most $10^{18}$ meters deep. Your answer will be considered correct if it is within $0.0001\% $ of the correct answer, that is, if it has a relative error of at most $10^{-6}$.
Sample Input 1 | Sample Output 1 |
---|---|
9.8 295.0 2.066440678 |
19.6 |
Sample Input 2 | Sample Output 2 |
---|---|
25.92 1000.0 9.78410461158 |
1000.0 |