## Root Solver

Write a program that solves for the root of a univariate polynomial with a maximum degree of 100.

### Input Format

Line 1 of the input contains an integer `T` (1 ≤ `T` ≤ 101), indicating the number of terms in the polynomial.

The next T lines each contain a real number coefficient and a whole number exponent from 0 to 100 inclusive.

Terms will always be collected (i.e. exponents will not be repeated) and arranged in descending powers.

### Output Format

In order from lowest value to highest value, every real solution for when the polynomial is equal to zero.

Your answer must be accurate within ±10^{-5}.

If there are no real solutions to the equation, output "NO REAL ROOTS".

**Note:** Coefficients and answers can have up to 18 digits, and will fit inside a long double.

### Sample Input 1

2 2 3 -54 0

### Sample Output 1

3

### Explanation

This asks for the solution(s) of `x` for the equation .

### Sample Input 2

3 3 2 4 1 -20 0

### Sample Output 2

-3.33333 2

### Explanation

This asks for the solution(s) of `x` for the equation .

All Submissions

Best Solutions

**Point Value:** 30 (partial)

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** Jul 28, 2012

**Author:** Alex

**Languages Allowed:**

C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

Alexon Aug 04, 2012 - 12:18:32 am UTC Test cases are updatedSourSpinachon Aug 04, 2012 - 4:30:02 am UTC Re: Test cases are updatedBut good, I didn't expect my program to actually work right away.

Alexon Aug 15, 2012 - 2:55:26 am UTC Re: Re: Test cases are updatedSourSpinachon Aug 15, 2012 - 3:48:23 am UTC Re: Re: Test cases are updatedfrenzybenzyon Aug 13, 2012 - 8:38:17 pm UTC SpoilersSourSpinachon Jul 30, 2012 - 4:49:25 am UTC Huh?If this is really what's intended, then the problem statement should reflect it, and the point value should be reduced. Otherwise, larger cases should be added.

Alexon Jul 30, 2012 - 6:44:30 am UTC Re: Huh?Danielon Jul 30, 2012 - 1:25:44 pm UTC Re: Re: Huh?Alexon Jul 30, 2012 - 6:24:03 pm UTC Re: Re: Huh?SourSpinachon Jul 31, 2012 - 4:34:27 am UTC Re: Re: Huh?