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>

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 = ((double)e*(double)c-(double)b*(double)f)/((double)e*(double)a-(double)b*d);
		y = ((double)d*(double)c-(double)a*(double)f)/((double)b*(double)d-(double)a*e);
		if((int)(x*10000)/10000 >= 5) x+= 0.001;
		if((int)(y*10000)/10000 >= 5) y+= 0.001;
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include<stdio.h>

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

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

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

int main(){
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double t = 1 / (a*e - b*d);
		double x = (e*c - b*f);
		x *= (x == 0.0) ? 0.0 : t;
		double y = (a*f - c*d) ;
		y *= (y == 0.0) ? 0.0 : t;
		printf("%.3f %.3f\n", round(x*1000)/1000.0, round(y*1000)/1000.0);
	}
	return 0;
}

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


double a,b,c,d,e,f;
double A,B;//x,y座標
int main(){
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) !=EOF){
    B =(c*e-f*b)/(a*e-b*d);
    A = (c -b*B)/a;
    
    if(A ==0)
      A =0;
    if(B ==0)
      B =0;
    if(A > 0){
    A =floor((A+0.0005)*1000)/1000;
    }else if(A < 0){
    A =floor((A-0.0005)*1000)/1000;

    }
    if(B > 0){//小数第4位を四捨五入
    B =floor((B+0.0005)*1000)/1000;
    }else if(B <0){
    B =floor((B-0.0005)*1000)/1000;
    }
    printf("%.3f %.3f\n",B,A);
  }
  return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
#include <limits>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define ld long double
ld a, b, c, d, e, f, x, y;
ld shish(ld a)
{
	if (a == 0) { return a; }
	
	a *= 1000;
	if (a > 0) {
		a += 0.51;
	}
	else {
		a -= 0.51;
	}
	a = (ld)((int)a);
	a /= 1000;
	return a;
}
int main() {
	while (cin >> a >> b >> c >> d >> e >> f) {
		y = (a*f - c*d) / (ld)(a*e - b*d);
		x = (c*e - f*b) / (ld)(a*e - b*d);

		x = shish(x);
		y = shish(y);
		cout << fixed << setprecision(10) << x ;
		cout << " ";
		cout << fixed << setprecision(10) << y<< endl;
	}
	return 0;
}

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

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

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

    return 0;
    
    }

C++: #include <cstdio>

int main (int argc, char *argv[]) {
	using namespace std;
	int a, b, c, d, e, f;
	while (EOF != fscanf(stdin, "%d %d %d %d %d %d\n", &a, &b, &c, &d, &e, &f)) {
		float tmp1 = static_cast<float>(f)-(static_cast<float>(c)*static_cast<float>(d)/static_cast<float>(a));
		float tmp2 = static_cast<float>(e)-(static_cast<float>(b)*static_cast<float>(d)/static_cast<float>(a));
		float y = tmp1/tmp2;
		float x = (static_cast<float>(c) - static_cast<float>(b) * y) / static_cast<float>(a);
		printf("%.3f %.3f\n", x, y);		
		//printf("y=%f\n", (f-(c*d/a))/(e-(b*d/a)));
	}
	
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


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

C++: #include <iostream>
#include <stdio.h>
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 = (f - d*x) / e;
		printf("%1.3f %1.3f\n", x, y);
	}

	return 0;
}

C++: #include<iostream>
int main(){for(float a,b,c,d,e,f,y,s=1;s;printf("%.3f %.3f\n",d?f/d-e*y/d:c/a-b*y/a,y))s=!(std::cin>>a>>b>>c>>d>>e>>f).eof(),y=c*d-a*f,y/=b*d-a*e;}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

double g(double x) {
  return double((int) (x * 1000)) / 1000;
}

void solve() {
  int a, b, c, d, e, f;
  while (cin >> a >> b >> c >> d >> e >> f) {
    int nx = c * e - b * f, ny = a * f - c * d;
    int de = a * e - b * d;
    cout << prec(3) << g(1.0 * nx / de) << ' ' << g(1.0 * ny / de) << endl;
  }
}

C++: #include <iostream>

using namespace std;

void solve()
{
	double a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f)
	{
		printf("%.3f %.3f\n", (c * e - b * f) / (a * e - b * d), (c * d - a * f) / (b * d - a * e));
	}
}

int main()
{
	solve();
	return(0);
}

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

  }
  return 0;
}

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

using namespace std;

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