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 <iostream>
#include <cstdio>

using namespace std;

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


    while (cin >> a >> b >> c >> d >> e >> f) {
        double div = 1 / (a*e - b*d);
        //cout << (e*c - b*f) * div << " " << (-d*c + a*f) * div << endl;
        printf("%.3f %.3f\n", (e*c - b*f) * div, (a*f - d*c) * div);
    }

    return 0;
}

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

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

	return a;

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

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ????????§ ax+by=c, dx+ey=f ????§£?????????????????¨???????????¨???????¨????????????????(1)
    vector<vector<double>> answers;
    double a, b, c, d, e, f;
    int dump;
    while(cin >> a >> b >> c >> d >> e >> f) {
        double det = (double)(a*e-b*d);
        double ansx = (e*c+(-b)*f)/det;
        double ansy = ((-d)*c+a*f)/det;
        answers.push_back({ansx,ansy});
    }
    for(auto elm : answers) {
        cout << fixed << setprecision(3) << elm[0] << " " << elm[1] << endl;
    }

    return 0;
}

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

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

int main()
{
	double A, B, C, D, E, F, X, Y, G , H;

	while(cin >> A >> B >> C >> D >> E >> F)
	{
		G = A / D;
		D *= G;
		E *= G;
		F *= G;
		Y = (F-C) / (E-B);
		
		D /= G;
		E /= G;
		F /= G;
		H = B / E;
		D *= H;
		E *= H;
		F *= H;
		X = (F-C) / (D-A);

		if(Y==0){
			Y=0.000;
		}

		if(X==0){
			X=0.000;
		}

		printf("%.3f %.3f\n",X,Y);
	}

	return 0;
}

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

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

double det(double a, double b, double c, double d){
	return a*d - b*c ;
}

int main() {
	// your code goes here
	
	double a,b,c,d,e,f;
	double x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		x=det(c,b,f,e)/det(a,b,d,e);
		y=det(a,c,d,f)/det(a,b,d,e);
		if(x==0){x=0;}  if(y==0){y=0;}
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

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);
		printf("%.3f %.3f\n", x, y);
	}
}

C++: #include <cstdio>

using namespace std;

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

    return 0;
}

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

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

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

C++: #pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>

using namespace std;
using Int = long long;
typedef pair<int,int> Pi; typedef pair<Int,Int> Pl;
constexpr int mod = 1e9+7;
constexpr int INF32 = numeric_limits<int>::max();
constexpr Int INF64 = numeric_limits<Int>::max();
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rer(i,l,r) for(int(i)=(l); (i)<(r); ++(i))
#define rep(i,n) rer(i,0,n)
#define gnr(i,l,r) for(int (i)=(r)-1; (i)>=(l); --(i))
#define pri(a) cout<<(a)<<'\n'
#define pri2(a,n) {rep(i,n-1)cout<<a[i]<<' '; if(n)cout<<a[n-1]<<'\n';}
#define prip(p) cout<<(p).fi<<' '<<(p).se<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n,m,_,x,y,q;
string s,sb;
bool ok;
char cf,cb;

int main(){
  cin.tie(nullptr); ios::sync_with_stdio(0);
  //cout<<fixed<<setprecision(20);
  
  double a,b,c,d,e,f;
  while(cin>>a>>b>>c>>d>>e>>f){
    double ay=(a*f-c*d)/(a*e-b*d),ax=(c-b*ay)/a;
    printf("%.3f %.3f\n",ax,ay);
  }
}

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;
				}
			}
		}
	}
}