#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<string>
#include<cmath>
#include<map>
#include<set>
#define inf 99999999999999999
#define MOD 1000000007
#define endl "\n"
#define ll long long
#define forl(i,a,b) for(ll i=a;i<=b;i++)
#define forx(i,a,b) for(ll i=a;i>=b;i--)

using namespace std;
//---------------------------------------KHAI BAO BIEN----------------------------------------------
typedef pair<long long,long long> ii;
typedef pair<ii,long long> iii;
typedef pair<int,int> pii;
int tdong[5]={0,1,-1,0,0};
int tcot[5]={0,0,0,1,-1};
int tdm[9]={0,-2,-2,-1,-1,1,1,2,2};
int tcm[9]={0,-1,1,-2,2,-2,2,-1,1};
int t,n,m;
string cong( string s1,string s2)
{
    if(s1=="0" && s2=="0")return "0";
    if(s1.length()>s2.length())swap(s1,s2);
    s2="0"+s2;
    while(s1.length()!=s2.length())
    {
        s1="0"+s1;
    }
    int nho=0,nho_1=0;
    forx(i,s1.length()-1,0)
    {
        nho=(bool)(((int)s1[i]-48+(int)s2[i]-48)+nho_1>=10);
        s1[i]=(char)((((int)s1[i]-48+(int)s2[i]-48)+nho_1)%10+48);
        nho_1=nho;
        //cout<<s1<<" "<<s2<<" "<<nho<<endl;
    }

    while(s1[0]=='0')s1.erase(0,1);
    return s1;
}
struct fenwick_tree
{
    int tree[300005];
    void khoi_tao(ll max_n)
    {
        forl(i,0,max_n)tree[i]=0;
    }
    void update(ll to,ll value)
    {
        for(to;to<300004;to+=to&(-to))tree[to]=(tree[to]+value);
    }
    ll tinh_tong(ll to)
    {
        ll kq=0;
        if(to!=0)for(to;to>0;to-=to&(-to))kq=(kq+tree[to])%MOD;
        return kq;
    }
    ll sum(ll from,ll to)
    {
        return (tinh_tong(to)-tinh_tong(from-1))%MOD;
    }
};
//---------------------------------------CHUONG TRINH CON-----------------------------------------------------
struct segment_tree
{
    ll lazy[100005],s_tree[100005];
    void khoi_tao()
    {
        forl(i,1,100004){lazy[i]=0;s_tree[i]=0;}
    }
    void update_range(ll vt,ll r_left,ll r_right,ll t_left,ll t_right,ll value)
    {
        if(lazy[vt]!=0)
        {
            s_tree[vt]+=lazy[vt];
            lazy[vt*2]+=lazy[vt];
            lazy[vt*2+1]+=lazy[vt];
            lazy[vt]=0;
        }
        if(r_left>t_right || t_left>r_right)return;
        else if(r_left<=t_left && r_right>=t_right)
        {
            s_tree[vt]+=value;
            lazy[vt*2]+=value;
            lazy[vt*2+1]+=value;
            return;
        }
        else
        {
            ll mid=(t_left+t_right)/2;
            update_range(vt*2,r_left,r_right,t_left,mid,value);
            update_range(vt*2+1,r_left,r_right,mid+1,t_right,value);
            //max,min
            s_tree[vt]=max(s_tree[vt*2],s_tree[vt*2+1]);
        }
    }
    ll max_range(ll vt,ll r_left,ll r_right,ll t_left,ll t_right )
    {
        if(lazy[vt]!=0)
        {
            s_tree[vt]+=lazy[vt];
            lazy[vt*2]+=lazy[vt];
            lazy[vt*2+1]+=lazy[vt];
            lazy[vt]=0;
        }
        if(r_left>t_right || r_right<t_left)return -inf;
        else if(r_left<=t_left && r_right>=t_right)return s_tree[vt];
        else
        {
            ll mid=(t_left+t_right)/2;
            return max(max_range(vt*2,r_left,r_right,t_left,mid),max_range(vt*2+1,r_left,r_right,mid+1,t_right));
        }
    }
};
ll ucln(ll a,ll b)
{
    if(a==b || a==0 || b==0)return max(a,b);
    if(a>b)return ucln(a%b,b);
    if(a<b)return ucln(a,b%a);
}
ll pow_f(ll a,ll b)
{
    ll kq=1;
    while(b>0)
    {
        if(b&1)kq*=a;
        else a*=a;
        b/=2;
    }
    return kq;
}
short parent[1005];
bool visit[5005];
long long d[5005],table[2005][2005];

int getmin()
{
    ll dd=inf,u=0;
    forl(i,1,n)if(!visit[i] && d[i]<dd){dd=d[i];u=i;}
    return u;
}
void prim(int s)
{
    forl(i,1,n){visit[i]=false;d[i]=inf;}
    d[s]=0;
    while(true)
    {
        int u=getmin();
        //cout<<u<<endl;
        if(u==0)break;
        visit[u]=true;
        forl(i,1,n)
        {
            if(!visit[i])d[i]=min(d[i],table[u][i]);
        }
    }
}
ll distra(int s,int t)
{
    forl(i,1,n){visit[i]=false;d[i]=inf;}
    d[s]=0;
    while(true)
    {
        int u=getmin();
        //cout<<u<<endl;
        if(u==0 || u==t)return d[t];
        visit[u]=true;
        forl(i,1,n)
        {
            if(!visit[i])d[i]=min(d[i],max(table[u][i],d[u]));
        }
    }
}
int find_parent(int a)
{
    if(parent[a]==a)return parent[a];
    else return parent[a]=find_parent(parent[a]);
}
void join(int a,int b)
{
    a=find_parent(a);
    b=find_parent(b);
    parent[b]=a;
}
bool check(int i,int j)
{
    return(i>=1 && j>=1 && i<=n && j<=m);
}
struct edge
{
    ll ii,jj,ww;
    edge(int ii,int jj, int ww)
    {
        this->ii=ii;
        this->jj=jj;
        this->ww=ww;
    }
};
void distra_heap(int s,int t,vector<ii> canh[])
{
    forl(i,1,n){d[i]=inf;visit[i]=false;}
    d[s]=0;
    priority_queue<ii, vector<ii>, greater<ii> > pq;
    pq.push(ii(0,s));
    while(!pq.empty())
    {
        int u=pq.top().second;
        pq.pop();
        if(visit[u])continue;
        visit[u]=true;
        forl(i,0,canh[u].size()-1)
        {
            d[canh[u][i].first]=min(d[canh[u][i].first],d[u]+canh[u][i].second);
            pq.push(ii( d[canh[u][i].first],canh[u][i].first));
        }
    }
}
int a[100005];
int k,p,x,y;
ll sum(int l,int r)
{
    return a[r]-a[max(l-k,0)];
}
//---------------------------------------CHUONG TRINH CHINH--------------------------------------------------

int main()
{
/**/#ifndef ONLINE_JUDGE
   freopen("test.inp","r",stdin);
   freopen("test.out","w",stdout);
#endif // ONLINE_JUDGE
  // ios_base::sync_with_stdio(0);cin.tie(0);//cout.tie(0);

   //cin.ignore();
  // cout<<fixed;
  // cout<<setprecision(3);
   /**/
   int t=1;
    /**/cin>>t;
    int a[205],v[205];
    int n,kq=0;
   while(t--)
   {
       cin>>n;kq=0;
       forl(i,1,n){cin>>a[i];}
       forl(i,1,100)v[i]=0;
       sort(a+1,a+1+n);
       forl(i,1,n-1)
       forl(j,i+1,n)
       {
           if(!v[a[j]-a[i]]){kq++;v[a[j]-a[i]]=true;}
       }
       cout<<kq<<endl;
   }
}

### Prompt

Develop a solution in Cpp to the problem described below:

Argus was charged with guarding Io, which is not an ordinary cow. Io is quite an explorer, and she wanders off rather frequently, making Argus' life stressful. So the cowherd decided to construct an enclosed pasture for Io.

There are n trees growing along the river, where Argus tends Io. For this problem, the river can be viewed as the OX axis of the Cartesian coordinate system, and the n trees as points with the y-coordinate equal 0. There is also another tree growing in the point (0, 1). 

Argus will tie a rope around three of the trees, creating a triangular pasture. Its exact shape doesn't matter to Io, but its area is crucial to her. There may be many ways for Argus to arrange the fence, but only the ones which result in different areas of the pasture are interesting for Io. Calculate the number of different areas that her pasture may have. Note that the pasture must have nonzero area.

Input

The input consists of multiple test cases. The first line contains an integer t (1 ≤ t ≤ 100) — the number of test cases. Then t test cases follow, each one is described in two lines.

In the first line of each test case there is a single integer n (1 ≤ n ≤ 50) denoting the number of trees growing along the river. Next line contains n distinct integers x_1 < x_2 < … < x_{n - 1} < x_n (1 ≤ x_i ≤ 50), the x-coordinates of trees growing along the river.

Output

In a single line output an integer, the number of different nonzero areas that triangles with trees as vertices may have.

Example

Input


8
4
1 2 4 5
3
1 3 5
3
2 6 8
2
1 2
1
50
5
3 4 5 6 8
3
1 25 26
6
1 2 4 8 16 32


Output


4
2
3
1
0
5
3
15

Note

In the first test case, we have 6 non-degenerate triangles with the following areas: 0.5, 0.5, 1, 1.5, 1.5 and 2. The pasture can have 4 different areas, and thus 4 is the answer.

In the second test case, we have 3 non-degenerate triangles with the following areas: 1, 1 and 2. The pasture can have 2 different areas, so 2 is the answer.

The following two drawings present the situation in the second test case. The blue triangles in the first drawing have area 1. The red triangle in the second drawing has area 2.

<image>

### Response

```cpp
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<string>
#include<cmath>
#include<map>
#include<set>
#define inf 99999999999999999
#define MOD 1000000007
#define endl "\n"
#define ll long long
#define forl(i,a,b) for(ll i=a;i<=b;i++)
#define forx(i,a,b) for(ll i=a;i>=b;i--)

using namespace std;
//---------------------------------------KHAI BAO BIEN----------------------------------------------
typedef pair<long long,long long> ii;
typedef pair<ii,long long> iii;
typedef pair<int,int> pii;
int tdong[5]={0,1,-1,0,0};
int tcot[5]={0,0,0,1,-1};
int tdm[9]={0,-2,-2,-1,-1,1,1,2,2};
int tcm[9]={0,-1,1,-2,2,-2,2,-1,1};
int t,n,m;
string cong( string s1,string s2)
{
    if(s1=="0" && s2=="0")return "0";
    if(s1.length()>s2.length())swap(s1,s2);
    s2="0"+s2;
    while(s1.length()!=s2.length())
    {
        s1="0"+s1;
    }
    int nho=0,nho_1=0;
    forx(i,s1.length()-1,0)
    {
        nho=(bool)(((int)s1[i]-48+(int)s2[i]-48)+nho_1>=10);
        s1[i]=(char)((((int)s1[i]-48+(int)s2[i]-48)+nho_1)%10+48);
        nho_1=nho;
        //cout<<s1<<" "<<s2<<" "<<nho<<endl;
    }

    while(s1[0]=='0')s1.erase(0,1);
    return s1;
}
struct fenwick_tree
{
    int tree[300005];
    void khoi_tao(ll max_n)
    {
        forl(i,0,max_n)tree[i]=0;
    }
    void update(ll to,ll value)
    {
        for(to;to<300004;to+=to&(-to))tree[to]=(tree[to]+value);
    }
    ll tinh_tong(ll to)
    {
        ll kq=0;
        if(to!=0)for(to;to>0;to-=to&(-to))kq=(kq+tree[to])%MOD;
        return kq;
    }
    ll sum(ll from,ll to)
    {
        return (tinh_tong(to)-tinh_tong(from-1))%MOD;
    }
};
//---------------------------------------CHUONG TRINH CON-----------------------------------------------------
struct segment_tree
{
    ll lazy[100005],s_tree[100005];
    void khoi_tao()
    {
        forl(i,1,100004){lazy[i]=0;s_tree[i]=0;}
    }
    void update_range(ll vt,ll r_left,ll r_right,ll t_left,ll t_right,ll value)
    {
        if(lazy[vt]!=0)
        {
            s_tree[vt]+=lazy[vt];
            lazy[vt*2]+=lazy[vt];
            lazy[vt*2+1]+=lazy[vt];
            lazy[vt]=0;
        }
        if(r_left>t_right || t_left>r_right)return;
        else if(r_left<=t_left && r_right>=t_right)
        {
            s_tree[vt]+=value;
            lazy[vt*2]+=value;
            lazy[vt*2+1]+=value;
            return;
        }
        else
        {
            ll mid=(t_left+t_right)/2;
            update_range(vt*2,r_left,r_right,t_left,mid,value);
            update_range(vt*2+1,r_left,r_right,mid+1,t_right,value);
            //max,min
            s_tree[vt]=max(s_tree[vt*2],s_tree[vt*2+1]);
        }
    }
    ll max_range(ll vt,ll r_left,ll r_right,ll t_left,ll t_right )
    {
        if(lazy[vt]!=0)
        {
            s_tree[vt]+=lazy[vt];
            lazy[vt*2]+=lazy[vt];
            lazy[vt*2+1]+=lazy[vt];
            lazy[vt]=0;
        }
        if(r_left>t_right || r_right<t_left)return -inf;
        else if(r_left<=t_left && r_right>=t_right)return s_tree[vt];
        else
        {
            ll mid=(t_left+t_right)/2;
            return max(max_range(vt*2,r_left,r_right,t_left,mid),max_range(vt*2+1,r_left,r_right,mid+1,t_right));
        }
    }
};
ll ucln(ll a,ll b)
{
    if(a==b || a==0 || b==0)return max(a,b);
    if(a>b)return ucln(a%b,b);
    if(a<b)return ucln(a,b%a);
}
ll pow_f(ll a,ll b)
{
    ll kq=1;
    while(b>0)
    {
        if(b&1)kq*=a;
        else a*=a;
        b/=2;
    }
    return kq;
}
short parent[1005];
bool visit[5005];
long long d[5005],table[2005][2005];

int getmin()
{
    ll dd=inf,u=0;
    forl(i,1,n)if(!visit[i] && d[i]<dd){dd=d[i];u=i;}
    return u;
}
void prim(int s)
{
    forl(i,1,n){visit[i]=false;d[i]=inf;}
    d[s]=0;
    while(true)
    {
        int u=getmin();
        //cout<<u<<endl;
        if(u==0)break;
        visit[u]=true;
        forl(i,1,n)
        {
            if(!visit[i])d[i]=min(d[i],table[u][i]);
        }
    }
}
ll distra(int s,int t)
{
    forl(i,1,n){visit[i]=false;d[i]=inf;}
    d[s]=0;
    while(true)
    {
        int u=getmin();
        //cout<<u<<endl;
        if(u==0 || u==t)return d[t];
        visit[u]=true;
        forl(i,1,n)
        {
            if(!visit[i])d[i]=min(d[i],max(table[u][i],d[u]));
        }
    }
}
int find_parent(int a)
{
    if(parent[a]==a)return parent[a];
    else return parent[a]=find_parent(parent[a]);
}
void join(int a,int b)
{
    a=find_parent(a);
    b=find_parent(b);
    parent[b]=a;
}
bool check(int i,int j)
{
    return(i>=1 && j>=1 && i<=n && j<=m);
}
struct edge
{
    ll ii,jj,ww;
    edge(int ii,int jj, int ww)
    {
        this->ii=ii;
        this->jj=jj;
        this->ww=ww;
    }
};
void distra_heap(int s,int t,vector<ii> canh[])
{
    forl(i,1,n){d[i]=inf;visit[i]=false;}
    d[s]=0;
    priority_queue<ii, vector<ii>, greater<ii> > pq;
    pq.push(ii(0,s));
    while(!pq.empty())
    {
        int u=pq.top().second;
        pq.pop();
        if(visit[u])continue;
        visit[u]=true;
        forl(i,0,canh[u].size()-1)
        {
            d[canh[u][i].first]=min(d[canh[u][i].first],d[u]+canh[u][i].second);
            pq.push(ii( d[canh[u][i].first],canh[u][i].first));
        }
    }
}
int a[100005];
int k,p,x,y;
ll sum(int l,int r)
{
    return a[r]-a[max(l-k,0)];
}
//---------------------------------------CHUONG TRINH CHINH--------------------------------------------------

int main()
{
/**/#ifndef ONLINE_JUDGE
   freopen("test.inp","r",stdin);
   freopen("test.out","w",stdout);
#endif // ONLINE_JUDGE
  // ios_base::sync_with_stdio(0);cin.tie(0);//cout.tie(0);

   //cin.ignore();
  // cout<<fixed;
  // cout<<setprecision(3);
   /**/
   int t=1;
    /**/cin>>t;
    int a[205],v[205];
    int n,kq=0;
   while(t--)
   {
       cin>>n;kq=0;
       forl(i,1,n){cin>>a[i];}
       forl(i,1,100)v[i]=0;
       sort(a+1,a+1+n);
       forl(i,1,n-1)
       forl(j,i+1,n)
       {
           if(!v[a[j]-a[i]]){kq++;v[a[j]-a[i]]=true;}
       }
       cout<<kq<<endl;
   }
}

```