PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000205. Số thừa số nhiều nhất của giai thừa (Factorial Factors)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Số thừa số nhiều nhất của giai thừa (Factorial Factors)
Factorial Factors
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Given an integer , express as a product of integers greater than . Repeated factors are allowed.
Find the maximum possible number of factors in such a product. For example, can be expressed using prime factors, and no factorization into integers greater than has more than factors.
Input
The only line contains .
Output
Print the maximum number of integer factors greater than whose product is .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
8
Output
11
Explanation
Factorizing gives . Splitting every prime power into prime factors gives factors. Combining primes into composite factors can only reduce their count, so is optimal.