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