My issue
My code
#include <iostream>
using namespace std;
#include <bits/stdc++.h>
# define ll long long int
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
ll n,c=0;
cin>>n;
set<ll>A;
for(int i=0;i<n;i++)
cin>>A.insert;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
//for HCF
while(A[i]!=A[j])
{
if(A[i]>A[j])
A[i]-=A[j];
else
A[j]-=A[i];
}
ll h=A[i];
// for lcm
ll l=(A[i]*A[j])/h;
if(h==l)
c++;
}
}
cout<<c<<endl;
}
return 0;
}
Problem Link: EQPAIR Problem - CodeChef