Go: package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	for {
		data := nextInts(6)
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return float64(((c * e) - (b * f)) / ((a * e) - (b * d)))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return float64(((c * d) - (a * f)) / ((b * d) - (a * e)))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

C++: #include<stdio.h>

int main(){
	double x1,y1,z1,x2,y2,z2,num1=0,x=0,y=0,z=0,sum1=0,sum2=0,vx=0,vy=0,vz=0;
	
	while(1){
	
	scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&z1,&x2,&y2,&z2);
	
	
	
	
	if((x1>0&&x2>0)||(x1<0&&x2>0)){
		num1=x2/x1*-1;
	}
	else if((x1>0&&x2<0)||(x1<0&&x2<0)){
		num1=x2/x1;
	}
	
	
	
	vx=x1*num1;
	vy=y1*num1;
	vz=z1*num1;
	
	x=vx+x2;
	y=vy+y2;
	z=vz+z2;
		
	sum2=z/y;
	sum1=(z2-y2*sum2)/x2;
	
	
	
	
	if(sum1>=0){
	sum1=(int)(sum1*1000+0.5);
	sum1=(double)(sum1/1000);
	}
		else if(sum1<0){
	sum1=(int)(sum1*1000-0.5);
	sum1=(double)(sum1/1000);
	}
	if(sum2>=0){
	sum2=(int)(sum2*1000+0.5);
	sum2=(double)(sum2/1000);
	}
		else if(sum2<0){
	sum2=(int)(sum2*1000-0.5);
	sum2=(double)(sum2/1000);
	}
	
	
	
	printf("%.3f %.3f\n",sum1,sum2);
	
	}
		
	return 0;
}

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

int main() {
	double a, b, c, d, e, f, p, q, x, y;
	while (cin >> a >> b >> c >> d >> e >> f) {
		p = (c * e - f * b) / (a * e - d * b);
		q = (c - a * p) / b;
		x = round(1000 * p) / 1000;
		y = round(1000 * q) / 1000;
		if (x == 0) x = 0;
		if (y == 0) y = 0; //-0.000??¨??¨???????????????????????¢
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

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

pair<double, double> cramer(double a1, double a2, double b1, double b2, double c1, double c2) {
  int d   = a1 * b2 - b1 * a2;
  int nx1 = c1 * b2 - b1 * c2;
  int nx2 = a1 * c2 - c1 * a2;
  return mp(nx1 / d, nx2 / d);
}

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) {
    pair<double, double> p = cramer(a, d, b, e, c, f);
    cout << prec(3) << g(p.first) << ' ' << g(p.second) << endl;
  }
}

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

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

C++: #include <stdio.h>

int main()
{
	int a,b,c,d,e,f;
	double def;
	double x,y;
	while(scanf("%d %d %d %d %d %d",&a, &b, &c, &d, &e, &f) != EOF){
		if((a * e - b * d) != 0){
			def = 1 / (double)(a * e - b * d);
		}else{
			printf("NA\n");
			continue;
		}
		x = def * (double)(e * c - b * f);
		y = def * (double)(a * f - d * c);
		printf("%lf %lf\n",x,y);
	}
	return 0;
}

C++: #include <iostream>

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

    while (std::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);
        std::cout << x << " " << y << std::endl;
    }

    return 0;
}

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

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

using namespace std;
int a,b,c,d,e,f;
int main(){
	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);
	}
  return 0;
}

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

double shisyagonyu(double x){
  if(x>0){
    x += 0.0005;
  }
  if(x<0){
    x -= 0.0005;
  }
  return x;
}

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

  while(std::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);

    /*std::cout << x;
    std::cout << " " << y << std::endl;

    x = shisyagonyu((c*e-b*f)/(a*e-b*d));
    y = shisyagonyu((a*f-c*d)/(a*e-b*d));
*/
    std::cout << std::fixed;
    std::cout << std::setprecision(3) << x;
    std::cout << " " << y << std::endl;

  }
}

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

int main() {
  double a, b, c, d, e, f, x, y, det;
  cin >> a >> b >> c >> d >> e >> f;

  det = 1.0/(a*e - b*d);
  x = (c*e - b*f)*det;
  y = (a*f - c*d)*det;

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

  return 0;
}

C++: #include <iostream>

int main(int argc, const char * argv[]) {
    double a,b,c,d,e,f;
    double x,y;
    while(std::cin >> a >> b >> c >> d >> e >> f){
        y = (a*f - c *d) / (a*e  - d*b);
        x = (c-b * y) / a;
        printf("%.3f %.3f\n",x,y);
    }
   
}

C++: #include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
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)
{
a*=1000;
a+=0.5;
a=int(a);
a/=1000;
}
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);
    printf("%.3f "  , x); printf("%.3f"  , y); 
    cout<<endl;
  }
}

C++: #include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

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