Problem B
Primal Representation
The fundamental theorem of arithmetic says that every
integer can be represented as a unique product of prime
numbers. For example, consider the number
Write a program that reads integers as input, and for each integer print out the representation of that integer as a product of primes and their exponents.
Input
Input is a list of at most
Output
For each input integer
Sample Input 1 | Sample Output 1 |
---|---|
2 3 4 10 11 12 13 20 21 22 23 24 30 -30 |
2 3 2^2 2 5 11 2^2 3 13 2^2 5 3 7 2 11 23 2^3 3 2 3 5 -1 2 3 5 |