You are given a set of distinct integers S={a1,a2,…,an} and another integer K. Consider picking two distinct integers from S and adding them; among all such pairs, look at the ones whose sum is closest to K, meaning the absolute difference between the sum and K is as small as possible.
For example, given the 10 integers
S={−7,9,2,−4,12,1,5,−3,−2,0}
the pair whose sum is closest to K=8 is {12,−4} alone (their sum is exactly 8). For K=4, the smallest possible difference between a pair's sum and K is 1, achieved by five pairs: {−7,12},{9,−4},{5,−2},{5,0},{1,2}.
Given the integers and K, write a program that counts how many pairs of two distinct integers have a sum closest to K.
Input is given on standard input. The first line contains the number of test cases t. Each test case then consists of two lines.
The first line of each test case contains two integers n and K separated by a space (2≤n≤106, −108≤K≤108). The second line contains n distinct integers separated by spaces, each between −108 and 108 inclusive.
For each test case, output the result on its own line, in the order the test cases are given. Each line contains the number of pairs of two distinct integers whose sum is closest to K.