Problem D
D Fyrir Dreki
Languages
en
is

Daði Dreki is always practising on how to become more brave and next up for him is to see how brave he is in the world of mathematics. As everyone knows, only the most daring and bravest can find the roots of a second degree polynomial and thus Daði wants to become one of them. There is one thing that really gets in Daði’s way, that is that some second degree polynomials can have one, two or no real valued roots. Thus he asks you for help in finding how many real valued roots exist to any given second degree polynomial has. Can you help Daði to become more brave?
A second degree real polynomial is an expression of the form
Example of such a polynomials are:
-
where , and -
where , and -
where , and
Input
Input consists of three lines, each one contains one
integer. The first line contains the value of
Output
Output how many real valued roots Daði’s second degree polynomial has.
Scoring
Group |
Points |
Constraints |
1 |
30 |
There always exist two real roots |
2 |
30 |
Either two or no real roots |
3 |
40 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
-5 1 1 |
2 |
Sample Input 2 | Sample Output 2 |
---|---|
1 1 1 |
0 |
Sample Input 3 | Sample Output 3 |
---|---|
2 4 2 |
1 |