PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000078. Đếm số cặp có BCNN bằng N (LCM Cardinality)
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ố cặp có BCNN bằng N (LCM Cardinality)
LCM Cardinality
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Given a positive integer , count the pairs of positive integers satisfying and . Pairs differing only in order count once; the pair also counts once. This count is the LCM cardinality of .
Input
One positive integer .
Output
Print and separated by one space, where is the required number of pairs.
Subtasks
-
Subtask 1 (20 points): .
-
Subtask 2 (30 points): .
-
Subtask 3 (50 points): .
Examples
Input
12
Output
12 8
Explanation
The eight unordered pairs are , , , , , , and ; each has LCM .