#MTHA0000002. Đếm bội trong đoạn đầu (Count Multiples in a Prefix)
Đếm bội trong đoạn đầu (Count Multiples in a Prefix)
Count Multiples in a Prefix
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers and , consider the integers from to . An integer is a multiple of if it is divisible by . Count the multiples of in .
Input
One line contains two positive integers and .
Output
Print the number of integers satisfying and .
Subtasks
- Subtask 1 (30 points):
- .
- .
- Subtask 2 (70 points):
- .
- .
Examples
Example 1
Input
20 3
Output
6
Explanation
The multiples not exceeding are , so the answer is .
Example 2
Input
7 10
Output
0
Explanation
The smallest positive multiple of is , so there are no valid integers.
Example 3
Input
1000000000000000000 1000000000
Output
1000000000
Explanation
We have , hence there are exactly multiples.