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
		if bE==0{
		    bE=1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		
			fmt.Printf("%d.000 ", x)
			fmt.Printf("%d.000\n", y)
	}
}

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

using namespace std;

int main(){
	int a, b, c, a2, b2, c2;
	int i, j;

	while(cin >> a >> b >> c >> a2 >> b2 >>c2){
		for(i = -1000; i <= 1000; i++){
			for(j = -1000; i <= 1000; i++){
				if(a*i + b*j == c && a2*i + b2*j == c2){
					cout << fixed << setprecision(3)  << i << " " << j << endl;
				}
			}
		}
	}
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#define N 2

using namespace std;
typedef vector< vector<double> > const_vector;

bool input(const_vector& c)
{
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < N + 1; ++j)
			cin >> c[i][j];

	return true;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	const_vector c(N, vector<double>(N + 1));
	while (input(c))
	{
		// ??¬??????????¶???????
		// ???????¶????
		for (int i = 0; i < N - 1; ++i)
			for (int j = i + 1; j < N; ++j)
			{
				double d = c[j][i] / c[i][i];
				for (int k = i + 1; k <= N; ++k)
					c[j][k] -= c[i][k] * d;
			}

		// ????????£??\
		for (int i = N - 1; i >= 0; --i)
		{
			double d = c[i][N];
			for (int j = i + 1; j < N; ++j)
				d -= c[i][j] * c[j][N];
			c[i][N] = d / c[i][i];
		}

		// ????????????
		cout << setprecision(4) << fixed << c[0][N];
		for (int i = 1; i < N; ++i)
			cout << " " << c[i][N];
		cout << endl;
	}

	return 0;
}

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

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

int main() {
	// your code goes here

  int a,b,c,d,e,f;

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

    double x = (c*e-b*f)/(double)(a*e-b*d);
    double y = (c*d-a*f)/(double)(b*d-a*e);
    if(x == -0.0 || y == -0.0){
      x = 0.0;
      y = 0.0;
    }

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

  }
	return 0;
}

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

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

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

    y = (c*d - f*a)/(b*d-e*a);
    x = (c - b*y)/a;
    
    
    x*=10000;
    y*=10000;
    
    x+=0.5;
    y+=0.5;
    
    x/=10000;
    y/=10000;
    
    //cout << x << y << endl;
    printf("%.3f %.3f\n", x, y);
  }

  return 0;
}

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

int main(){
	int a,b,c,d,e,f;
	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);
		printf("%.3f %.3f\n", x, y);
	}
}

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

int main(){
	float a,b,c,d,e,f,i,n;
	while(cin >> a >> b >> c >> d >> e >> f){
		printf("%6.3f %6.3f\n",(c*e-b*f)/(a*e-b*d) ,(c*d-a*f)/(b*d-a*e));
	}
	return 0;
}

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5)a+10;
	a=double (int (a));
	a=a/10000;

}
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){
		if(a*e==b*d){
		}else{
			x=(c*e-b*f)/(a*e-b*d);
			y=(c*d-a*f)/(b*d-a*e);
		}
		x=round3(x);
		y=round3(y);
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}

C++: #include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
using vec = vector<double>;
using mat = vector<vec>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define elnd endl //* missspell check
const ll INF = 1LL << 60;
const double EPS = 1E-8;
//* Solve Ax = b. A is a square matrix in O(n^3)
//* Return 0-length vector if unsolvable/not-unique
//* partial pivoting
vec GaussJordan(const mat &A, const vec &b){
    ll n = A.size();
    mat B(n, vec(n+1)); //* last columb for solution
    //* initialize B
    REP(i, n) REP(j, n) B[i][j] = A[i][j];
    REP(i, n) B[i][n] = b[i];

    REP(i, n){
        ll pivot = i;
        for(ll j = i; j < n; j++){
            if(abs(B[j][i]) > abs(B[pivot][i])) pivot = j;
        }
        swap(B[i], B[pivot]); //* swap i-th row and pivot-th row
        if(abs(B[i][i]) < EPS) return vec();

        for(ll j = i+1; j <=n; j++) B[i][j] /= B[i][i];
        //* eliminition
        for(ll j = 0; j < n; j++){
            if(i != j){
                for(ll k = i+1; k <= n; k++) B[j][k] -= B[j][i] * B[i][k];
            }
        }
    }
    //* prepare solution
    vec x(n);
    for(ll i=0; i < n; i++) x[i] = B[i][n];
    return x;
}

//! http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004&lang=ja
int main(){
    mat A(2, vec(2));
    vec b(2);
    while(scanf("%lf %lf %lf %lf %lf %lf",&A[0][0],&A[0][1],&b[0],&A[1][0],&A[1][1],&b[1])!=EOF){
        vec x = GaussJordan(A, b);
        printf("%.3lf %.3lf\n",x[0],x[1]);
    }
    return 0;
}

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

struct vector2{
	float x, y;
	vector2() : x(0), y(0){}
	vector2(float x, float y) : x(x), y(y){}
};

struct sim_elem{
	float a, b, c, d, e, f;
	sim_elem() :a(0), b(0), c(0), d(0), e(0), f(0){}
	sim_elem(float a, float b, float c, float d, float e, float f) :a(0), b(0), c(0), d(0), e(0), f(0){}
};

//	a / d * d
//	ey - by = f - c
//	y / y = (f - c) / y

// ax = -by + c
// ax / a = -(by + c) / a

vector2 sim_equ(sim_elem elem){

	float dx = elem.a / elem.d * elem.d;
	float ey = elem.a / elem.d * elem.e;
	float f = elem.a / elem.d * elem.f;

	float y = ey - elem.b;
	float yr = f - elem.c;
	y = yr / y;

	float ax = -elem.b * y + elem.c;
	float x = ax / elem.a;

	return vector2(x, y);
}

//	sprintf
float placement4(float val){
	char ret[128];
	sprintf_s(ret, sizeof(ret), "%.3f", val);
	return (float)atof(ret);
}

int main(){

	sim_elem elem;
	while (1){
		cin >> elem.a >> elem.b >> elem.c >> elem.d >> elem.e >> elem.f;
		if (cin.eof())break;
		vector2 ret;
		ret = sim_equ(elem);
		printf("%.3f %.3f\n", placement4(ret.x) ,placement4(ret.y) );
	}

	return 0;
}