atcoder#ABC150D. [ABC150D] Semi Common Multiple
[ABC150D] Semi Common Multiple
Score : points
Problem Statement
Given are a sequence of positive even numbers, and an integer .
Let a semi-common multiple of be a positive integer that satisfies the following condition for every :
- There exists a non-negative integer such that .
Find the number of semi-common multiples of among the integers between and (inclusive).
Constraints
- is an even number.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of semi-common multiples of among the integers between and (inclusive).
2 50
6 10
2
Thus, and are semi-common multiples of . There are no other semi-common multiples of between and , so the answer is .
3 100
14 22 40
0
The answer can be .
5 1000000000
6 6 2 6 2
166666667