Forgot Password ?
New password will be sent to following email id
Chotu and Hug Day
Problem Code : HUG
2 5 4 10 1 2 3 6 4 8 8 8 8 8
Time Limit :
C , C++ , Java , Python 2
Login to submit your response.
<i>"Too close Yet too far"</i><br><br> It is well known that our chotu is chotu <b>(Height-wise :P)</b>. 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.<br> Given that the height of chotu is H and there are N girls, whose heights are given as <b>a<sub>1</sub>,a<sub>2</sub>,a<sub>3</sub>,a<sub>4</sub>...a<sub>N</sub></b>.Find the minimum absolute difference between Height of girls and height of Chotu.
First line contains number of test cases, <b>T.</b> <br> First line of each test case contains two space separated integers N and H denoting number of girls and the height of chotu.<br> Second line of each test case contains N space separated integers denoting height of each girl.
For each test case print in a single line minimum absolute difference between height of chotu and height of girls.
1 <= <b>T</b> <= 100<br> 1 <= <b>N</b> <= 1000<br> 1 <= <b>H, a<sub>i</sub></b> <= 10000
For the first case, he will hug girl with height 3.<br> For 2nd test case, he can hug any girl.