Prime factorization
InterviewTime limit1sMemory limit256 MB
Print the prime factors of N up to 10,000,000 in ascending order, repeating each factor by multiplicity.
- Level
Easy3 of 10
- Topics
- Number theory
- Solved
- No attempts yet
Problem
Given an integer , write a program that factors into primes.
Input
The first line contains an integer ().
Output
Print the prime factors of in ascending order, one per line. If a prime divides several times, print it once for each division. If is , print nothing.