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 := cF / bE
		x := (c - (y * b)) / a

		fmt.Printf("%d.000 ", x)
		fmt.Printf("%d.000\n", y)
	}
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int main(){
	double a,b,c,d,e,f;
	while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){
		
		if(d==0){
			swap(a,d);
			swap(b,e);
			swap(c,f);
		}
		
		double y;
		if(a==0){
			y = b/c;
		}else{
			double A = b/a-e/d;
			double B = c/a-f/d;
			
			y = B/A;
		}
		double x = c/a-b/a*y;
		
		
		printf("%.9lf %.9lf\n",x,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 x = (c - b * f / e)/(a - b * d / e);
		double y = (c - a * x) / b;
		if(x == 0) x = 0;
		if(y == 0) y = 0;
		printf("%.3lf ", x);
		printf("%.3lf\n", y);
	}
	return 0;
}

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

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

C++: #include <iostream>
#include <string>
#include<iomanip>
using namespace std;
int main(){
	double x,y;
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		x=(c-(b*f/e))/(a-(b*d/e));
		y=(c-a*x)/b;
        x*=1000;
        if(x>=0)
        x+=0.5;
		else
		x-=0.5;
        x=int(x);
        x/=1000;
	    y*=1000;
		if(y>=0)
        y+=0.5;
		else
		y-=0.5;
        y=int(y);
        y/=1000;
		cout<<fixed<<setprecision(3)<<x<<" ";
		cout<<fixed<<setprecision(3)<<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 <iostream>

using namespace std;

/*
aX+bY=c
dX+eY=f
*/

void solve(int a, int b, int c, int d, int e, int f) {
	int x = (f - ec/b) / (d - ec/b);
	int y = (c - ax) / b;
	cout << x << " " << y << endl;
}

int main() {
	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 <iomanip>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f ){
	int det=a*e-b*d;
	int X,Y; X=c*e-b*f ; Y=a*f-c*d; 
	double x,y;
	if(X==0) x=0;if(Y==0) y=0;
	if(X!=0 && Y!=0) x=(double)X/det;y=(double)Y/det;
	cout << fixed << setprecision(3) ;
	cout << x << ' ' << y << '\n' ;
	};
}

C++: #include <iostream>
#include <iomanip>
#include <math.h>

using namespace std;

int main(void) {
	while(1) {
		int a, b, c, d, e, f;
		double x, y;
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;

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

		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
	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= (double)(1.0/(a*e-b*d))*(e*c-b*f);
		y= (double)(1.0/(a*e-b*d))*(-d*c+a*f);
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{ int i=0;
  double B[6],x,y;
 while(scanf("%lf%lf%lf%lf%lf%lf",&B[0],&B[1],&B[2],&B[3],&B[4],&B[5])!=EOF)
 {
  x=(B[1]*B[5]-B[2]*B[4])/(B[1]*B[3]-B[0]*B[4]);
  y=(B[2]-B[0]*x)/B[1];
  i=0;
  printf("%.3lf %.3lf\n",x,y);
  }
return 0;
}

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

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

	while(cin >> a >> b >> c >> d >> e >> f){
		x = (double)(b*f-e*c)/(b*d-a*e);
		y = (double)(a*f-d*c)/(a*e-b*d);
		printf("%.3f %.3f\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,x,y;
	while(cin.eof()==false){
//		break;
	a=10000;
	cin >> a >> b >> c >> d >> e >> f;
	if (a==10000){
		break;
	}

	double under = a*e-b*d;
	if((c*e-b*f)/under<0.0005 && (c*e-b*f)/under>-0.0005){
		x=0;
	}
	else{
		x=(c*e-b*f)/under;
	}
	if((a*f-c*d)/under<0.0005 && (a*f-c*d)/under>-0.0005){
		y=0;
	}
	else{
		y=(a*f-c*d)/under;
	}

//	cout << (c*e-b*f)/under << " " << (a*f-c*d)/under << endl;
	printf("%.3f %.3f\n",x,y);
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  double a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    /*
      x = (b * f - e * c) / (b * d - a * e);
      y = (a * f - d * c) / (b * d - a * e);
    */
    x = (c * e - b * f) / (a * e - b * d);
    y = (a * f - c * d) / (a * e - b * d);
    if (!x) x = 0;
    if (!y) y = 0;
    cout << x << ' ' << y << '\n';
  }
  return 0;
}

C++: #include <iostream>
#include <stdio.h>

using namespace std;

int main(int argc, char **argv)
{
	double a, b, c, d, e, f, tmp;
	
	while((cin >> a >> b >> c >> d >> e >> f)){
		tmp = (a*e-b*d);
		printf("%f %f\n", ((e*c-b*f)/tmp), ((a*f-d*c)/tmp));
	}
	
	return 0;
}

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

using namespace std;

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

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

C++: #include <stdio.h>
#include <iostream>

using namespace std;

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

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

C++: #include<iostream>
#include<stdio.h>
#include<iomanip>
using namespace std;
int main(){
	float a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
	y=(c*d-a*f)/(b*d-e*a);
	x=(c-y*b)/a;
	cout<<fixed;
	cout<<setprecision(3)<<x<<" "<<y<<endl;
	}
	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 = double(c*e-f*b)/double(a*e-d*b);
		double y = double(c*a-f*d)/double(b*d-a*e);
		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
}