PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000187. Bốn biến số (Four Variables)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Bốn biến số (Four Variables)
Four Variables
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Given a positive integer , count ordered quadruples of positive integers satisfying
Different positions matter: swapping and generally produces a different ordered quadruple. The answer is guaranteed not to exceed .
Input
The input contains .
Output
Print the number of valid ordered quadruples.
Subtasks
-
Subtask 1 (20 points): .
-
Subtask 2 (30 points): .
-
Subtask 3 (50 points): .
Examples
Example 1
Input
4
Output
8
Explanation
The eight ordered quadruples are , , , , , , and .
Example 2
Input
292
Output
10886
Explanation
Summing the ordered factor-pair counts for and gives .
Example 3
Input
19876
Output
2219958
Explanation
For , the factor-pair counting sum evaluates to .