P12894 [HackerEarth] chocolates boxes 1
普及
题目描述

Alice has N boxes, and each box has certain non zero number of chocolates. These boxes are numbered from 1 to N.

Alice is planning to go to wonderland. She wants to carry exactly K number of chocolates and she can carry only 2 boxes. So she wants to know the number of ways in which she can select 2 boxes such that total number of chocolates in them is K.

Input
First line of the input is the number of test cases T. It is followed by T test cases. Each test case has 3 lines. First line is the number of boxes N and the next line has N space separated integers where the i^th integer is the number of chocolates in the i^th box and 3rd line of each test case contains value of K.

Output
For each test case, output a single number, the number of ways in which she can select the boxes.

Constraints

1 ≤ T(number of test cases) ≤ 10

1 ≤ N ≤ 10^5

1 ≤ Number of Chocolates in i^th box ≤ 100

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

SAMPLE OUTPUT
2
10
4

输入格式

见题面

输出格式

见题面

样例输入
3 5 1 2 3 4 3 6 5 1 1 1 1 1 2 5 1 5 3 3 3 6 SAMPLE
样例输出
2 10 4