Time limit: 2.9s
Memory limit: 256MB
Input:
Output:
Who doesn’t love math 🙂
Let p, q and n be natural numbers. We will say that a pair of natural numbers (a, b) is interesting when:
1 ≤ a ≤ p1 ≤ b ≤ q- is a natural number, and
1 ≤ c ≤ n, that is the product is divisible without remainder by the suma + b, and their quotient is less than or equal ton.
The goal of this task is simple - find the number of interesting pairs!
Task
Write a program that given the three numbers p, q and n, computes the number of interesting pairs.
Input
The only line of the standard input contains the numbers p, q and n.
Output
On the single line of the standard output, print the number of interesting pairs. It is guaranteed that the answer less than .
Constraints
Subtask 1 (5 points)
Subtask 2 (10 points)
Subtask 3 (10 points)
Subtask 4 (10 points)
Subtask 5 (10 points)
p = q
Subtask 6 (10 points)
Subtask 7 (45 points)
- No other constraints
Examples
stdin
13 17 5
stdout
11