PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000025. Phân tích thừa số nguyên tố dùng dấu nhân (Prime 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ừa số nguyên tố dùng dấu nhân (Prime factorization)
Prime factorization
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given integer , write its prime factorization with all prime factors in non-decreasing order, repeating factors according to multiplicity. Print an asterisk * between adjacent factors, with no spaces and no leading or trailing asterisk.
Input
One line contains integer .
Output
Print the prime factors whose product equals , separated by literal * characters.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
245
Output
5*7*7
Explanation
Since , the required output is 5*7*7.
Input
19
Output
19
Explanation
The number is prime, so its factorization has one factor and needs no separator; print 19.