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
//#pragma GCC optimize "trapv"
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
//#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC target("sse4")

#include<bits/stdc++.h>
using namespace std;

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//find_by_order(k)  returns iterator to kth element starting from 0;
//order_of_key(k) returns count of elements strictly smaller than k;
//erase,insert same as normal set

//#define      ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define        fast          ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define        f             first
#define        s             second
#define        pb            push_back
#define        eb            emplace_back
#define        mp            make_pair
#define        forn(i,n)     for(int i=0;i<n;++i)
#define        forf(i, s, e) for(int i = s; i <= e; ++i)
#define        forb(i, s, e) for(int i = s; i >= e; --i)
#define        show(b)       for(auto const&x: b) cout<<x<<" "
#define        sshow(b)      for(auto x:b) cout<<x<<" "
#define        fix(b,val)    memset(b,val,sizeof(b))
#define        pill(b,n,v)   fill(b,b+n,v)
#define        itn           int
#define        w(t)          int t;cin>>t;while(t--)
#define        intmax        INT_MAX
#define        intmin        INT_MIN
#define        nl            "\n"
#define        all(v)        v.begin(),v.end()
#define        vt            vector
#define        PI            acos(-1)
#define        sinDegrees(x) sin((x) * PI / 180.0)
#define        cosDegrees(x) cos((x) * PI / 180.0)
#define        tanDegrees(x) tan((x) * PI / 180.0)
#define        atanDegrees(x) atan(x)* 180.0 / PI
#define        asinDegrees(x) asin(x)* 180.0 / PI
#define        EPS            0.000000001
#define        trace1(x)                cerr<<#x<<": "<<x<<endl
#define        trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define        trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define        trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define        trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define        trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

typedef       long long int ll;
typedef       long double LD;
typedef       unsigned long long int LL;
typedef       pair<int,int> pii;
typedef       pair<long long int,int> pli;
typedef       pair<int,long long int> pil;
typedef       pair<long long int,long long int> pll;
const int N=1e5+5;
const int mod=1e9+7;
//mt19937 rnd(time(NULL));

/*------Global--------*/
vt<ll> a;
/*-----Functions------*/

inline int add(int a, int b) { int ret=((ll)a+b)%mod; if(ret<0) ret+=mod; return ret; }
inline int mul(int a, int b) { int ret=((ll)a*b)%mod; if(ret<0) ret+=mod; return ret; }
template<typename... Args>
inline int add(int a, Args... args) { return add(a, add(args...)); }
template<typename... Args>
inline int mul(int a, Args... args) { return mul(a, mul(args...)); }
inline int addm(int a, int b, int MOD) { int ret=((ll)a+b)%MOD; if(ret<0) ret+=MOD; return ret; }
inline int mulm(int a, int b, int MOD) { int ret=((ll)a*b)%MOD; if(ret<0) ret+=MOD; return ret; }
inline int addm(int a, int b, int c, int MOD) { return addm(a, addm(b, c, MOD), MOD); }
inline int mulm(int a, int b, int c, int MOD) { return mulm(a, mulm(b, c, MOD), MOD); }

template<typename T>
void show2d(const vector<vector<T>>& adj) {
    for(auto x:adj) {
        for(auto y:x)
            cout<<y<<" ";
        cout<<"\n";
    }
}

ll modexp(ll a,ll b,ll mod) {
    ll x=1;
    while(b)
    {
        if(b&1) x = ((x%mod) * (a%mod))%mod;
        a = ((a%mod) * (a%mod))%mod;
        b = b / 2;
    }
    return x;
}

// void initSieve(int lim) {
//     sieve  = vt<bool>(lim,1);
//     sieve[0] = 0;
//     sieve[1] = 0;
//     sieve[2] = 1;
//     for(int i=2; (i*i) <= lim; ++i) {
//         if(sieve[i])
//         for(int j=i*i; j<lim; j+=i) {
//             sieve[j] = 0;
//         }
//     }
//     for(int i=0; i<lim; ++i)
//         cout<<sieve[i]<<" ";
//     cout<<nl;
// }

// void initFact(int lim) {
//     fact = vt<ll>(lim);
//     fact[0] = 1;
//     for(int i=1; i<lim; ++i)
//         fact[i] = (fact[i-1]%mod * i%mod) %mod;
//     for(int i=1; i<lim; ++i)
//         cout<<fact[i]<<" ";
//     cout<<nl;
// }

// ll ncr(ll n, ll r) {
//     return ((fact[n]%mod)*((modexp(fact[r], mod-2, mod)%mod * modexp(fact[n-r], mod-2, mod)%mod)% mod)) % mod;
// }

int findInString(string &str, char ch) {
    int n = str.length();
    for(int i=0; i<n; ++i) {
        if(str[i] == ch) return i;
    }
    return -1;
}

void rf()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

class Fentree {
private:
    vt<int> bit;
public:
    Fentree(){}
    Fentree(int n) {
        bit = vt<int> (n+5, 0);
    }
    void update(int pos, int val) {
        for(int i = pos; i < bit.size() ; i = i + (i & (-i))) {
            bit[i] += val;
        }
    }
    int query(int pos) {
        int smallerOrEq = 0;
        for(int i = pos; i > 0; i = i - (i & (-i))) {
            smallerOrEq += bit[i];
        }
        return smallerOrEq;
    }
};

void solve() {
    int n;
    cin >> n;
    a = vt<ll> (n);
    for(auto &it: a) {
        cin >> it;
    }
    sort(all(a));
    Fentree fw(n);
    for(int i = 0; i < n; ++i) {
        fw.update(a[i], 1);
    }
    ll ans = 0;
    for(int i = 0; i < n; ++i) {
        fw.update(a[i], -1);
        int twoplus = fw.query(a[i] + 2);
        ans += (twoplus * 1LL * (twoplus - 1)) / 2LL;
    }
    cout << ans << nl;
}

// Thought  abt edge cases (n == 1??????????????)

int32_t main()
{
    fast;
    //cin.exceptions(cin.failbit);
    //rf();
    w(t) 
    {
        solve();
    }
}