This is the easy version of this problem. The only difference between easy and hard versions is the constraints on k and m (in this version k=2 and m=3). Also, in this version of the problem, you DON'T NEED to output the answer by modulo.

You are given a sequence a of length n consisting of integers from 1 to n. The sequence may contain duplicates (i.e. some elements can be equal).

Find the number of tuples of m = 3 elements such that the maximum number in the tuple differs from the minimum by no more than k = 2. Formally, you need to find the number of triples of indices i < j < z such that

$$$max(a_i, a_j, a_z) - min(a_i, a_j, a_z) ≤ 2.$$$

For example, if n=4 and a=[1,2,4,3], then there are two such triples (i=1, j=2, z=4 and i=2, j=3, z=4). If n=4 and a=[1,1,1,1], then all four possible triples are suitable.

Input

The first line contains a single integer t (1 ≤ t ≤ 2 ⋅ 10^5) — the number of test cases. Then t test cases follow.

The first line of each test case contains an integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the length of the sequence a.

The next line contains n integers a_1, a_2,…, a_n (1 ≤ a_i ≤ n) — the sequence a.

It is guaranteed that the sum of n for all test cases does not exceed 2 ⋅ 10^5.

Output

Output t answers to the given test cases. Each answer is the required number of triples of elements, such that the maximum value in the triple differs from the minimum by no more than 2. Note that in difference to the hard version of the problem, you don't need to output the answer by modulo. You must output the exact value of the answer.

Example

Input


4
4
1 2 4 3
4
1 1 1 1
1
1
10
5 6 1 3 2 9 8 1 2 4


Output


2
4
0
15

import java.util.*;
import java.lang.*;
import java.io.*;

public class Virtual {

	public static void main(String[] args) throws Exception {

//			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//			int t = Integer.parseInt(br.readLine());
//			StringBuilder sb = new StringBuilder();
//			while (t-- > 0) {
//				int n = Integer.parseInt(br.readLine());
//				String[] str = (br.readLine()).trim().split(" ");
//				int[] arr = new int[n];
//				for (int i = 0; i < n; i++) {
//					arr[i] = Integer.parseInt(str[i]);
//				}
//			}
//			return;

//		first();
//		sec();
//		third();
//		four();
		fif();
//			six();
	}

//	private static void first() throws Exception {
//		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//		int t = Integer.parseInt(br.readLine());
//		StringBuilder sb = new StringBuilder();
//
//		while (t-- > 0) {
//			String[] scn = (br.readLine()).trim().split(" ");
//			int n = Integer.parseInt(scn[0]);
//			int[] arr = new int[n];
//			scn = (br.readLine()).trim().split(" ");
//			for (int i = 0; i < n; i++) {
//				arr[i] = Integer.parseInt(scn[i]);
//			}
//			int i = 0;
//			int j = n - 1;
//			int count = 0;
//			while (i <= j) {
//				if (count == 0) {
//					sb.append(arr[i] + " ");
//					count = 1;
//					i++;
//				} else {
//					sb.append(arr[j] + " ");
//					j--;
//					count = 0;
//				}
//
//			}
//			sb.append("\n");
//
//		}
//		System.out.println(sb);
//		return;
//	}
//
//	private static void sec() throws Exception {
//		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//		int t = Integer.parseInt(br.readLine());
//		StringBuilder sb = new StringBuilder();
//
//		while (t-- > 0) {
//			String[] scn = (br.readLine()).trim().split(" ");
//			int n = Integer.parseInt(scn[0]);
//			String str = br.readLine();
//			String pat = "2020";
//			int c = str.indexOf(pat);
//			if (c == 0 || c == n - 4) {
//				sb.append("YES");
//			} else {
//				int j = 0;
//				int i = 0;
//				while (j < 4 && i < n) {
//					if (str.charAt(i) == pat.charAt(j)) {
//						j++;
//						i++;
//					} else {
//						break;
//					}
//				}
//				int k = 3;
//				i = n - 1;
//				while (j <= k && i >= j) {
//					if (str.charAt(i) == pat.charAt(k)) {
//						k--;
//						i--;
//					} else {
//						break;
//					}
//				}
//				if (k == j - 1) {
//					sb.append("YES");
//
//				} else {
//					sb.append("NO");
//
//				}
//			}
//			sb.append("\n");
//		}
//
//		System.out.println(sb);
//		return;
//	}
//
//	private static void third() throws Exception {
//		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//		int t = Integer.parseInt(br.readLine());
//		StringBuilder sb = new StringBuilder();
//
//		while (t-- > 0) {
//			String[] scn = (br.readLine()).trim().split(" ");
//			int n = Integer.parseInt(scn[0]);
//			if (n > 45) {
//				sb.append("-1");
//			} else {
//				String ans = "";
//				int dig = 9;
//				while (n > 0) {
//					if (n - dig >= 0) {
//						ans = dig + ans;
//						n -= dig;
//					}
//					dig -= 1;
//				}
//				sb.append(ans);
//			}
//			sb.append("\n");
//		}
//		System.out.println(sb);
//		return;
//	}
//
//	private static void four() throws Exception {
//		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//		int t = Integer.parseInt(br.readLine());
//		StringBuilder sb = new StringBuilder();
//
//		while (t-- > 0) {
//			String[] scn = (br.readLine()).trim().split(" ");
//			int n = Integer.parseInt(scn[0]);
//			int[] arr = new int[n];
//			scn = (br.readLine()).trim().split(" ");
//			for (int i = 0; i < n; i++) {
//				arr[i] = Integer.parseInt(scn[i]);
//			}
//			int pre = 0;
//			int op = n - 1;
//			for (int i = 0; i < n; i++) {
//				int newop = i;
//				pre += arr[i];
//				int sum = 0;
//				int prevj = i + 1;
//				int j = i + 1;
//				for (j = i + 1; j < n; j++) {
//					sum += arr[j];
//					if (sum > pre) {
//						break;
//					}
//					if (sum == pre) {
//						newop += j - prevj;
//						prevj = j + 1;
//						sum = 0;
//					}
//				}
//				if (j == n && sum == 0) {
//					op = Math.min(op, newop);
//					break;
//				}
//			}
//			sb.append(op);
//			sb.append("\n");
//
//		}
//		System.out.println(sb);
//		return;
//	}

	private static void fif() throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = Integer.parseInt(br.readLine());
//		StringBuilder sb = new StringBuilder();
//		long p = 1000000007;
//		InverseofNumber(p);
//		InverseofFactorial(p);
//		factorial(p);
		while (t-- > 0) {
			String[] scn = (br.readLine()).trim().split(" ");
			int n = Integer.parseInt(scn[0]);
			int m = 3;
//			Integer.parseInt(scn[1]);
			int k = 2;
//			Integer.parseInt(scn[2]);
			int[] arr = new int[n];
			scn = (br.readLine()).trim().split(" ");
			for (int i = 0; i < n; i++) {
				arr[i] = Integer.parseInt(scn[i]);
			}
			if (m > n) {
				System.out.println("0");
				continue;
			}
			sort(arr, 0 ,n-1);
			int i = 0;
			long ans = 0;
			for (int j = m - 1; j < n; j++) {
				while (i < n && arr[j] - arr[i] > k) {
					i++;
				}
				if (i < n && j - i + 1 >= m) {
					ans += ((long) (j - i) * (j - i - 1)) / 2;
				}
			}
			System.out.println(ans);
		}
		return;
	}

//	static int N = 200001;
//	static long[] factorialNumInverse = new long[N + 1];
//	static long[] naturalNumInverse = new long[N + 1];
//	static long[] fact = new long[N + 1];
//
//	static void InverseofNumber(long p) {
//		naturalNumInverse[0] = naturalNumInverse[1] = 1;
//		for (int i = 2; i <= N; i++)
//			naturalNumInverse[i] = naturalNumInverse[(int) (p % i)] * (p - p / i) % p;
//	}
//
//	static void InverseofFactorial(long p) {
//		factorialNumInverse[0] = factorialNumInverse[1] = 1;
//		for (int i = 2; i <= N; i++)
//			factorialNumInverse[i] = (naturalNumInverse[i] * factorialNumInverse[i - 1]) % p;
//	}
//
//	static void factorial(long p) {
//		fact[0] = 1;
//		for (int i = 1; i <= N; i++) {
//			fact[i] = (fact[i - 1] * i) % p;
//		}
//	}
//
//	static long Binomial(long N, long R, long p) {
//		long ans = ((fact[(int) N] * factorialNumInverse[(int) R]) % p * factorialNumInverse[(int) (N - R)]) % p;
//		return ans;
//	}

//	private static void six() throws Exception {
//		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//		int t = Integer.parseInt(br.readLine());
//		StringBuilder sb = new StringBuilder();
//
//		while (t-- > 0) {
//			String[] scn = (br.readLine()).trim().split(" ");
//			int n = Integer.parseInt(scn[0]);
//			int[] arr = new int[n];
//			scn = (br.readLine()).trim().split(" ");
//			for (int i = 0; i < n; i++) {
//				arr[i] = Integer.parseInt(scn[i]);
//			}
//
//		}
//		System.out.println(sb);
//		return;
//	}
	static void merge(int arr[], int l, int m, int r) {
		// Find sizes of two subarrays to be merged
		int n1 = m - l + 1;
		int n2 = r - m;

		/* Create temp arrays */
		int L[] = new int[n1];
		int R[] = new int[n2];

		/* Copy data to temp arrays */
		for (int i = 0; i < n1; ++i)
			L[i] = arr[l + i];
		for (int j = 0; j < n2; ++j)
			R[j] = arr[m + 1 + j];

		/* Merge the temp arrays */

		// Initial indexes of first and second subarrays
		int i = 0, j = 0;

		// Initial index of merged subarry array
		int k = l;
		while (i < n1 && j < n2) {
			if (L[i] <= R[j]) {
				arr[k] = L[i];
				i++;
			} else {
				arr[k] = R[j];
				j++;
			}
			k++;
		}

		/* Copy remaining elements of L[] if any */
		while (i < n1) {
			arr[k] = L[i];
			i++;
			k++;
		}

		/* Copy remaining elements of R[] if any */
		while (j < n2) {
			arr[k] = R[j];
			j++;
			k++;
		}
	}

	// Main function that sorts arr[l..r] using
	// merge()
	static void sort(int arr[], int l, int r) {
		if (l < r) {
			// Find the middle point
			int m = (l + r) / 2;

			// Sort first and second halves
			sort(arr, l, m);
			sort(arr, m + 1, r);

			// Merge the sorted halves
			merge(arr, l, m, r);
		}
	}

}
