Java Operators(Arithmetic) | Set 1
Basic Accuracy: 19.18% Submissions: 6941 Points: 1

Given three numbers A,B and C. Find roots of quadratic equation Ax2 + Bx + C = 0. (A not equal to  0)

Input:
First line of the input contains an integer T which denotes the number of test cases. Then T test cases follow.  Each test case contains a single line containing three space separated integers A,B and C. 

Output: 
For each test case, Print two roots of quadratic equation(space separated) in ascending order. For complex roots,print COMPLEX.

Constraints:
1 <= T< = 100
-10<=A<=10
-10<=B<= 10
-10<=C<= 10

Note: A is not equal to 0.

Example:
Input:

3
2 3 4
3 5 1
1 -4 4    
Output:
COMPLEX
-1.4342586 -0.23240812 
2.0 2.0

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.