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