PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000223. Đếm cặp từ đẳng thức GCD–LCM (The Number of Pairs)
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 cặp từ đẳng thức GCD–LCM (The Number of Pairs)
The Number of Pairs
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers , count ordered positive integer pairs satisfying
The two orders are distinct when . Print the exact count.
Input
One line contains .
Output
Print the count.
Subtasks
-
Subtask 1 (20 points): .
-
Subtask 2 (30 points): .
-
Subtask 3 (50 points): .
Examples
Example 1
Input
1 1 3
Output
4
Explanation
The four ordered pairs are (1,4), (4,1), (3,6) and (6,3). Each satisfies the equality with result 3.
Example 2
Input
4 2 6
Output
3
Explanation
The three pairs (1,2), (2,1) and (3,3) each satisfy .