## System(0);

View as PDF

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
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
##### Recipe 3

Calvin is almost finished his math 135 exam, but doesn't want to do the last section. Luckily, he remembered to bring his microscopic Raspberry Pi™, so he can contact his trusty deputy (that's you) to do all the problems for him. Instead of solving the problems one by one, you decide it's easier to solve the general problem. This general problem is as follows: Given a polynomial in the form that has only one real x intercept, find the single root of the function. By peeking at the exam before hand, Calvin saw that none of the polynomials had any imaginary roots. Also, since the professors don't really care, your answer only needs to be accurate to 6 decimal places.

#### Input Specification

Line 1: One integer, .

Next lines: the of these lines has one real number which describes the coefficient for the term . Coefficients will all be given in scientific notation with 12 significant digits (your programming language of choice should be able to read it directly without any issues). 10384.43 for example will be given to you as 1.038443000000e+004.

#### Output Specification

Output one line, the answer. Answers within an absolute or relative error of of the actual answer will be accepted.

#### Sample Input

2
4.000000000000e+000
4.000000000000e+000
1.000000000000e+000

#### Sample Output

-0.500000

#### Explanation for Sample

The input describes the quadratic function . While he was waiting for you (slowpoke), Calvin, having done too much CS went for the obvious brute force solution: the quadratic formula!

Solving for , we find the single real root .

• commented on Sept. 2, 2016, 8:02 p.m.

Is the part intentional?

• commented on Sept. 9, 2016, 9:23 a.m.

It appears that a double has an upper bound of 1.8e+308.

• commented on April 3, 2015, 6:36 p.m.

Is my WA on test 9 due to precision?

• commented on April 3, 2015, 6:40 p.m.

no