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 <stdio.h>
#include <math.h>

double RoundOff(double src, int keta);

int main(void)
{
	int a,b,c,d,e,f,i;
	double ans[2];
	
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		ans[1] = (double)((a*f-d*c)/(-1*d*b+a*e));
		ans[0] = (double)((c-b*ans[1])/a);
		
		for(i=0;i<2;i++)
		{
			printf("%.3f ",RoundOff(ans[i],4.0));
		}
		printf("\n");
	}
	
	return 0;
}

double RoundOff(double src, int keta)
{
	// 10^keta 
	src *= pow(10.0, (double)(keta-1));
	if(src>0){
		// (int)(num+0.5) cast
		src = (int)(src+0.5);
	}
	else{
		// (int)(num-0.5)
		src = (int)(src-0.5);
	}
	// 10^-keta
	src /= pow(10.0, (double)(keta-1));
	
	return src;
}

C++: #include<stdio.h>
int main()
{
    float a,b,c,d,e,f,x,y;
    while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF)
    {
       y=((c*d)-(f*a))/((d*b)-(a*e));
       x=(c-(b*y))/a;
       printf("%.3f %.3f",x,y);
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
main(){
	double x[2][3],n,ans[2],tmp;
	while(cin>>x[0][0]>>x[0][1]>>x[0][2]>>x[1][0]>>x[1][1]>>x[1][2]){
		/*for(int i=0;i<=1;++i){
			for(int j=0;j<=2;++j){
				cin>>x[i][j];
				ans[i]=0;
			}
		}*/
		n=x[0][0]*x[1][1]-x[0][1]*x[1][0];
		for(int i=0;i<=1;++i){
			for(int j=0;j<=1;++j){
				x[i][j]/=n;
			}
		}
		double tmp;
		tmp=x[1][1];
		x[1][1]=x[0][0];
		x[0][0]=tmp;
		x[0][1]*=-1;
		x[1][0]*=-1;

		for(int i=0;i<=1;++i){
			for(int j=0;j<=1;++j){
				ans[i]+=x[i][j]*x[j][2];
			}
		}
		cout<<fixed<<setprecision(3)<<ans[0]<<" "<<ans[1]<<endl;
	}
}

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


int main(){
	vector<double> ans_x;
	vector<double> ans_y;
	double a, b, c, d, e, f;
	double tb, tc, te, tf;
	double x, y;
	int i, cnt=0;
	while(cin>>a>>b>>c>>d>>e>>f){
		tb=b*d;
		tc=c*d;
		te=e*a;
		tf=f*a;
		tb-=te;
		tc-=tf;
		y=tc/tb;
		x=(c-b*y)/a;
		ans_x.push_back(x);
		ans_y.push_back(y);
		cnt++;
	}
	for(i=0;i<cnt;i++){
	//	cout.precision(4);
	//	cout.setf(ios::showpoint);
		printf("%.3f %.3f\n",ans_x[i], ans_y[i]);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	long double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		long double x=(c*e-f*b)/(a*e-d*b);
		long double y=(c*d-f*a)/(b*d-e*a);
		cout<<fixed<<setprecision(3)<<(x==-0?0:x)<<" "s;
		cout<<fixed<<setprecision(3)<<(y==-0?0:y)<<"\n"s;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

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

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

int main() {
    string line;
    while (getline(cin, line)) {
        double a, b, c, d, e, f;
        stringstream ss(line);
        ss >> a >> b >> c >> d >> e >> f;


        double x = 0.0;
        if (c*e - b*f != 0)
            x = static_cast<double>(c*e - b*f) / (a*e - b*d);
        double y = 0.0;
        if (a*f - c*d != 0)
            y = static_cast<double>(a*f - c*d) / (a*e - b*d);
        cout.setf(ios_base::fixed, ios_base::floatfield);
        cout << std::setprecision(3) << x << " " << y << endl;
    }
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int a,b,c,d,e,f;
	float x,y;
	while(cin>>a>>b>>c>>d>>e>>f)
	{
		y=((d*c)-(a*f))/((b*d)-(a*e));
		x=(c-(b*y))/a;
		printf("%.3f",x);
		cout<<" ";
		printf("%.3f",y);
		cout<<endl;
	}
	return 0;
}

C++: 
#include <cmath>
#include <string>
#include <sstream>
#include <iostream>
#include <algorithm>

int main(void) 
{
    std::string str;
    double a, b, c, d, e, f;
    double x, y;

    while (getline(std::cin, str)) {
        std::istringstream str_s(str);

        str_s >> a >> b >> c >> d >> e >> f;

        if (c*e - b*f == 0) 
            x = 0;
        else
            x = (c*e - b*f) / (a*e - b*d);

        if (c*d - a*f == 0)
            y = 0;
        else
            y = (c*d - a*f) / (b*d - a*e);

        x = (double)round(x*100)/100;
        y = (double)round(y*100)/100;

        std::cout.setf(std::ios::fixed);  
        std::cout.precision(3);

        std::cout << std::showpoint << x << ' ' << y << '\n';
    }

    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 = (c*e - b*f) / (a*e - b*d);
	y = (c*d - a*f) / (b*d - a*e);

	cout << fixed << setprecision(3) << x << " " << y << endl;
}
}

C++: #include <iostream>
#include <iomanip>
int main(void){
	int a,b,c,d,e,f;
	while(std::cin>>a>>b>>c>>d>>e>>f){
		double y=(a*f-c*d)/(a*e-b*d),x=(c-b*y)/a;
		std::cout<<std::fixed<<std::setprecision(3)<<x<<" "<<y<<"\n";
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
 
#define MOD 1000000007
#define INF  2000000000
//#define int ll
#define ll long long
#define ld long double
#define vi vector<int>
#define p pair<int, int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
 
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T& t) { cin >> t; }
template<typename First, typename...Rest>void MACRO_VAR_Scan(First& first, Rest&...rest) { cin >> first; MACRO_VAR_Scan(rest...); }
#define VEC(type, c, n) vector<type> c(n);for(auto& i:c)cin>>i;
#define MAT(type, c, m, n) vector<vector<type>> c(m, vector<type>(n));for(auto& r:c)for(auto& i:r)cin>>i;
 
#define BR cout << "\n";
#define SP cout << " ";
#define ENDL cout<<endl;
#define OUT(d) cout<<d;
#define OUTL(d) cout<<d; BR;
#define YES OUTL("YES")
#define Yes OUTL("Yes")
#define NO OUTL("NO")
#define No OUTL("No")
#define RET return 0;
#define SUM(a, n) accumulate(a, a+n, 0)
#define VSUM(v) accumulate(ALL(v), 0);
 
#define REP(i, n) for(int i=0;i<(n);i++)
#define RREP(i, n) for(int i=n-1;i>=0;--i)
#define FOR(i, m, n) for(int i = m;i < n; i++)
#define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i)
#define AREP(a, n) for(auto (a):(n))
#define ALL(a) (a).begin(),(a).end()
#define IN(n, a, b) ((a)<=(n)&&(n)<(b))

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