Factor the Giant
Print the prime factorization of N (up to 1018) in increasing prime order, formatted like 2^3 7 13^2 (exponent 1 omitted).
Input: one integer N.
Output: the factorization, or 1 when N = 1.
Constraints:
- 1 ≤ N ≤ 1018
Sample Tests
Input 1
360
Output 1
2^3 3^2 5
Input 2
1
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.