#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <queue>
using namespace std;
 
int A, B;
 
// 유클리드 호제법 
int gcd(int a, int b)
{
    if(b == 0)
    {
        return a;
    }
    else
    {
        return gcd(b, a%b);
    }
}
 
int main(void)
{
//    freopen("B10430_input.txt", "r", stdin);
    
    cin >> A >> B;
    
    int GCD = gcd(A, B);
    int LCD = A * B / GCD;
    
    cout << GCD << endl;
    cout << LCD << endl;
    
    return 0;
}
cs

+ Recent posts