407222: GYM102697 193 Quadratic Equation Factoring
Description
You're given a quadratic equation, in the form of $$$y = ax^2 + bx + c$$$. Your task is to find all possible factorizations of this quadratic equation, using only positive integers. In other words, you have to find all pairs of binomials $$$cx + d$$$, where $$$c$$$ and $$$c$$$ are both positive integers, such that the product of the two binomials is the original quadratic equation.
Sort the factorizations in ASCII order (you can use your language's built-in sorting method).
InputThe only line of input contains three space-separated positive integers $$$a$$$, $$$b$$$, and $$$c$$$: the coefficient on the $$$x$$$ term of the quadratic equation, and the constant term of the quadratic equation, respectively.
OutputOutput all of the integer factorizations of the given quadratic equation, each on a new line. Each one should be in the format $$$(x + c1)(x + c2)$$$.
If there are no possible factorizations, output "-1" (no quotes).
ExamplesInput2 8 6Output
(2x + 2)(x + 3) (2x + 6)(x + 1) (x + 1)(2x + 6) (x + 3)(2x + 2)Input
1 17 60Output
(x + 12)(x + 5) (x + 5)(x + 12)Input
3 7 11Output
-1