Quadratic Equation


Submit solution

Points: 2
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Python3

In this task, you are required to come up with the solution of a quadratic equation.

A quadratic equation can be written as:

~ax^2 + bx + c = 0~

The solution to a quadratic function is also very simple, it might have 0, or 1, or 2 solutions depending on the values of \(a\), \(b\), \(c\).

Your task is to write a program to calculate the solution(s) to a quadratic equation.

Input Specification

The first line will contain a single integer \(N\) (\(N<1000\)).

The next \(N\) lines will each contain 3 float numbers \(a\), \(b\), \(c\), separated by white space.

Output Specification

\(N\) lines of output.

If the quadratic equation has no real number solution, output No solution. If it has a unique solution, output that solution, precise to 2 digits after decimal point. If it has 2 solutions, output in a single lines in increasing order separated by a white space, each precise to 2 digits after decimal point.

Sample Input 1

5
0.5 1 0.5
1 1 1
1 0 -1
0 6 3
0 0 1

Sample Output 1

-1.00
No solution
-1.00 1.00
-0.50
No solution

Comments

There are no comments at the moment.