시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 221 | 133 | 118 | 60.825% |
After hearing that the quadratic formula is used constantly in calculus, you decide that it would be more efficient to just write a program for it! Write a program that solves the equation shown below:
$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
The $\pm$ sign represents two different equations, one with $+$ and one with $-$. Your answer will be both answers, separated by a comma and a space.
The first line will contain a single integer $n$ that indicates the number of data sets that follow. Each data set will contain three numbers (integer or decimal) on a single line, representing $a$, $b$, and $c$ respectively.
Output the two answers to the equation, rounded to the thousandths digit and separated by a comma and one space. The $+$ sign will be the first answer, then the $-$ sign will be the second. The solutions will always be real numbers.
2 1 6 3 4 10 6.1
-0.551, -5.449 -1.056, -1.444