Go: package main

import (
        "fmt"
        "bufio"
        "os"
        "math"
)

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                if x == 0.0 {
                        x = math.Abs(x)
                }
                if y == 0.0 {
                        y = math.Abs(y)
                }
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}

C++: #include <iostream>
#include <cstdio>

using namespace std;

void solve(int a, int b, int c, int d, int e, int f) {
	double x = (f - (double)e*c/b) / (d - (double)e*a/b);
	double y = (c - a*x) / b;
	if (x == 0) x = 0.000;
	if (y == 0) y = 0.000;
	printf("%4.3f %4.3f\n", x, y);
}

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void){
  float a,b,c,d,e,f,x,y;
  int j=0,i=0;
  float n[2][1000];
  while(scanf("%f %f %f %f %f %f",&a, &b, &e, &c, &d, &f)!=EOF){
    if(a*d-b*c!=0){
      //  printf(" %f %f %f %f %f %f %f\n",a,b,e,c,d,f,((d*e-b*f)/(a*d-b*c)));
      x=((d*e-b*f)/(a*d-b*c));
      y=((a*f-c*e)/(a*d-b*c));
      n[0][i]=x;
      n[1][i]=y;
      //printf(" %.3f %.3f %d\n",x,y);
      //printf(" %.3f %.3f %d\n",n[0][i],n[1][i],i);
     i++;}}
 
  while(j<i){
    printf(" %.3f %.3f \n",n[0][j],n[1][j]);
    j++;  
}



  return 0;
}

C++: #include<stdio.h>
int main()

{
    int a,b,c,d,e,f;
    while(scanf("%d%d%d%d%d%d",a,b,c,d,e,f))
    {
        
        float x=(c*e-b*f)/(a*e-b*f);
        float y=(c*d-a*f)/(b*d-a*e);
        printf("%.3f %.3f\n",x,y);
        
    }
    return 0;
}

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

int main(){
    double a, b, c, d, e, f;
    while(cin >> a >> b >> c >> d >> e >> f){
        double y = (c-(a/d)*f)/(b-(a/d)*e);
        double x = (c - b*y) / a;
        printf("%.4f %.4f", x,y);
        puts("");
    }
    return 0;
}

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

using namespace std;

int main() {
	double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		double x = (e*c-b*f)/(a*e-b*d);
		double y = (-(d*c)+a*f)/(a*e-b*d);
		if (x==0) x = 0; if (y==0) y=0;
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cassert>
using namespace std;

#define GET_ARG(a,b,c,F,...) F
#define REP3(i,s,e) for (i = s; i <= e; i++)
#define REP2(i,n) REP3 (i,0,(int)(n)-1)
#define REP(...) GET_ARG (__VA_ARGS__,REP3,REP2) (__VA_ARGS__)
#define RREP3(i,s,e) for (i = s; i >= e; i--)
#define RREP2(i,n) RREP3 (i,(int)(n)-1,0)
#define RREP(...) GET_ARG (__VA_ARGS__,RREP3,RREP2) (__VA_ARGS__)
#define DEBUG(x) cerr << #x ": " << x << endl

int main(void) {
    int a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f) {
        double det = a * e - b * d;
        int x = e * c - b * f;
        int y = a * f - d * c;
        if (x == 0) cout << 0 << " ";
        else cout << x / det << " ";
        if (y == 0) cout << 0 << endl;
        else cout << y / det << endl;
    }
    return 0;
}

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

int main() {
	double a, b, c, d, e, f;
	double x, y;
	double det;
	while (cin >> a >> b >> c >> d >> e >> f) {
		det = a * e - b * d;
		x = (e * c - b * f) / det;
		y = (-d * c + a * f) / det;
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include <iostream>
#include <iomanip>

/*
ax + by = c
dx + ey = f

x = (c-by)/a
d(c-by)/a + ey = f
dc/a - dby/a + ey = f
ey - dby/a = f - dc/a
y(e-db/a) = f - dc/a
y = (f-dc/a)/(e-db/a)

aex + bey = ce
bdx + bey = bf
aex - bdx = ce - bf
x(ae - bd) = ce - bf
x = (ce - bf)/(ae - bd)
by = c - ax
y = (c - ax)/b
*/
int main()
{
    while(true){
        double a, b, c, d, e, f;
        std::cin >> a >> b >> c >> d >> e >> f;
        if(std::cin.eof()) break;
        if(b){
            double x = (c*e - b*f) / (a*e - b*d);
            double y = (c - a*x) / b;
        }else{
            double y = (f-d*c/a)/(e-d*b/a);
            double x = (c-b*y)/a;
        }
        std::cout << std::fixed << std::setprecision(3);
        std::cout << x << " " << y << std::endl;
    }
    return 0;
}

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

int main(){

	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f)
	{
		cout<<setprecision(3) << setiosflags(ios::fixed)<< (1.0*(c*e - b*f) / (e*a - b*d))<<" "
		<<(1.0*(d*c - a*f) / (b*d - a*e))<<endl;
	}
	

	
    return 0;
}

C++: #include<cstdio>

int main(int argc, char const *argv[])
{
    double a, b, c, d, e, f;
    while(scanf("%lf %lf %lf %lf %lf %lf", &a,&b,&c,&d,&e,&f) != EOF){
        double x = (e*c-b*f)/(a*e-b*d);
        double y = (-d*c+a*f)/(a*e-b*d);

        printf("%.3lf %.3lf\n", x, y);
    }
    return 0;
}

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

int main(){
  double a,b,c,d,e,f,x,y;
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){
    x = (c*e - b*f)/(a*e - b*d);
    y = (a*f - c*d)/(a*e - b*d);
    cout<<x<<" "<<y<<endl;
  }
return 0;
}

C++: #include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int main(void){
	double arr[6];
	vector<double> x,y;

	while (cin >> arr[0] >> arr[1] >> arr[2] >> arr[3] >> arr[4] >> arr[5]){
		double a = arr[0]; double b = arr[1]; double c = arr[2]; double d = arr[3]; double e = arr[4]; double f = arr[5];
		x.push_back((c*e-b*f)/(a*e-b*d));
		y.push_back((c*d-a*f)/(b*d-a*e));
	}
	for (unsigned int i=0; i<x.size(); ++i){
		printf("%.3lf %.3lf\n", x[i], y[i]);
	}
	return 0;
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

using namespace std;
int main(){

    double a,b,c,d,e,f;
    
    while(true){
        cin>>a;
        if(a==EOF)break;
        cin>>b>>c>>d>>e>>f;
        double h=a*e-b*d;
        double xx=(c*e-f*b);
        double yy=(a*f-c*d);
        
        double x=xx/h;
        double y=yy/h;
        printf("%.3f %.3f \n",x,y);
       
    }
return 0;
}

C++: 
/*

#include <iostream>
using namespace std;


int main(void)
{

int a, b, c, d, e, f;
cin >> a >> b >> c >> d >> e >> f;
double x, y;

x = (double)(c*e - b*f) / (a*e - b*d);
y = (double)(a*f - d*c) / (a*e - b*d);
cout << x <<" "<< y << endl;

system("pause");
return(0);
}
*/

#include<iostream>
using namespace std;
int main(void){
	double a, b, c, d, e, f;
	double x, y;
	while (cin >> a >> b >> c >> d >> e >> f){
		x = (double)((e*c - b*f) / (a*e - b*d));
		y = (double)((-(d*c) + a*f) / (a*e - b*d));
		if (x == 0){ x = 0; }
		if (y == 0){ y = 0; }
		printf("%.3f %.3f\n", x, y);
	}
}

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

int main(){
  double a,b,c,d,e,f,x,y;

  while(std::cin >>a>>b>>c>>d>>e>>f){

    x = (double)(c*e-b*f)/(a*e-b*d);
    y = (double)(a*f-c*d)/(a*e-b*d);

    printf("%.3f %.3f\n",x,y);

  }
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
class GCDandLCM{
    public:
        void solve(int a,int b){
            int big=a,small=b;
            if(a<b){ 
                big=b;
                small=a;
                int tmp=a;
                a=b;
                b=tmp;
            }
            while(big%small!=0){ 
                int tmp=big%small;
                big=small;
                small=tmp;
            }
            printf("%d %d\n",small,(a*b)/small);
        }
};
int main(){ 
    GCDandLCM inst;
    int a,b;
    while(cin>>a>>b){ 
        inst.solve(a,b);
    }
}