|
|||||||||||||||||||
|
SPOJ time: 2012-05-25 02:27:42 |
Problem with an expressionProblem code: HS11EXPR
Consider a mathematical expression where you just have 2 types of operations: multiplication and division. The operands are either positive integers or the factorial of a positive integer. For example, a valid expression would be: 2*5!*10!/11!. Given such an expression, you have to calculate the prime factorization of it and to print it as the result. All primes should be in increasing order and their exponents should be non-zero (not necessarily positive) integers. InputIn the first and only line you are given the expression. The sum of all integers which appear in the expression is less than or equal 1,000,000. OutputOutput the desired factorization. The output must be in the following form: p0^a0*p1^a1.....pn^an, where p0 < p1 < ... pn. ExampleInput: ScoringBy solving this problem you score 10 points.
|
||||||||||||||||||
| |||||||||||||||||||