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
for t in range(int(raw_input())):
    n = int(raw_input())
    xs = [int(i) for i in raw_input().split()]
    k = int(raw_input())
    counts = [0] * 101
    for x in xs:
        counts[x] += 1
    total = 0
    for i in range(1, k):
        if k-i < 0 or i > 100 or k-i > 100:
            continue
        total += counts[i] * counts[k-i]
    if k % 2 == 0:
        c = counts[k/2]
        total -= c*c
    total /= 2
    if k % 2 == 0:
        total += c * (c-1) / 2
    print total