PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000019. Phân tích thành thừa số nguyên tố (Factorization)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Phân tích thành thừa số nguyên tố (Factorization)
Factorization
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Given an integer , express it as a product of prime numbers. List all prime factors including repeated occurrences, in non-decreasing order. For example, has the list .
Input
One line contains integer .
Output
Print every prime factor of in non-decreasing order, separated by spaces.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
10
Output
2 5
Explanation
Since and both factors are prime, print 2 5.
Input
36
Output
2 2 3 3
Explanation
Factor . Both primes appear twice, giving 2 2 3 3.