Problem: "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.

Solution (in PYTHON):

Solution:
t = input();
while(t > 0):
	n, h = map(int, raw_input().split()); md = 10000;
	a = [int(i) for i in raw_input().split()];
	for i in range(0, n):
		if(abs(h - a[i]) < md):	md = abs(h - a[i]);
	print md;
	t -= 1;