Faktorisanje
n Integers are given. You need to decompose these numbers in their factors, i.e. write them as product of their prime factors. Every number write in format p1^a1*p2^a2*...*pk^ak , where p1 <= p2 <= ... <= pk are prime factors of given number (in ascending order) and a1, a2, ..., ak - are their powers. Between factors and powers are symbols '*' and '^'. No empty spaces in printed solution.
InputIn first line are integer n <= 200.000. In next n lines are numbers bi for decomposition (2 <= bi <= 200.000). Every number in separated line.
Output On standard output write decomposition in above given format.
Notice:
In 40% tests n <= 1.000
Input:
3
10
23
180 Output:
2^1*5^1
23^1
2^2*3^2*5^1
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.