#include<stdio.h> int main() { int n,m; scanf("%d %d",&n,&m); int t,x; x=n*m; // if(n>m) // { // t=n; // } // else t=m; while(m!=0) { t=n%m; n=m; m=t; } printf("%d %d",x/n,n); return 0; }
Double click to view unformatted code.