Problem: You are given an array of integers. Count the number of pairs of indices such that and .
Input Format: The first line contains one integer (). Then test cases follow.
The first line of each test case contains one integer ().
The second line of each test case contains integers () — array .
It is guaranteed that the sum of over all test cases does not exceed .
Output Format: For each test case output the number of pairs of indices such that and .