Please help me. I don’t know what’s wrong with this!
int main()
{
int x;
long long int k;
scanf("%d",&x);
unsigned long long int n;
unsigned long long int count=0;
unsigned long long int total_combinations=0;
unsigned long long int one_combinations=0;
unsigned long long int two_combinations =0;
unsigned long long int one_count=0;
unsigned long long int two_count=0;
unsigned long long int other=0;
while(x>0)
{
scanf("%lld",&n);
long long int a[n];
count=0;
one_count=0;
two_count=0;
other=0;
for(k=0;k<n;k++)
{
scanf("%lld",&a[k]);
if(a[k]==1)
{
one_count++;
}
else if(a[k]==2)
{
two_count++;
}
else
{
other++;
}
}
total_combinations = (n * (n -1)) / 2;
one_combinations = (one_count * (one_count - 1));
one_combinations=one_combinations/2;
two_combinations = (two_count * (two_count - 1)) ;
two_combinations=two_combinations/2;
k = one_count * (n - one_count);
count = (total_combinations - one_combinations - two_combinations - k);
cout<<count<<endl;
x--;
}
return 0;
}