Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Small Polynomial Factorization
Description Given a polynomial over the integers, for instance, 4 we can factorize it into several irreducible polynomials over the integers, i.e. 4 By “irreducible” we mean that it has coprime coefficients and cannot be further factorized. Write a program that is capable of factorizing polynomials of order at most 10 and with integral coefficients not exceeding 1000 by magnitude. Input The input consists of multiple test cases. Each test case occupies one line which contains δ + 1 (0 ≤ δ ≤ 10) integers a_{0}, a_{1}, …, a_{δ} such that |a_{i}| ≤ 1000, ∀i : 0 ≤ i ≤ δ. These integers define a polynomial
which is to be factorized. The input ends once EOF is met. Output For each test case, output the factorization of the given polynomial. There are multiple ways to express the factorization of a polynomial. To make it unique, we require that f(x) be factorized into
where For any x), - if
*δ*_{i}<*δ*_{j},*g*_{i}(*x*) shall precede*g*(_{j}*x*); - if
*δ*_{i}=*δ*_{j},*g*_{i}(*x*) shall precede*g*(_{j}*x*) iff*S*_{i}is lexicographically smaller than*S*_{j}, elements being compared first by their magnitudes then by their values.
Sample Input 36 -30 -2 4 Sample Output 2 -2 1 3 1 -3 2 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator