My issue
My code
// Update the code below to solve the problem
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int N, M,i;
cin >> N >> M;
for( i=min(N,M);i>=1;i--)
{
if(N*M%(i*i)==0)
break;
}
cout<<(N*M)/(i*i)<<endl;
}
}
Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone