#include <stdio.h>
int GCD(int a,int b) {
if (a<b) {
int tmp =a;
a=b;
b=tmp;
}
int r=a%b;
while (r!=0) {
a=b;
b=r;
r=a%b;
}
return b;
}
int main() {
int a,b;
scanf("%d %d",&a,&b);
int gcd;
gcd=GCD(a,b);
printf("%d\n%d",gcd,a*b/gcd);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: