Factoring Quadratics

input: p q r
output: a b c d e
px^2 + qx + r = a(bx+c)(dx+e) (b, d > 0)
Linear polynomials should be sorted in descending order.

IN

1 3 2

OUT

1 1 2 1 1

IN

2 5 2

OUT

1 2 1 1 2

IN

4 0 -1

OUT

1 2 1 2 -1

IN

2 2 -4

OUT

2 1 2 1 -1

IN

-6 -18 -12

OUT

-6 1 2 1 1

IN

2 8 8

OUT

2 1 2 1 2

IN

1 459 12470

OUT

1 1 430 1 29

IN

1 18784 37564

OUT

1 1 18782 1 2

IN

-2 -5 -2

OUT

-1 2 1 1 2


Leave a comment

Parsed as Markdown

Login to leave a comment