## DMOPC '14 Contest 8 P1 - Flare

View as PDF

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

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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 in relation to its initial velocity , Earth's gravitation and time given as:

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

#### Input Specification

A single integer, .

#### Output Specification

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

#### Sample Input

10

#### Sample Output

2.040816

#### Explanation of Output for Sample Input

Substituting in for , we find that .

Here is a displacement-time graph of the flare:

• commented on May 5, 2015, 8:55 p.m. edited

I'm pretty sure that the gravity should be instead of

• commented on May 5, 2015, 9:23 p.m.

Indeed it should be, thanks.

• commented on May 5, 2015, 4:07 p.m.

First paragraph says Tusk, second says Ange

• commented on May 5, 2015, 4:29 p.m.

Ange launches the flare Tusk prepared.

• commented on May 5, 2015, 11:39 p.m.

rip sas5580