1063: 最大公约与最小公倍
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);int m=cin.nextInt();int n=cin.nextInt();System.out.printf("%d %d",gcd(m,n),m/gcd(m,n)*n);}public static int gcd(int a,int b){
return(a%b==0)?b:gcd(b,a%b);}
}