VERY IMPORTANT NOTE TO ALL DEC COURSE 2022 PARTICIPANTS (due to delays in email communication): Elementary is gone, so Advanced has a diagnostic test (if you fail, no Dec Course). Syllabus of diagnostic is anything in these prerequisite notes, please review them at this link. Problemsets can be found at this link and under Contests (Collections).

Given an integer *n* where 2 ≤ *n* < 10^{12}, factorize it into its prime factors.

A single integer, *n*

For 100% of the testcases, *n* < 10^{12}

For 50% of the testcases, *n* < 10^{6}

For 30% of the testcases, *n* < 10^{3}

On each line, output the prime factors of *n* in sorted order, with its power indicated. (See Sample Output)

120

2^3 3^1 5^1

331

331^1

Subtask | Score |
---|---|

1 | 100 |

2 | 0 |