aa
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
class Equation
{
protected:
double a, b, c;
public:
Equation();
Equation(double a, double b, double c);
void set(double a, double b, double c);
void getR();
};
Equation::Equation() {
a = 1,b = 1, c = 0;
}
Equation::Equation(double a,double b,double c)
{
this->a = a;
this->b = b;
this->c = c;
}
void Equation::set(double a, double b, double c)
{
this->a = a;
this->b = b;
this->c = c;
}
void Equation::getR()
{
double hh1 = b * b - 4 * a * c;
cout << fixed << setprecision(2);
if (hh1 < 0)
{
hh1 = -hh1;
double DA2 = fabs(sqrt(hh1) / (2 * a));
double DA1 = -b / (2 * a);
cout << "x1=" << DA1 << "+" << DA2
<<"i" << " " << "x2=" << DA1
<< "-" << DA2 << "i" << endl;
}else if(hh1 == 0)
{
double root = -b / (2 * a);
cout << "x1=x2=" << root << endl;
}else{
double root1 = (-b + sqrt(hh1)) / (2 * a);
double root2 = (-b - sqrt(hh1)) / (2 * a);
cout << "x1=" << root1 << " " << "x2=" << root2 << endl;
}
}
int main()
{
int t;
cin >> t;
double n1, n2, n3;
while (t--)
{
cin >> n1 >> n2 >> n3;
Equation obj(n1, n2, n3);
obj.getR();
}
return 0;
}