Problem O
Remote Getaway

While exploring the outer islands in the End, Alex committed the great taboo — she turned around too quickly and accidentally made eye contact with a nearby enderman! Enraged by this breach of etiquette, the ender elders immediately met and voted Alex off of their island.
Thrown off into the void between islands, Alex’s survival hinges on her stopping her free fall into the abyss. Thankfully, she has an ender pearl on her, that, when thrown, will teleport her to wherever it lands. She has a single chance to throw the pearl to the next closest island. To return to safety, she must teleport to the surface of the island, not to any of its cliffs. Since she only has one chance, she will throw the pearl as hard as she can, but she can vary the direction she throws it.
Given $v$ and $h$, her vertical and horizontal displacement from the edge of the island in blocks (meters), the speed $s$ with which she can throw the pearl (m/s), and the acceleration $g$ due to gravity ($\text{m}/\text{s}^2$), can she make the throw successfully? You may assume that Alex is currently stationary relative to the island, and that air resistance is negligible.
![\includegraphics[width=0.5\textwidth ]{graphic.png}](/problems/remotegetaway/file/statement/en/img-0002.png)
Sample 1 Visualization, Minecraft 1.21.5
Input
The input consists of four floating-point values: $v$, $h$, $s$, and $g$. You are given that $-10^5 \le v \le 10^5$, $1 \le h \le 10^5$, $1 \le s \le 10^3$, $1 \le g \le 100$. All floats have at most 4 digits after the decimal.
Note that a negative value of $v$ indicates that she is currently below the surface of the target island.
Output
Output ’YES’ if she can make the throw and ’NO’ if she cannot.
For all inputs, changing the vertical displacement by $10^{-4}$ will not change the answer.
Sample Input 1 | Sample Output 1 |
---|---|
-1.0 10.0 10.0 5.0 |
YES |
Sample Input 2 | Sample Output 2 |
---|---|
-10.0 10.0 10.0 5.0 |
NO |
Sample Input 3 | Sample Output 3 |
---|---|
20.0 30.0 10.0 6.0 |
YES |