PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000075. Đếm thừa số nguyên tố của các ước (Count Primes)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm thừa số nguyên tố của các ước (Count Primes)
Count Primes
Source: SPOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given a positive integer , consider all positive divisors of . For each , count its prime factors with multiplicity. For example, contributes three factors. Compute the sum of those multiplicity-counted prime-factor counts over all positive divisors of . The integer has zero prime factors.
Input
One line contains the positive integer .
Output
Print one integer: the sum of prime-factor counts with multiplicity over all positive divisors of .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
6
Output
4
Explanation
The positive divisors of are . Their prime-factor counts with multiplicity are , respectively, because . The total is .