#MTHA0000004. Đếm số không chia hết (Count Non-Multiples)
Đếm số không chia hết (Count Non-Multiples)
Count Non-Multiples
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers with , count the integers in that are not divisible by .
Input
One line contains three positive integers , , and .
Output
Print the number of integers satisfying and is not divisible by .
Subtasks
- Subtask 1 (30 points):
- .
- .
- .
- Subtask 2 (70 points):
- .
- .
Examples
Example 1
Input
1 10 3
Output
7
Explanation
There are integers. Exactly are divisible by , leaving .
Example 2
Input
8 8 4
Output
0
Explanation
The interval contains only , which is divisible by , so the answer is .
Example 3
Input
100 110 50
Output
10
Explanation
The interval has integers and only is divisible by , so are not divisible.