Read problems statements in [Hindi], [Mandarin Chinese], [Russian], [Vietnamese], and [Bengali] as well.

Chef Chick loves to jump a lot. Once, it realised that it was on an infinitely long road, and decided to travel along this road by jumping.

Let's view the road as the $x$-axis in a 1D coordinate system. Initially, Chef Chick is at the coordinate $x=0$, and it wants to move only in the positive $x$-direction. Moreover, Chef Chick has $N$ favourite integers $a_{1}, a_{2}, \ldots, a_{N}$, and it wants to jump on the coordinates that are multiples of these favourite numbers — when its current position is $x$, it jumps to the smallest coordinate $y > x$ such that $y$ is an integer multiple of at least one of the values $a_{1}, a_{2}, \ldots, a_{N}$; the length of such a jump is $y-x$.

This way, Chef Chick keeps jumping along the road forever in the positive $x$-direction. You need to find the length of the longest jump it will make, i.e. the largest integer $d$ such that Chef Chick makes at least one jump with length $d$ and never makes any jump with a greater length. It can be proved that such an integer always exists.

------  Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
The first line of each test case contains a single integer $N$.
The second line contains $N$ space-separated integers $a_{1}, a_{2}, \ldots, a_{N}$.

------  Output ------
For each test case, print a single line containing one integer — the length of the longest jump that Chick will make.

------  Constraints ------
$1 ≤ T ≤ 100$
$1 ≤ N ≤ 100$
$1 ≤ a_{i} ≤ 10^{5}$ for each valid $i$
$a_{1}, a_{2}, \ldots, a_{N}$ are pairwise distinct

----- Sample Input 1 ------ 
1

2

2 3
----- Sample Output 1 ------ 
2
----- explanation 1 ------ 
Example case 1: The sequence of coordinates on which Chef Chick would jump starts with $(0, 2, 3, 4, 6, \ldots)$. A longest jump is e.g. from $4$ to $6$, with length $2$.

Difficulty: EASY

Solutions:
for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	print(min(l))


import math
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	print(min(a))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(min(a))


t = int(input())
for ni in range(t):
	n = int(input())
	l = [int(i) for i in input().split()]
	print(min(l))


for _ in range(int(input())):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	print(l[0])


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	print(l[0])


import math
from functools import reduce
for tc in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	largestjump = reduce(math.gcd, a)
	if largestjump == 1:
		largestjump = min(a)
	print(largestjump)


for _ in range(int(input())):
	N = int(input())
	A = map(int, input().split())
	print(min(A))


for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().strip().split()))[:n]
	print(min(l))


for _ in range(int(input())):
	n = int(input())
	arr = map(int, input().split())
	print(min(arr))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	print(a[0])


t = int(input())
while t:
	N = int(input())
	A = list(map(int, input().split()))
	print(min(A))
	t = t - 1


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	print(sorted(a)[0])


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	b = sorted(l)
	print(b[0])


t = input()
for c in range(0, int(t)):
	n = int(input())
	arr = map(int, input().split())
	print(min(arr))


tests = int(input())
for i in range(tests):
	length = int(input())
	arr = list(map(int, input().split()))
	limit = max(arr) * 10
	ans = 0
	multiples_arr = []
	for j in arr:
		x = 1
		while j * x < limit:
			multiples_arr.append(j * x)
			x += 1
	multiples_arr.sort()
	ans = max(ans, multiples_arr[0])
	for x in range(1, len(multiples_arr)):
		ans = max(ans, multiples_arr[x] - multiples_arr[x - 1])
	print(ans)


tc = int(input())
while tc:
	num = int(input())
	li = list(map(int, input().split()))
	print(min(li))
	tc = tc - 1


t = int(input())
for _ in range(t):
	n = int(input())
	L = list(map(int, input().split()))
	m = min(L)
	print(m)


ujju = int(input())
for jyo in range(ujju):
	d = int(input())
	fm = list(map(int, input().split()))
	fm.sort()
	print(fm[0])


def solve(*args):
	(n, a) = args
	return min(a)

def do_codechef():
	for t in range(int(input())):
		n = int(input())
		a = list(map(int, input().split(' ')))
		print(solve(n, a))
do_codechef()
exit()


t = int(input())
for i in range(t):
	n = int(input())
	arr = map(int, input().split())
	print(min(arr))


for _ in range(int(input())):
	N = int(input())
	listx = list(map(int, input().split()))
	print(min(listx))


n = int(input())
for i in range(n):
	a = int(input())
	b = list(map(int, input().split()))
	print(min(b))


t = int(input(''))
for i in range(1, t + 1):
	N = int(input(''))
	a = list(map(int, input().split()))
	print(min(a))


t = int(input())
while t != 0:
	n = int(input())
	a = list(map(int, input().split()))
	print(min(a))
	t -= 1


T = int(input())
while T > 0:
	n = int(input())
	lst = map(int, input().split())
	print(min(lst))
	T -= 1


t = int(input())
while t > 0:
	n = int(input())
	lst = map(int, input().split())
	print(min(lst))
	t -= 1


t = int(input())
while t:
	n = int(input())
	x = [int(i) for i in input().split()]
	print(min(x))
	t = t - 1


for i in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	print(min(a))


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	print(l[0])