View Code of Problem 59

#include<stdio.h>
int main(void){
	int a,b;
	scanf("%d %d",&a,&b);
	int t=a*b;
	int m=0;
	while(m=a%b){
		a=b;
		b=m;
	}
	printf("%d %d",t/b,b);
}

Double click to view unformatted code.


Back to problem 59