Prime factors
Xem dạng PDF
Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch, TEXT
Prime Factorization
Every positive integer can be represented as a product of prime numbers.
Given an integer N, perform its prime factorization and output each prime factor together with its exponent.
The prime factors must be printed in ascending order.
Input
The input contains a single integer N.
N <= 10^9
Output
For each prime factor of N, output one line containing:
prime exponent
The prime factors must be output in ascending order.
Example
Input
12
Output
2 2
3 1
Bình luận