11321132 SUSTech Online Judge
Problem 1132 --Fight against demon[Easy]

1132: Fight against demon[Easy]

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 410  Solved: 267
[Submit][Status][Web Board]

Description

Under your help, the sheik of the forest found that the demons weren't among the men. They must have escaped. After reading ancient books, the sheik found that exactly m cd (candela, which is the unit of strength of light) units of light exposed by the join of two light swords can kill the demons. The men in the forest brought n light swords and put them in ascending order. Could you help sheik to find how many pairs are in the given n light swords with a combination of m cd.

(You can also choose a light sword twice if the condition is satisfied for the sheik can get another same one from the craftsman in the forest.)

Input

The first line will be an integer T (1<=T<=10), which is the number of test cases.

For each case contain two lines. The first line contains two numbers n (1<=n<=5000)  and m (1<=m<=108), n is the number of light swords. m is the specified target.

The second line contains n  integers:a1, a2,an (1<=ai=106, 1<=i<=n)  , which are the light strengths of the light swords brought by men in the forest.

Output

For each case print the number of pairs.

Sample Input

3
4 5
1 2 3 4
4 9
2 7 11 15
3 6
1 2 3

Sample Output

2
1
0

HINT

Here we simply regard the strength of the combination of light swords is the sum of light strengths of the original ones.

Source

 

[Submit][Status]