Go: package main

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

func getInputAsInt(in string) (int, int) {
	inArr := strings.Split(in, " ")
	// Atoi(s string) (i int, err error) のerrは捨てる
	val1, _ := strconv.Atoi(inArr[0])
	val2, _ := strconv.Atoi(inArr[1])
	return val1, val2
}

func euclidean(val1, val2 int) (int) {
	surp := 1
	for  {
		surp = val1 % val2
		if surp != 0 {
			val1 = val2
			val2 = surp
		} else {
			break
		}
	}
	return val2
}

func calcLCM(val1, val2, gcd int) (int) {
	return val1/gcd*val2
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	
	for scanner.Scan() {
		val1, val2 := getInputAsInt(scanner.Text())
		gcd := euclidean(val1, val2)
		lcm := calcLCM(val1, val2, gcd)
		fmt.Println(gcd, lcm)
	}
}

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

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

int lcm(int a, int b){
    int d;
    
    d = a * b / gcd(a, b);
    
    return d;
}

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

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

int main(void){
  int i,a,b,temp,r,lcm;

  while(cin >> a >> b){
    if(a<b){
      temp=a;
      a=b;
      b=temp;
    }

    int x=a,y=b;

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

    lcm=x*(y/a);
    printf("%d %d\n",a,lcm);
  }

  return 0;
}

C++: #include <iostream>

using namespace std;

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

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

int main() {
    int a, b;

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

C++: #include<iostream>

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

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

int main(){
    int a,b;
    while(std::cin >> a >> b){
        if(a == -1 or b == -1)  break;
        cin >> a >> b;
        std::cout << gcd(a, b) << " " << lcm(a, b)<< std::endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int gcd(int m,int n){
  while(m != n){
    if (m > n)
      m = m - n;
    else
      n = n - m;
  }
  return m;
}

int lcm(int m,int n){
  return m/gcd(m,n)*n;
}

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

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

C++: #include <iostream>
int GCD(int a, int b) {
	while (b != 0) {
		int r = a%b;
		a = b;
		b = r;
	}
	return a;
}
int main() {
	int a, b;
	while (std::cin >> a >> b) {
		int gcd = GCD(a, b);
		int lcm = round((double)a/gcd*b);
		std::cout << gcd << ' ' << lcm << std::endl;
	}
	return 0;
}

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

int main(void){
  int i,a,b,temp,r,lcm;

  while(cin >> a >> b){
    if(a<b){
      temp=a;
      a=b;
      b=temp;
    }

    int x=a,y=b;

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

    lcm=x*(y/a);
    printf("%d %d\n",a,lcm);
  }

  return 0;
}

C++: #include <stdio.h>

int main(void){
	long a=0, b=0;
	long x=0;
	long m=0, n=0;
	while(scanf("%d %d", &a, &b) != EOF){
		if(a>=b){
			m=a;n=b;
		}else{
			m=b;a=n;
		}
		while(n != 0){
			x = n;
			n = m % n;
			m = x;
		}
		printf("%d %d\n", m, a/m*b);
	}
	return 0;
}

C++: #include<stdio.h>
long long gcd(long long a,long long b){
	return b?gcd(b,a%b):a;
}
int main(void){
	long long  a,b;
	while(scanf("%lld",&a)==1&&scanf("%lld",&b)==1){
		long long temp=gcd(a,b);
		printf("%lld %lld\n",temp,a/temp*b);
	}
	return 0;
}

C++: 	//PCK2003////
#include<iostream>
#include<algorithm>
using namespace std;
#define long long ll;
int main(){
long long  a,b,ta,tb;
	
	while(cin>>a>>b){
	ta=a;tb=b;
	if(a<b)swap(a,b);
	while(1){
		long long  tmp=b;
		b=a%b;
		a=tmp;
		//cout<<a<<b<<endl;
		if(b==0)break;
	}
	cout<<a<<" "<<ta*tb/a<<endl;
	}
	return 0;
}

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

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

long long gcd(int m, int n) {
    if((0 == m) || (0 == n)) return 0;
    while(m != n) {
        if(m > n) m = m - n;
        else n = n - m;
    }
    return m;
}

long long lcm(int m, int n) {
    if((0 == m) || (0 == n)) return 0;
    return((m / gcd(m, n)) * n);
}

int main() {
    vector<int> v1;
    vector<int> v2;
    while(cin) {
        int a, b;
        cin >> a >> b;
        v1.push_back(a);
        v2.push_back(b);
    }
    for(int i=0; i<v1.size() - 1;i++) {
        cout << gcd(v1[i], v2[i]) << " " << lcm(v1[i], v2[i]) << endl;
    }
    return 0;
}

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

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

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

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

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


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

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
    long long a,b,i,f,j;
    while(cin>>a>>b){
    for(i=2000000000;i>0;i--){
        if(a>=2000000000||b>=2000000000||a<1||b<1){
            break;
        }
        if(a%i==0&&b%i==0){
            f=a*b/i;
            cout<<i<<" "<<f<<endl;
                break;
        }
    }
    }
    return 0;
}

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

int gcd(long num1,long num2) {
	if (num2 == 0) {
		return num1;
	}return gcd(num2, num1 % num2);
}

int lcm(long num1,long num2) {
	return num1 / gcd(num1, num2) * num2;
}

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

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

int main(){
  int a, b, c, d, tmp;
  while(cin >> a >> b){
     if(a < b){
       tmp = a;
       a = b;
       b = tmp;
     }
//?????§??¬?´???°
     for(int i = 1;i <= b;++i){
        if(a % i == 0 && b % i == 0)
          c = i;
     }
//????°???¬?????°
     while(1){
        int i = a;
        d = i;
        if(a % d == 0 && b % d == 0) break;
        a++;
     }
  }
  cout << c << " " << d << endl;
  return 0;
}

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

int main()

{
	unsigned int a,b;
	while(~scanf("%u%u",&a,&b)){
	    
		unsigned int c=a,d=b;
		while(a>0&&b>0){
			if(a>b)a=a%b;
			else b=b%a;
		}
		printf("%u %u\n",a+b,c/(a+b)*d);
		
	}
	
	return 0;
}

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

int u(int a, int b);
int l(int a, int b);

int main(){
  int a, b;
  int gcd, lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    gcd = u(a, b);
    lcm = l(a, b);
printf("%d %d\n",lcm, gcd);
    //std::cout << lcm << " " << gcd << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(a==1 || b==1){
    if(a>=b){
      a %= b;
    }else{
      b %= a;
    }
  }
  
  if(a==1) return b;
  else     return a;
}

int l(int a, int b){
  int i = 2;
  
  while(1){
    if(a%i==0){
      if(b%i==0) return i;
      else i++;
    }else{
      i++;
    }
  }
}