My issue
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int a,b,n,g,l;
cin>>a>>b;
if(a>b){
n=b;
}
else{
n=a;
}
for(int i=1; i<=n; i++){
if(a%i==0 && b%i==0){
g=i;
}
}
l=(a*b)/g;
cout<<g<<" "<<l<<endl;
}
return 0;
}
Problem Link: FLOW016 Problem - CodeChef