#include<stdio.h>
int main()
{
int m,n;
scanf("%d%d",&m,&n);
int a,b,c;
c = n;
if(n>m)
c = m;
for(a = 1;a<=c;a++){
if(m%a ==0&&n%a ==0)
b =a;
}
printf("%d",b);
int d;
int e,f;
for(d = m;d>0;d++){
e = d%m;
f = d%n;
if(e == 0&&f ==0){
printf(" %d\n",d);
break;
}
}
return 0;
}
12-13
2947
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)