My issue
plz debug my code…
My code
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a,ll b){
if(a==b) return a;
if(a>b){
if(a>0 && b==0){
return a;
}
else{
return gcd(a%b,b);}
}
else {
if(a<b ){
if(b>0 && a==0){
return b;}
}
else{
return gcd(a,b%a); }
}
}
ll lcm(ll a,ll b){
ll e=(a*b)/gcd(a,b);
return e;}
int main() {
// your code goes here
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--){
ll n,k=0;
cin>>n;
ll h[n];
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(gcd(h[i],h[j])==lcm(h[i],h[j])){
k++;
}
}
}
cout<<k<<endl;
}
return 0;
}
Problem Link: EQPAIR Problem - CodeChef