Score : 400 points
Given are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.
Let a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \leq k \leq N):
Find the number of semi-common multiples of A among the integers between 1 and M (inclusive).
Input is given from Standard Input in the following format:
N M a_1 a_2 ... a_N
Print the number of semi-common multiples of A among the integers between 1 and M (inclusive).
2 50 6 10
2
Thus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.
3 100 14 22 40
0
The answer can be 0.
5 1000000000 6 6 2 6 2
166666667