S5P2 - Count Primes
Given an integer number n. Get all divisor of n then count number of prime factor in each divisor.
Divisor of n is all numbers that divide n.
Prime factor of N is number of primes in N. For example, 12 is 2^2 * 3^1 so 12 has 3 prime numbers 2, 2, 3.
Note: 1 is not prime.
Input
input contain one integer N where 1 <= N <= 10000
Output
Print number of prime factors for all divisor of N.
Print endl after the test case
Example
Input: 6 Output: 4
Explanation
Divisors of 6 are 1, 2, 3, 6.
- 1 contains 0 prime.
- 2 contains 1 prime.
- 3 contains 1 prime.
- 6 contains 2 prime.
hide comments
John and the cows:
2013-08-15 05:28:09
no pascal for this problem :( Last edit: 2013-08-15 05:28:19 |
Added by: | mohamed gamal |
Date: | 2012-01-27 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C++ 4.3.2 CPP |