"Too close Yet too far"

It  is well known that our chotu is chotu (Height-wise :P). On Hug day his short height is creating problems for him as most of the girls are taller than him so he can't hug them properly. To overcome the problem he has decided that he shall hug the girl whose height is closest to him.
Given that the height of chotu is H and there are N girls, whose heights are given as a1,a2,a3,a4...aN.Find the minimum absolute difference between Height of girls and height of Chotu. 
Input
First line contains number of test cases, T.
First line of each test case contains two space separated integers N and H denoting number of girls and the height of chotu.
Second line of each test case contains N space separated integers denoting height of each girl.
Output
For each test case print in a single line minimum absolute difference between height of chotu and height of girls.
Constrains
1 ≤ T ≤ 100
1 ≤ N ≤ 1000
1 ≤ H, ai ≤ 10000

SAMPLE INPUT
2
5 4
10 1 2 3 6 
4 8
8 8 8 8

SAMPLE OUTPUT
1
0

Explanation

For the first case, he will hug girl with height 3.
For 2nd test case, he can hug any girl.
import math

t = int(raw_input())
while t>0:
	a = raw_input().split(' ')
	a = [int(x) for x in a if x!='']
	
	b = raw_input().split(' ')
	b = [int(x) for x in b if x!='']

	for i in range(0, len(b)):
		b[i]=abs(b[i]-a[1])
	
	b.sort()
	print b[0]
	t=t-1