#GL0000178. Phân tích thừa số nguyên tố của giai thừa (Intelligent Factorial Factorization)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Phân tích thừa số nguyên tố của giai thừa (Intelligent Factorial Factorization)
Intelligent Factorial Factorization
Source: LightOJ
Version: Phuoc Hung OJ Extended
Problem Statement
For an integer , the factorial equals . Although it grows rapidly, it has a unique prime factorization
where are all primes appearing in , and the exponents are positive.
Print the prime factorization in the prescribed textual format, rather than the factorial itself.
Input
One line containing the integer .
Output
Print one line starting with N = , replacing N with the input value. Then print groups p (a) in increasing order of , separated by *. Each group gives a prime factor and its exponent in . Do not print a Case prefix.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Example 1
Input
6
Output
6 = 2 (4) * 3 (2) * 5 (1)
Explanation
. The ascending primes are with exponents ; spaces and separators follow the sample.
Example 2
Input
2
Output
2 = 2 (1)
Explanation
has a single prime factor with exponent .