Time limit
2s
Memory limit
128 MB
You are given an array A of positive integers.
Write a program that counts how many positive integers from L through R, inclusive, are divisible by at least one element of A.
The first line contains the size N of array A and two positive integers L and R. N is a positive integer at most 18, and L is a positive integer at most 1,000,000,000. R is at least L and at most 1,000,000,000.
The second line contains the N elements of A, separated by spaces. Each element is a positive integer at most 1,000,000,000.
Print, on the first line, the number of positive integers from L through R, inclusive, that are divisible by at least one element of A.