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<cstdio>

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

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
int main()
{
  int a,b,c,d,e,f;
  double A[2][2];
  double B[2];
  double inv_A[2][2];
  while(~scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)){
    int det = a*e-b*d;
    A[0][0]=a; A[0][1] = b;
    A[1][0]=d; A[1][1] = e;
    B[0] = c;
    B[1] = f; 
 
    inv_A[0][0]=A[1][1]; inv_A[0][1]=-A[0][1];
    inv_A[1][0]=-A[1][0]; inv_A[1][1]=A[0][0];
 
    double res[2];
    res[0]=0;
    res[1]=0;
 
    for(int j=0;j<2;j++){
      for(int k=0;k<2;k++){
	res[j]+=1.0/(double)det *inv_A[j][k]*B[k];
      }
    }
 
    printf("%.3f %.3f\n",res[0],res[1]);
  }
}

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


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

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

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

C++: #include <stdio.h>

int main(void){
	int a,b,c,d,e,f;
	float x,y;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
		x=(c*e-b*f)/(a*e-d*b);
		y=(d*c-a*f)/(d*b-a*e);
		printf("%0.3f %0.3f\n",x,y);
	}
}

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){
        x = (double)((e*c-b*f) / (a*e-b*d));
		y = (double)((-(d*c)+a*f) / (a*e-b*d));
		if(x==0)	x=0;
		if(y==0)	y=0;
    	cout<<setiosflags(ios::fixed)<<setprecision(3)<<x<<" "<<y<<endl;
    }
	return 0;
}

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


int main()
{
	double x1, y1, a, x2, y2, b;
	cin >> x1 >> y1 >> a >> x2 >> y2 >> b;


	double d1 = x2;
	double d2 = x1;
	double xx1 = d1 * x1;
	double xy1 = d1 * y1;
	double a1 = d1 * a;
	double xx2 = d2 * x2;
	double xy2 = d2 * y2;
	double b1 = d2 * b;
	double y = xy1 - xy2;
	double c = a1 - b1;
	y =  c / y;


	d1 = y2;
	d2 = y1;
	xx1 = d1 * x1;
	xy1 = d1 * y1;
	a1 = d1 * a;
	xx2 = d2 * x2;
	xy2 = d2 * y2;
	b1 = d2 * b;
	double x = xx1 - xx2;
	c = a1 - b1;
	x = c / x;
	if (x == 0)
	{
		x = 0;
	}
	if (y == 0)
	{
		y = 0;
	}
	printf("%.3lf %.3lf\n", x , y);
	return 0;
}

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

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

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

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

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

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

int main(){
	float a,b,c,d,e,f,x,y;
	
	scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f);
	
	x=(c*e-b*f)/(a*e-b*d);
	y=(c*d-a*f)/(b*d-a*e);
	
	printf("%.3f% .3f",x,y);
	std::cout<<std::endl;
	
	
	return 0;
	
	}

C++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>

using namespace std;

int main(){
	double a, b, c, d, e, f, x, y, x1, y1;
	while (scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=-1)
	{
		y=(f-d*c)/(a*e-b*d);
		x = (c - b*y) / a;
		y1 = round(y * 1000) / 1000;
		x1 = round(x * 1000) / 1000;
		printf("%.3f %.3f\n", x1, y1);

		
	}
	
	return 0;
}

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

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

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

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);

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

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

int main(void){
	double a,b,c,d,e,f;
	//int X[2][2]={ {c,b}, {f,e} };
	//int Y[2][2]={ {a,c}, {d,f} };
	double x,y;
	double A,X,Y;
	while(cin>>a>>b>>c>>d>>e>>f){
		A=a*e-b*d;
		X=c*e-b*f;
		Y=a*f-c*d;
		x=(1/A)*X;
		y=(1/A)*Y;
	}
	cout << fixed << setprecision(3) << x << ' ' << y << endl;

	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        double x1,y1,x2,y2,x3,y3;
        cin >> x1 >>y1 >>x2 >> y2 >> x3 >> y3;
        double a1,a2,b1,b2,c1,c2,x,y,r;
         a1=2*(x2-x1);
         b1=2*(y2-y1);
         c1=x1*x1-x2*x2+y1*y1-y2*y2;
         a2=2*(x3-x2);
         b2=2*(y3-y2);
         c2=x2*x2-x3*x3+y2*y2-y3*y3;
         x=(b1*c2-b2*c1)/(a1*b2-a2*b1);
         y=(c1*a2-c2*a1)/(a1*b2-a2*b1);
         r=hypot(x-x1,y-y1);
        printf("%.3lf %.3lf %.3lf\n",x,y,r);
    }
}

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

int main(){
    double a, b, c, d, e, f;
    double 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("%9f %9f\n", x, y);
    }
}