insidcode
ProblemsDuelLeaderboardStats
Sign In
  1. Home
  2. Problems
  3. Find the prime factorization of a number and display in exponential format (e.g., 12 = 2^2 * 3^1).

Find the prime factorization of a number and display in exponential format (e.g., 12 = 2^2 * 3^1).

Difficulty: Hard

Phase: 6 · Mixed Logical Challenges

XP Reward: 30 XP

Topics: Mixed Logical Challenges, Hard

Supported Languages: Python, JavaScript, C, C++, Java

Problem Description

Given integer N (>= 2), print its prime factorization in ascending prime order separated by space (format 'p^k'). Input Format: Read input from standard input (stdin). Output Format: Print the result to standard output (stdout).

Constraints

  • -10^9 <= N <= 10^9

Examples

Example 1

Input: 12

Output: 2^2 3^1

Explanation: Sample execution for input 12