Go: package main

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

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		y := float64(cF) / float64(bE)
		x := (float64(c) - (y * float64(b))) / float64(a)

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

double a, b, c, d, e, f;
double x, y;

int main() {
	a = -10000;
	cin >> a >> b >> c >> d >> e >> f;

	while (a != -10000) {
		x = (c * e - f * b) / (a * e - d * b);
		y = (c * d - f * a) / (b * d - e * a);

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

		a = -10000;
		cin >> a >> b >> c >> d >> e >> f;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

C++: #include <iostream>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    printf("%.3f %.3f\n",  (1.0 * b * f - c * e) / (b * d - a * e), (1.0 * a * f - c * d) / (a * e - b * d));
  }
  return 0;
}

C++: #include<iostream>
#include<iomanip>
using namespace std;
int main(){
    double a,b,c,d,e,f;
    double x,y;
    while(cin >> a >> b >> c >> d >> e >> f){
        x = (double)((c*e - b*f)/(a*e - b*d) * 1000) / 1000.0;
        y = (double)((d*c - a*f)/(b*d - a*e) * 1000) / 1000.0;
        x = (x == -0.0) ? 0.000 : x;
        y = (y == -0.0) ? 0.000 : y;
        cout << fixed << setprecision(3);
        cout << x << " " << y << endl;
    }
    return 0;
}

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

void pri(double a, double b, double c, double d, double e, double f){
	printf("(%4f)x + (%4f)y = (%4f)\n(%4f)x + (%4f)y = (%4f)\n\n", a, b, c, d, e, f);
}

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

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

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int i,j=0,k = 0,l=0,m = 0,n= 0;
    double a,b,c,d,e,f;
    double x1,x2;
    
    cin >> a >> b >> c;
    cin >> d >> e >> f;
    
    double gyouretusiki = (a*e - d*b);
    
    x1 = (c/a) - (b/gyouretusiki)*(f -((d*c)/a));
    
    x2 = ((a) /(gyouretusiki))*(f-((d*c)/a));
    
    
    printf("%.3f %.3f\n",x1,x2);
    return 0;
            
                  
                  
    
}

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

double r(double d){
  double a = roundl(d*1000);
  if(a==0) return +0.0;
  return a/1000;
}

int main(){
  double a,b,c,d,e,f;
  while(~scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f))
    printf("%.3f %.3f",r((c*e-b*f)/(a*e-b*d)),r((-c*d+a*f)/(a*e-b*d)));
}

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

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

int main() {
    int a,b;
    while (cin>>a>>b) {
        if (a < b) {
            int tmp = a;
            a = b;
            b = tmp;
        }

        int gcd = get_gcd(a,b);

        int lcm = (a * b) / gcd;
        cout << gcd << " " << lcm << endl;

    }
    return 0;
}

C++: #include <stdio.h>
#define EPS 1e-10
int main() {
    int a,b,c,d,e,f,x;double q,r;while (scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF) {
        x=-a;a*=d,b*=d,c*=d;d*=x,e*=x,f*=x;q=(f+c)/(b+e+0.0);r=(f-(e*q))/(d+0.0);if (r<EPS && r>-EPS) r=0.0;if (q<EPS && q>-EPS) q=0.0;printf("%.3lf %.3lf\n",r,q);} return 0;}

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

int main(void) {
  string input;
  while (getline(cin, input)) {
    float a, b, c, d, e, f;
    sscanf(input.c_str(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f);
    float x = (c*e-b*f)/(a*e-b*d);
    float y = (c*d-a*f)/(b*d-a*e);
    printf("%.3f %.3f\n", x, y);
  }
}

C++: #include<iostream>
#include<cstdio>
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 = (a*f - c+d)/(a*e - d*b);
    y = (c -b*y)/a;
    if(x == -0)x = 0;
    if(y == -0)y = 0;
    printf("%.3f %.3f",x,y);
  }
}

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

int main() {
	int a, b, c, d, e, f;
	vector<double> x, y;
	while (cin >> a) {
		double tmpY;
		cin >> b >> c >> d >> e >> f;
		if (a*e != b*d) {
			y.push_back((c*d - a*f) / (b*d - a*e));
			tmpY = (c*d - a*f) / (b*d - a*e);
		} else {
			continue;
		}
		if (a != 0) {
			x.push_back((c - b*tmpY) / a);
		} else if (d != 0) {
			x.push_back((f - e*tmpY) / d);
		} else {
			continue;
		}
	}

	for (int i = 0; i < x.size(); i++) {
		cout << fixed << setprecision(3) << x[i] << " " << y[i] << endl;
	}
}

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

int main() {
	double a, b, c, d, e, f, xx, yy;
	while (cin >> a >> b >> c >> d >> e >> f) {
	double x = (c*e - b * f) / (a*e - b * d);
	double y = (c*d - a * f) / (b*d - a * e);
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}

	return 0;
}

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

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

C++: #include <stdio.h>

int main(){
	int a,b,c,d,e,f;
	double x,y;
	while(scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF){
		x = (e*c-b*f)/(e*a-b*d);
		y = (d*c-a*f)/(b*d-a*e);

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

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

using namespace std;

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

  while((scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f)) != -1) {
    double x, y;
    double denom = a * e - b *d;
    double nomer_x = c*e - b*f;
    double nomer_y = -c*d + a*f;
    x = nomer_x / denom;
    y = nomer_y / denom;

    if(x == 0) { x = 0;  }
    if(y == 0) { y = 0;  }

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

  return 0;
}

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

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