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