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