Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanLines)
	defer out.Flush()

	for sc.Scan() {
		x, y := nextInts()
		if x < y {
			rep := x
			x, y = y, rep
		}
		gcd := x % y
		lcm := x * y
		for gcd != 0 {
			x, y, gcd = y, gcd, x%y
		}
		fmt.Fprintf(out, "%d %d\n", y, lcm/y)
	}

}

func nextInts() (a, b int) {
	s := strings.Split(sc.Text(), " ")
	ra, _ := strconv.Atoi(s[0])
	rb, _ := strconv.Atoi(s[1])
	a = ra
	b = rb
	return
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

long long a, b;

long long gcd(long long a, long long b) {
   if(b == 0) return a;
   return gcd(b, a % b);
}

long long lcm(long long a, long long b) {
    return (a * b) / gcd(a, b);
}

int main(void) {
    while(cin >> a >> b) {
        cout << gcd(a, b) << " " << lcm(a, b) << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cmath>
#include<stdio.h>
using namespace std;

int main(){
	long long a, b;
	long long x, y;

	while (cin >> a >> b){
		if (a > b){
			x = a;
			y = b;
		}
		else{
			x = b;
			y = a;
		}
		while (x % y != 0){
			y = x % y;
		}

		cout << y << " " << (a / y * b) << endl;
	}
}

C++: #include <stdio.h>
int main(void){
    long long a, b, c, d, tmp;
        scanf("%d %d", &a, &b);
     d = a * b;
    if(a < b) {
        tmp = a;
        a = b;
        b = tmp;
    }
     c = a % b;
    while(c != 0) {
        a = b;
        b = c;
        c = a % b;
    }
        printf("%d %d\n", b, d / b);
            return 0;
}

C++: #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;

int gcd(int a, int b){
    if(b==0){
        return a;
    }
    return gcd(b, a%b);
}

int main()
{   int a, b;
    int temp;
    while(true){
        if(!(cin >> a >> b))exit(0);
       
        if(a<b){
            temp = b;
            b = a;
            a = temp;
        }
        temp = gcd(a, b);
        cout << temp << " " << a/temp*b << endl;
    
    }    
    return 0;
}

C++: #include <stdio.h>

int main(){
long int a,b;
long int x,y,i,j;

while(scanf("%d %d",&a,&b) != EOF){
if(a>=b){
for(i=b;i>0;i--){
if(a%i==0 && b%i==0){
x=i;
break;
}
}
}
else if(b>a){
for(i=a;i>0;i--){
if(a%i==0 && b%i==0){
x=i;
break;
}
}
}
if(a>=b){
for(i=1;i<11;i++){
for(j=1;j<11;j++){
if(a*i==b*j){
y=a*i;
break;
}
}
if(a*i==b*j)break;
}
}
else if(b>a){
for(i=1;i<11;i++){
for(j=1;j<11;j++){
if(b*i==a*j){
y=b*i;
break;
}
}
if(b*i==a*j)break;
}
}
printf("%d %d\n",x,y);
}
return 0;
}

C++: /*
　　　　 ∧＿∧　にっぽんちゃちゃちゃ
　／＼（　・∀・）／ヽ
（ ●　と　　　つ　● ）　にっぽんちゃちゃちゃ
　＼/⊂、 ノ　　＼ノ
　　　　　し'
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define MOD 1000000007
#define INF 9223372036854775807

signed main()
{
  string xyz ="";
int x=0,y=0,z=0,w=0,i=0,j=0,n=0;
while(std::cin >> x>>y){
  z=x*y;
  w=x%y;
  while(w!=0){
    x=y;
    y=w;
    w=x%y;
  }
  std::cout <<y <<" "<<z/y<< '\n';
}

}

C++: #include <stdio.h>

int gcd(int a, int b){
	int t;
	while((a % b) != 0){
		t = b;
		b = a % b;
		a = t;
	}
	return b;
}

int main(){
	int a,b;
	int t;
	while(scanf("%d%d", &a, &b) != EOF){
		t = gcd(a,b);
		printf("%d %d\n", t, a/t*b);
	}
}

C++: #include <iostream>
using namespace std;
int LCM(int a, int b);
int GCD(int a, int b, int ans1);

int main(){
    int a,b;
    while(cin >> a >> b){
        int ans1 = LCM(a,b);
        int ans2 = GCD(a,b,ans1);
        cout << ans1 << " " << ans2 << endl;
    }
}

int LCM(int a, int b){
    int r;
    if(a < b){
        int tmp = a;
        a = b;
        b = tmp;
    }
    while(1){
        r = a % b;
        if(r == 0) break;
        a = b;
        b = r;
    }
    
    return b;
}

int GCD(int a, int b, int ans1){
    int ans = b / ans1 * a;
    return ans;
}

C++: #include <bits/stdc++.h>
using namespace std;

template<class T>
T gcd(T a,T b){
	return b ? gcd(b,a % b) : a;
}

template<class T>
T lcm(T a,T b){
	return a / gcd(a,b) * b;
}

signed main(){
	int a,b;
	while(cin >> a >> b){
		cout << gcd(a,b) << " " << lcm(a,b) << endl;
	}
}

C++: #include<iostream>

int main(){
	long int a, b, r;
	
	while(std::cin >> a >> b){
		long int product = a*b;
		
		// GCD
		if(a < b){
			long int temp = a;
			a = b;
			b = temp;
		}
		while((r = a%b) != 0){
			a = b;
			b = r;
		}
		
		// LCM
		long int lcm = product / b;
		
		// show
		std::cout << b << lcm << std::endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>


unsigned int gcd(unsigned int a, unsigned int b) {
	unsigned int r;

	while (b != 0) {
		r = a % b;
		a = b;
		b = r;
	}

	return a;
}

unsigned int lcm(unsigned int a, unsigned int b) {
	unsigned int mult;

	if (a > b) {
		unsigned int tmp = a;
		a = b;
		b = tmp;
	}

	for (unsigned int k = 1; k <= a; k++) {
		mult = b * k;
		if (mult % a == 0) { return mult; }
	}

	return 0;
}

int main() {
	unsigned int a, b;
	
	while (!std::cin.eof()) {
		std::cin >> a >> b;
		std::cout << gcd(a, b) << " " << lcm(a, b) << std::endl;
	}
}

C++: #include<stdio.h>
int main(void) {
	long long int a, b, minans = 0, maxans = 0;
	while (scanf("%lld %lld", &a, &b) != EOF)
	{
		for (long long int i = (b / 2); i >= 1; i--)
		{
			if (a%i == 0 && b%i == 0) {
				maxans = i;
				break;
			}
		}
		for (long long int i = 1; i <= a; i++)
		{
			if ((i*b) % a == 0) {
				minans = i*b;
				break;
			}
		}
		printf("%lld %lld\n", maxans, minans);
	}
	return 0;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
long long gcd(long long a,long long b){
    if(b==0)return a;
    else return gcd(b,a%b);
}
int main(){
    long long a,b;
    while(cin>>a>>b){
        long long x;
        if(a>b)x=gcd(a,b);
        else x=gcd(b,a);
        cout<<x<<" "<<a/x*b<<endl;

    }
}

C++: #include <iostream>
#include <math.h>
using namespace std;

int main()
{
	long a,b;
	while(cin>>a>>b)
	{
		long numerator=min(a,b);
		long denominator=max(a,b);
		long remainder = a % b;
		while(remainder !=0)
		{
			 numerator   = denominator;
			denominator = remainder;
			remainder   = numerator % denominator;
		}
		long gcd = denominator;
		long long lcm = a * (b / gcd);
		cout<<gcd<<" "<<lcm<<endl;
		/*
		for(long i=min(a,b);i>0;i--)
		{
			if(a%i ==0)
				if(b%i==0)
				{
					cout<<i<<" ";
					break;
				}
		}
		for(long i=max(a,b);i<=2000000000;i+=max(a,b))
		{
			if(i%a ==0)
				if(i%b==0)
				{
					cout<<i<<endl;
					break;
				}
		}*/
	}
}