PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000208. Tổng số ước và tổng các ước trên các bội (Divisors)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Tổng số ước và tổng các ước trên các bội (Divisors)
Tổng số ước và tổng các ước trên các bội (Divisors)
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Let be the number of positive divisors of and their sum. Given , consider all integers with and . Compute and over these integers; an empty sum is zero.
Input
One line containing .
Output
Print and separated by one space.
Subtasks
-
Subtask 1 (20 points): ; .
-
Subtask 2 (30 points): ; .
-
Subtask 3 (50 points): ; .
Examples
Example 1
Input
5 12 3
Output
13 53
Explanation
The multiples 6, 9, 12 have divisor counts 4, 3, 6 and divisor sums 12, 13, 28 respectively.
Example 2
Input
1 100 3
Output
217 3323
Explanation
Sum the divisor statistics over 3,6,...,99.
Example 3
Input
1 1 1
Output
1 1
Explanation
The only integer in the range is 1, whose divisor count and sum are both 1.