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

Python: #coding:utf-8

import sys

def calc(nums):
    a = nums[0]
    b = nums[1]
    c = nums[2]
    d = nums[3]
    e = nums[4]
    f = nums[5]

    val = 1 / (a * e - b * d)

    x = val * (e * c - b * f) + 0.
    y = val * (- c * d + a * f) + 0.

    return  "%0.3f" % round(x, 3), "%0.3f" % round(y,3)


if __name__ == '__main__':

    lines = []

    for line in sys.stdin:
        if line == "\n":
            break
        else :
            lines.append(line)

    for line in lines:
        x,y = calc([ int(item) for item in line.split(" ")])

        print(str(x) + " " + str(y))

Python: import sys
lines = sys.stdin.readlines()
for line in lines:
    line = line.split(" ")
    inp = []
    for i in line:
        inp.append(int(i))
    a = inp[0]
    b = inp[1]
    c = inp[2]
    d = inp[3]
    e = inp[4]
    f = inp[5]
    delta = a*e - b*d
    x = (c*e-b*f)/delta
    y = (-d*c+a*f)/delta
    print("%.3f %.3f" % (x,y))

Python: import fileinput

if __name__ == "__main__":
    for line in fileinput.input():
        v = [int(i) for i in line.split(" ")]
        x = (v[2] * v[4] - v[1] * v[5]) / (v[0] * v[4] - v[1] * v[3])
        y = (v[2] * v[3] - v[0] * v[5]) / (v[1] * v[3] - v[0] * v[4])
        print("%.3f" % x, "%.3f" % y)

Python: import sys

for line in sys.stdin:
    array = [int(x) for x in line.split()]
    ar1 = array[0:3]
    ar2 = array[3:]
    i = ar1[0]
    ar1 = [x*ar2[0] for x in ar1]
    ar2 = [x*i for x in ar2]
    y = (ar1[2] - ar2[2])/(ar1[1]-ar2[1])
    ar1 = array[0:3]
    x = (ar1[2]-ar1[1]*y)/ar1[0]
    print(str(round(x,3)) + ' ' + str(round(y,3)))

Python: import string
import sys
import math

#abcdef
#012345
#??????????????\????????????ip?????\??????
ip = sys.stdin.readlines()
ip_list = {}

#?????????????????§?????????
for i in range(len(ip)):
    ip_list[i] = ip[i].strip("\n").split()
    x = float( int(ip_list[i][2])*int(ip_list[i][4]) - int(ip_list[i][1])*int(ip_list[i][5]) ) / float( int(ip_list[i][0])*int(ip_list[i][4]) - int(ip_list[i][1])*int(ip_list[i][3]) )
    y = float( int(ip_list[i][2])*int(ip_list[i][3]) - int(ip_list[i][0])*int(ip_list[i][5]) ) / float( int(ip_list[i][1])*int(ip_list[i][3]) - int(ip_list[i][0])*int(ip_list[i][4]) )
    
    x = ('%.3f' % x)
    y = ('%.3f' % y)
    print(str(x)+" "+str(y))

Python: while True:
  try:
    a, b, c, d, e, f = map(float, input().split())
  except EOFError:
    break

  det = a * e - b * d
  if det != 0:
    x = (1 / det) * (e * c - b * f)
    y = (1 / det) * (a * f - c * d)
    if x >= 0:
      xx = (int)(x * 1000)
      if xx % 10 <= 4:
        ansx = (xx - xx%10) / 1000
      else:
        ansx = (xx + (10 - xx%10)) / 1000
    else:
      xx = (int)(x * -1000)
      if xx % 10 <= 4:
        ansx = (xx - xx%10) / -1000
      else:
        ansx = (xx + (10 - xx%10)) / -1000
      
    if y >= 0:
      yy = (int)(y * 1000)
      if yy % 10 <= 4:
        ansy = (yy - yy%10) / 1000
      else:
        ansy = (yy + (10 - yy%10)) / 1000
    else:
      yy = (int)(y * -1000)
      if yy % 10 <= 4:
        ansy = (yy - yy%10) / -1000
      else:
        ansy = (yy + (10 - yy%10)) / -1000
    print("{0:.3f} {1:.3f}".format(ansx, ansy))

Python: import numpy as np
while True:
    try:
        a,b,c,d,e,f = (int(i) for i in input().split())
        x,y = [np.dot(np.linalg.inv(np.array([[a,b],[d,e]])),np.array([c,f]))[0],np.dot(np.linalg.inv(np.array([[a,b],[d,e]])),np.array([c,f]))[1]]
        print(x,y)
    except EOFError:
        break

Python: import numpy as np
while True:
    try:
        a,b,c,d,e,f = map(int, input().split())
        ls1 = [[a,b],[d,e]]
        ls2 = [c,f]
        x,y = np.linalg.solve(ls1,ls2)
        print("{0:.4f} {1:.4f}".format(x,y))
    except:
        break

Python: while True:
    try:
        a, b, c, d, e, f = map(int, raw_input().split()) 
        x = float(c*e - b*f)/(a*e - b*d)
        y = float(c*d - a*f)/(b*d - a*e)
        print ("%.3f %.3f" % (round(x,3), round(y,3)))
    except:
        break

Python: import sys
from decimal import Decimal

def main():

    input_strings = sys.stdin.readlines()
    for coef_and_cons in input_strings:
        a, b, c, d ,e, f = map(Decimal, coef_and_cons.split())
        x = (f/e - c/b) / (d/e - a/b)
        y = (f/d - c/a) / (e/d - b/a)
        print('%.3f %.3f' %  (x.quantize(Decimal('0.001'), rounding='ROUND_HALF_DOWN'),
                              y.quantize(Decimal('0.001'), rounding='ROUND_HALF_DOWN') )
             )


main()

Python: while True:
    try:
        a,b,c,d,e,f=[float(i) for i in input().split()]
    except:
        break
    x=(c*e-b*f)/(a*e-b*d)
    y=(c*d-a*f)/(b*d-a*e)
    print("{0:.3f} {1:.3f}".format(x+0,y+0))

Python: import sys
from fractions import Fraction

def main():

    input_strings = sys.stdin.readlines()
    for matrix_string in input_strings:
        matrix = list(map(Fraction, list(matrix_string.split())))
        if matrix[0] == 0:
            matrix = matrix[3:] + matrix[:3]
        matrix = list(map(lambda x: x / matrix[0], matrix[:3])) + matrix[3:]
        matrix = matrix[:3] + list(map(lambda x: x[1] - matrix[3] * x[0], zip(matrix[:3], matrix[3:])))
        matrix = matrix[:3] + list(map(lambda x: x / matrix[4], matrix[3:]))
        matrix = list(map(lambda x: x[0] - matrix[1] * x[1], zip(matrix[:3], matrix[3:]))) + matrix[3:]
        matrix = list(map(int, matrix))
        print('%.3f %.3f' % (matrix[2], matrix[5]))


main()

Python: import string
import sys
import math

#??????????????\????????????ip?????\??????
ip = sys.stdin.readlines()
ip_list = {}

#?????????????????§?????????
for i in range(len(ip)):
    ip_list[i] = ip[i].strip("\n").split()
    x = int( float( int(ip_list[i][2])*int(ip_list[i][4]) - int(ip_list[i][1])*int(ip_list[i][5]) ) / float( int(ip_list[i][0])*int(ip_list[i][4]) - int(ip_list[i][1])*int(ip_list[i][3]) ))
    y = int( float( int(ip_list[i][2])*int(ip_list[i][3]) - int(ip_list[i][0])*int(ip_list[i][5]) ) / float( int(ip_list[i][1])*int(ip_list[i][3]) - int(ip_list[i][0])*int(ip_list[i][4]) ))
    
    x = ('%.3f' % x)
    y = ('%.3f' % y)
    print(str(x)+" "+str(y))

Python: r = [0 for i in range(4)]
for i in range(0, 4, 2):
    a, b, c, d, e, f = map(int, input().split(" "))
    detA = a * e - b * d
    r[i] = (c * e - b * f) / detA
    r[i + 1] = (a * f - c * d) / detA

for i in range(0, 4, 2):
    print("{:.3f} {:.3f}".format(r[i], r[i + 1]))

Python: import sys
 
lines = sys.stdin.readlines()
for line in lines:
    a, b, c, d, e, f = map(float, line.split())
    if a * e - b * d == 0:
        break
    x = (e * c + (-b) * f)/(a * e - b * d)
    y = ((-d) * c + a * f)/(a * e - b * d)
    print('{:.3f} {:.3f}'.format(x+0, y+0))