This problem of Oz is very straight forward. You are given N distinct prime integers i.e p1, p2,..., pN and an interval [L,R]. Calculate number of integers in this interval that are divisible by at least one of the given primes.

Input : 
First line of input contain an integer T — the number of test cases. T tests follow. First line of each test case contain 3 integers — N, L, R. and the next line contains N distinct prime integers - p1, p2,..., pN.

Output :
For each test case output a single number — number of integers in [L,R], that are divisible by at least one of the given primes.

Constraints :
1 ≤ T ≤ 10
1 ≤ N ≤ 10
1 < pi < 1000 where i=1,2..N 
1 ≤ L ≤ R ≤ 10^18

SAMPLE INPUT
2
1 1 10
3
2 1 10
2 3

SAMPLE OUTPUT
3
7

Explanation

For second sample : 
Numbers in the interval [1,10] which are divisible by at least one prime from (2,3) are as follow :
2, 3, 4, 6, 8, 9, 10
#def backtrack(arr):

t = raw_input()
t = int(t)

for i in range(0,t):
	
	n_l_r = raw_input().split(' ')
	n_l_r = [int(n) for n in n_l_r]
	n = n_l_r[0]
	l = n_l_r[1]
	r = n_l_r[2]
	
	p = raw_input().split(' ')
	p = [int(x) for x in p]
	
	#ans = 0
	#for x in p:
	#	ans = ans + r/x
	#	ans = ans - (l-1)/x
		
	div1 = []
	for x in p:
		
		div2 = []
		for elem in div1:
			div2 = div2 + [[elem[0]*x,elem[1]+1]]
			
		div2 = div2 + [[x,1]]
		div1 = div1 + div2
		
		#div1 = set(div1)
		#div1 = list(div1)
	
	#print div1
	ans = 0
	for elem in div1:
		if elem[1]%2==0:
			ans = ans - r/elem[0]
			ans = ans + (l-1)/elem[0]
		else:
			ans = ans + r/elem[0]
			ans = ans - (l-1)/elem[0]
	
	print ans
	#div1 = set(div1)
	#div1 = list(div1)
	'''
	for x in range(l,r+1):
		is_div = 0
		for y in p:
			if x%y == 0:
				is_div = 1
		
		ans = ans + is_div
	print ans
	'''
	'''
	for x in div1:
		if x not in p:
			ans = ans - r/x
			ans = ans + (l-1)/x
			
	print ans
	'''