DMOPC '14 Contest 7 P1 - Flare

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Stranded on an island, Tusk decides to launch a signalling flare, but forgets to angle it towards the water. As a result, it takes off perpendicular to the ground. Its height y in relation to its initial velocity v, Earth's gravitation g=9.8ms2 and time t given as:

y=vt+12gt2

If Ange launches the flare from the ground where y=0 at time t=0, how long does Ange have to get out of the way before the flare comes burning down?

Input Specification

A single integer, v (1v109).

Output Specification

The time elapsed until the flare touches the ground, i.e. the value of t>0 such that the expression evaluates to 0. Your answer will be considered correct if it is within an absolute or relative error of 106.

Sample Input

Copy
10

Sample Output

Copy
2.040816

Explanation of Output for Sample Input

Substituting in 2.040816 for t, we find that 10×2.040816+12×(9.8)×(2.040816)20.

Here is a displacement-time graph of the flare:


Comments


  • 0
    sas5580  commented on May 5, 2015, 8:07 p.m.

    First paragraph says Tusk, second says Ange


    • 1
      FatalEagle  commented on May 5, 2015, 8:29 p.m.

      Ange launches the flare Tusk prepared.