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 <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

double set(double x){
    x*=10000.0;
    if((int)x%10>=5){
        x+=10.0;
    }
    x/=10000.0;
    
    return x;
}

int main(){
    double a,b,c,d,e,f;
    while(cin>>a>>b>>c>>d>>e>>f){
        printf("%.3f",(c*e-f*b)/(a*e-b*d));
        cout<<" ";
        printf("%.3f",(a*f-c*d)/(a*e-b*d));
        cout<<endl;
    }
    
    
    
    return 0;
}

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

    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(void){
	
	double x, y;
	int a, b, p;
	int c, d, q;

	while (cin >> a >> b >> p >> c >> d >> q){

		x = (double)((p * d - b * q) / (a * d - b * c));
		y = (double)((a * q - p * c) / (a * d - b * c));
		if (x == 0)x = 0;
		if (y == 0)y = 0;
		printf("%.3f %.3f\n", x, y);
	}
}

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

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

return 0;
}

C++: #pragma GCC optimize "O3"
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define REP_FROM(i,m,n) for (int i = (m); (i) < int(n); ++(i))
#define REP_REV(i,n) for (int i = (n)-1; (i) >= 0; --(i))
#define REP_FROMREV(i,m,n) for (int i = (n)-1; (i) >= int(m); --(i))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#ifndef LOCAL
#define cerr if (false) cerr
#endif
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

template <class T> inline void setmax(T & a, T const & b) { a = max(a, b); }
template <class T> inline void setmin(T & a, T const & b) { a = min(a, b); }
template <class T> T sq(T x) { return x * x; }
template <class T> T clamp(T a, T l, T r) { return min(max(a, l), r); } // [l, r]
const double EPS = 1e-10;
const double PI  = acos(-1.0);

void solve(int a, int b, int c, int d, int e, int f) {
	double x, y;
	y = (d*c-a*f)/(d*b-a*e+EPS);
	printf("%.3f\n", y);
	x = (c-b*y)/a;
	printf("%.3f\n", x);
	printf("%.3f %.3f\n", x, y);
}

int main(int argc, char *argv[]) {
	// Something to do
	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<iostream>
#include<cstdio>
using namespace std;

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

}

C++: #include <iostream>
#include <cstdio>
#define eps 1e-10
using namespace std;


int main(void) {
    double a, b, c, d, e, f;
    
    while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) {
        double ya = d * c - a * f;
        double yb = b * d - a * e;
        if(yb == 0) yb += eps;
        double y = ((ya) / (yb));
        if(a == 0) a += eps;
        double x = ((c - b * y) / a);
        printf("%.3f %.3f",x, y);
    }
    
    return(0);
}

C++: #include<stdio.h>
#include<math.h>
int main(void){
    double a,b,c,d,e,f,A,x,y,X,Y,Z;
 
    while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
 
 
    Y=a*e-b*d,Z=f*a-c*d;
    y=Z/Y;
 
    x=(c-b*y)/a;
 
   printf("%.3lf %.3lf\n",x,y);
    }
 
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	
	double a[6];

	for(int i=0; i<6; i++){
		cin >> a[i];
	}

	double x,y;

	y=(a[2]/a[0]-a[5]/a[3])/(a[1]/a[0]-a[4]/a[3]);

	x = a[2]/a[0] - a[1]/a[0] * y;

	
	double diff = 0.5;

	x<0?(diff=-0.5):(diff=0.5);
	x = (int)(x*1000+diff);
	
	y<0?(diff=-0.5):(diff=0.5); 
	y = (int)(y*1000+diff); 
	

	x /= 1000;y/=1000;
	

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

C++: #include <stdio.h>

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

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