PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000026. Đếm số thừa số nguyên tố phân biệt (Count the 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
Đếm số thừa số nguyên tố phân biệt (Count the Factors)
Count the Factors
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Given a positive integer , count the number of distinct prime factors of . A prime that divides repeatedly is counted only once. For example, has the two distinct prime factors and . The integer has zero prime factors.
Input
One line contains positive integer .
Output
Print one line in the format n : k, where is the input integer and is the number of distinct prime factors, with one space between components.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
45
Output
45 : 2
Explanation
Since , the distinct prime factors form the set of size . Print 45 : 2.
Input
8
Output
8 : 1
Explanation
has only one distinct prime divisor, namely , so print 8 : 1.
Input
1
Output
1 : 0
Explanation
The integer has no prime factors. Thus the count is and the output is 1 : 0.