Given a quadratic equation in the form **ax ^{2} + bx + c**. The task is to find the

**Input: **

First line of input contains an integer, the number of test cases **T**. Each test case should contain three positive numbers **a, b and c** in the same line seperated by space.

**Output: **

If roots of equations exists, then print the two roots separated by space (Higher valued root should be printed before lower valued). Else if a = 0, then print "**Invalid**" as equation is not quadratic. If roots are imaginary, then print "**Imaginary**"

**Constraints:**

1 <= T <= 50

-10^{3} <= a <= 10^{3}

-10^{3} <= b <= 10^{3}

-10^{3} <= c <= 10^{3}

**Example:**

**Input:**

3

1 -2 1

1 -7 12

1 4 8

**Output:**

1 1

4 3

Imaginary

**Explanation:
Testcase 1: **Roots of equation x

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

madhursengar24 | 86 |

PiyushPandey4 | 617 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 448 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.