#include<stdio.h> int main() { int a,b,c,d,e,f; scanf("%d %d",&a,&b); c=a;d=b; while(a%b!=0) { e=a%b; a=b; b=e; } f=c*d/b; printf("%d %d",f,b); return 0; }
Double click to view unformatted code.