ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests

Ural SU contest. Petrozavodsk training camp. Winter 2008

About     Problems     Submit solution     Judge status     Standings
Contest is over

G. Vasya Ferrari

Time limit: 0.5 second
Memory limit: 64 MB
Vasya, nicknamed Ferrari, has to solve an equation of fourth degree with integer coefficients x4+ax3+bx2+cx+d = 0. Vasya wants to factorize the polynomial in the left part of this equation to the maximal possible number of multipliers with integer coefficients to reduce the problem to solving several equations of lower degree.


4 integers: a, b, c, d — the coefficients of the polynomial, with absolute values not exceeding 20000.


If the polynomial can't be factorized to multipliers with integer coefficients, you should output a single line “Irreducible”. In the other case output the factorization of the polynomial as a product of several polynomials with integer coefficients, enclosed in parentheses. You shouldn't delimit the multipliers with spaces and output monomials with zero coefficients. Coefficients and degrees equal to 1 should be omitted, except the monomial “1”.


0 0 0 0
-4 -3 24 45
1 1 1 1
Problem Author: Igor Chevdar
Problem Source: Ural SU Contest. Petrozavodsk Winter Session, January 2008
To submit the solution for this problem go to the Problem set: 1666. Vasya Ferrari