530A.md (964B)
1 Source: https://codeforces.com/problemset/problem/530/A 2 3 A. Quadratic equation 4 5 time limit per test 6 7 2 seconds 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 standard input 16 17 output 18 19 standard output 20 21 You are given a quadratic equation with integer coefficients *A* * *X*2 + *B* * *X* + *C* = 0. It is guaranteed that *A* ≠ 0 and that the equation has at least one real root. Output the roots of the equation. 22 23 Input 24 25 The only line of input contains integers *A*, *B* and *C* ( - 1000 ≤ *A*, *B*, *C* ≤ 1000, *A* ≠ 0), separated by spaces. 26 27 Output 28 29 Output the roots of the equation in increasing order. If the equation has a single root of multiplicity 2, output it once. The root is considered to be correct if its absolute or relative error does not exceed 10- 4. 30 31 Examples 32 33 Input 34 35 ``` 36 1 -2 1 37 ``` 38 39 Output 40 41 ``` 42 1 43 ``` 44 45 Input 46 47 ``` 48 1 0 -1 49 ``` 50 51 Output 52 53 ``` 54 -1 1 55 ``` 56 57 Input 58 59 ``` 60 2 -3 1 61 ``` 62 63 Output 64 65 ``` 66 0.5 1 67 ```