Problem:
Simultaneous Equation Write a program which solve a simultaneous equation:   ax + by = c  dx + ey = f  The program should print x and y for given a , b , c , d , e and f (-1,000 ≤ a, b, c, d, e, f ≤ 1,000). You can suppose that given equation has a unique solution. Input The input consists of several data sets, 1 line for each data set. In a data set, there will be a, b, c, d, e, f separated by a single space. The input terminates with EOF. Output For each data set, print x and y separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. Sample Input 1 1 2 3 4 5 6
2 -1 -2 -1 -1 -5 Output for the Sample Input 1 -1.000 2.000
1.000 4.000 Sample Input 2 2 -1 -3 1 -1 -3
2 -1 -3 -9 9 27 Output for the Sample Input 2 0.000 3.000
0.000 3.000

Solution (Python):
while 1:
    def solver(a, b, c, d, e, f):
        answer = []

        if d == 0:
            y = f / e
            x = (c - b * y)/a

        else:
            m = a / d

            d = d * m
            e = e * m
            f = f * m

            y = (c - f)/(b - e)

            x = (c - b * y)/a

            if x == -0:
                x = 0
            if y == -0:
                y = 0

        answer.append(x)
        answer.append(y)
        return answer

    try:
        p_1, p_2, p_3, p_4, p_5, p_6 = map(float, raw_input().split())

        ans = []
        ans = solver(p_1, p_2, p_3, p_4, p_5, p_6)

        print "%.3f %.3f" % (ans[0], ans[1])

    except:
        break

Solution (Python):


while True:
    try:
        number_list = list(map(float, input().split()))
    except EOFError:
        break
    det = number_list[0]*number_list[4] - number_list[1]*number_list[3]
    inverse_list = [number_list[4] / det, -number_list[1] / det, -number_list[3] / det, number_list[0] / det]

    x = inverse_list[0]*number_list[2] + inverse_list[1]*number_list[5]
    y = inverse_list[2]*number_list[2] + inverse_list[3]*number_list[5]

    print('{0:.3f} {1:.3f}'.format(x, y))

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

Solution (Python):


while True:
	try:
		data = map(int, raw_input().split())
		a = data[0]
		b = data[1]
		c = data[2]
		d = data[3]
		e = data[4]
		f = data[5]

		x = (c*e-b*f)*1.0 / (a*e-b*d)
		if x == -0.000:
			x = 0.000
		if b != 0:
			y = (c-a*x)/b
		else:
			y = (f-d*x)/e
		if y == -0.000:
			y = 0.000

		print("{:.3f} {:.3f}".format(x,y))
	except EOFError:
		break

Solution (Python):
while True:
    try:
        a, b, c, d, e, f = map(int, input().split())
    except:
        break
    y = (c * d - f * a) / (b * d - e * a)
    x = (c - (b * y)) / a
    print("{:.3f} {:.3f}".format(x, y))

Solution (Python):
import sys


for i in sys.stdin:
    a,b,c,d,e,f=list(map(float, i.split()))
    
    
    
    
    y = (f-(d*c)/a)/((a*e-d*b)/a)
    x = (c-b*y)/a
    print("{0:.3f} {1:.3f}".format(x,y))

Solution (Python):
while True:
    try:
        a,b,c,d,e,f=map(int,raw_input().split())
        if a*d-b*c==0:
            print "not exist answer"
        else:
            x = (float((c*e-b*f)) / (a*e-b*d))+0
            y = (float((a*f-c*d)) / (a*e-b*d))+0
            print ('%.3f' % round(x,3)), ('%.3f' % round(y,3))
    except:
        break

Solution (Python):
while 1:
    try:
        s=input()
        a,b,c,d,e,f = [int(x) for x in s.split()]
        y = (d*c-a*f)/(b*d-a*e)
        x = (c-b*y)/a
        print('{:.3f} {:.3f}'.format(x,y))
    except:
        break

Solution (Python):
import sys


def det(mat):
  t = 1 / (mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0])
  a = t * mat[1][1]
  b = t * -1 * mat[0][1]
  c = t * -1 * mat[1][0]
  d = t * mat[0][0]
  return [[a, b], [c, d]]


for line in sys.stdin:
  try:
    a, b, c, d, e, f = [int(i) for i in line.split()]
    A = [[a, b], [d, e]]
    P = [c, f]
    detA = det(A)
    print("%.3lf %.3lf" % (detA[0][0] * P[0] + detA[0][1] * P[1], detA[1][0] * P[0] + detA[1][1] * P[1]))
  except:
    break

Solution (Python):
import math

def my_round(x,d=0):
    p = 10 ** d
    return float(math.floor((x * p) + math.copysign(0.5, x))) / p

class Equation():
    def __init__(self, a, b, c, d, e, f):
        self.a = a
        self.b = b
        self.c = c
        self.d = d
        self.e = e
        self.f = f

    def calc(self):
        temp = (self.a * self.e - self.b * self.d)
        temp_a = (self.c * self.e - self.b * self.f)
        temp_b = (self.a * self.f - self.c * self.d)
        try:
            x = round(temp_a / temp+0., 3)
        except ZeroDivisionError:
            x = round(temp_a / 1.0, 4)

        try:
            y = round(temp_b / temp+0., 3)
        except:
            y = round(temp_b / 1.0, 4)


        return x, y


    def print(self):
        ans = self.calc()
        print("{0:.3f} {1:.3f}".format(ans[0], ans[1]))


def main():
    data = []

    while 1:
        try:
            n = input().split()

            a = float(n[0])
            b = float(n[1])
            c = float(n[2])
            d = float(n[3])
            e = float(n[4])
            f = float(n[5])

            data.append(Equation(a, b, c, d, e, f))

        except EOFError:
            break

    for num in data:
        num.print()

if __name__ == "__main__":
    main()

Solution (Python):
while(True):
	try:
		a,b,c,d,e,f = map(float,input().split(" "))
		z = a*e - b*d
		if(z!=0):
			x = (c*e-b*f)/z
			y = (a*f-c*d)/z
		print("{:.3f} {:.3f}".format(x+0,y+0))
	except:
		break

Solution (Python):
while True:
    try:
        input_line = input()
        if input_line == '':
            break
        else:
            a, b, c, d, e, f = map(float, input_line.split())
            x = (b*f-c*e) / (b*d-a*e)
            y = (c-a*x)/b
            print("{:.3f} {:.3f}".format(x+0,y+0))
    except:
        break

Solution (Python):
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    a,b,c,d,e,f = [float(i) for i in N[l].split()]
    x = (c*e-f*b)/(a*e-b*d)
    y = (f*a-c*d)/(a*e-b*d)
    print(format(x+0.0,'.3f'), format(y+0.0,'.3f'))

Solution (Python):
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 print("%-.3f %-.3f"%((c*e-b*f)/(a*e-b*d)+0,(c*d-a*f)/(b*d-a*e)+0))

Solution (Python):
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 print("%.3f %.3f"%((c*e-b*f)/(a*e-b*d)+0,(c*d-a*f)/(b*d-a*e)+0))

Solution (Python):
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 y=(c*d-a*f)/(b*d-a*e)
 print("%.3f %.3f"%((c-b*y)/a,y))

Solution (Python):
import sys
for e in sys.stdin:
    a, b, c, d, e, f = map(int, e.split())
    y=(c*d-a*f)/(b*d-a*e)
    x = (c-b*y)/a
    
    print("%.3f %.3f"%(x,y))

Solution (Python):
from sys import stdin
for line in stdin:
    a, b, c, d, e, f = map(float, line.split())
    anss = ['%.3f' % ((c * e - f * b) / (a * e - b * d)), '%.3f' % ((c * d - a * f) / (b * d - a * e))]
    for index, ans in enumerate(anss):
        if ans == '-0.000':
            anss[index] = '0.000'
    print(' '.join(anss))

Solution (Python):
while True:
    try:
        a, b, c, d, e, f = map(float, input().split())
        x = (c*d - a*f)/(b*d - a*e)
        print("{:.3f} {:.3f}".format((c - b*x)/a, x))
    except:
        break

Solution (Python):
while True:
    try:
        a, b, c, d, e, f = map(float, input().split())
        x = (c*e - b*f)/(a*e - b*d)
        y = (a*f - c*d)/(a*e - b*d)
        print("{:.3f} {:.3f}".format(x+0.0, y+0.0))
    except:
        break

Solution (Python):
while True:
	try:
		a,b,c,d,e,f = map(int, input().split())
		x = (c*d-a*f)/(b*d-a*e)
		print("{:.3f} {:.3f}".format((c-b*x)/a, x))
	except:
		break

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

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

        if abs(x) < 1e-4:
            x = 0.0
        if abs(y) < 1e-4:
            y = 0.0

        print("{0:.3f} {1:.3f}".format(x, y))

    except EOFError:
        break

Solution (Python):
while 1:
    try:
        a,b,c,d,e,f = map(float, input().split())  
        y=(c*d-a*f)/(b*d-a*e)
        x=(c-b*y)/a
        print("{0:.3f} {1:.3f}".format(x,y))
    except:
        break

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

Solution (Python):
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 y=(c*d-a*f)/(b*d-a*e)
 print(f'{(c-b*y)/a:.3f} {y:.3f}')

Solution (Python):
import sys
for i in sys.stdin:
    a, b, c, d, e, f = map(int, i.split())
    x = (c * e - b * f) / (a * e - b * d)
    y = (c * d - a * f) / (b * d - a * e)
    x = abs(x) if abs(x) < 10e-4 else x
    y = abs(y) if abs(y) < 10e-4 else y
    print("{:.3f} {:.3f}".format(x, y))

Solution (Python):
while True:
    try:
        a, b, c, d, e, f = [int(i) for i in input().split()]

        detA = a * e - b * d
        detA1 = c * e - b * f
        detA2 = a * f - c * d

        print('{:.3f} {:.3f}'.format(detA1 / detA + 0, detA2 / detA + 0))
    except EOFError:
        break

Solution (Python):

import sys

def main():
    data = []
    lines = sys.stdin.readlines()

    for line in lines:
        data.append(line.split())  
    
    
    
    N = len(data)
    for i in range(N):
        for k in range(6):
            data[i][k] = int(data[i][k])
        det = data[i][0] * data[i][4] - data[i][1] * data[i][3]
        gx = data[i][2] * data[i][4] - data[i][1] * data[i][5]
        gy = data[i][0] * data[i][5] - data[i][2] * data[i][3]
        if det < 0:
            det = -det;
            if gx != 0: gx = -gx
            if gy != 0: gy = -gy
        print("{0:.3f}".format(gx / det) + " " + "{0:.3f}".format(gy / det))

if __name__ == "__main__":
    main()

Solution (Python):
def main():
    while 1:
        try:
            p = [float(x) for x in input().split()]
            x = (p[4]*p[2]-p[1]*p[5])/(p[0]*p[4]-p[1]*p[3])
            y = (p[2]-p[0]*x)/p[1]
        except:
            break
        if abs(x)<1e-4:
            x=0.0
        if abs(y)<1e-4:
            y=0.0
        print("{:.3f} {:.3f}".format(x,y))

main()

Solution (Python):



EPS = 0.0001
while True:
	try:
		a = list(map(float, input().split()))
		dd = a[0]*a[4]-a[3]*a[1]
		d1 = a[2]*a[4]-a[5]*a[1]
		d2 = a[0]*a[5]-a[3]*a[2]
		print("{0:.3f} {1:.3f}".format(d1/dd+EPS, d2/dd+EPS))
	except EOFError:
		break

Solution (Python):
import sys

for line in sys.stdin:
    a,b,c,d,e,f = [float(i) for i in line.split()]
    x = round((1/a)*(c-b*((a*f-c*d)/(a*e-b*d))),3)
    y = round((a*f-c*d)/(a*e-b*d),3)
    print(
        '{:.3f}'.format(x),'{:.3f}'.format(y),
    )

Solution (Python):
while True:
    try:
        a,b,c,d,e,f = map(int, input().split())
        g = (a*e - b*d) 
        x = (c*e - b*f)
        y = (a*f - c*d)
        print('{0:.3f}'.format(x/g+0.0001) +' {0:.3f}'.format(y/g +0.0001))
              
    except EOFError: break

Solution (Python):
import sys

def inv(k):
    det = 1 / (k[0]*k[3] - k[1]*k[2])
    ret = [k[3] * det, -k[1] * det, -k[2] * det, k[0] * det]
    return ret

def dot(i, j):
    x = i[0] * j[0] + i[1] * j[1]
    y = i[2] * j[0] + i[3] * j[1]
    return [x,y]

def run():
    data = []
    for _data in sys.stdin:
        data.append(list(map(int, _data.split())))

    for _data in data:
        i = _data[:2] + _data[3:5]
        j = [_data[2],_data[5]]
        x, y = dot(inv(i), j)
        x, y = round(x, 3), round(y, 3)
        print('{0:.3f} {1:.3f}'.format(x,y))

if __name__ == '__main__':
    run()

Solution (Python):
while True:
    try:
        x = map(float, raw_input().split(" "))
        a = (x[2]*x[4]-x[1]*x[5])/(x[0]*x[4]-x[1]*x[3])
        b = (-x[3]*x[2]+x[0]*x[5])/(x[0]*x[4]-x[1]*x[3])
        
        if a == -0: a = 0
        if b == -0: b = 0
        
        print "%.3f %.3f" % (a, b)
    
    except EOFError:
        break

Solution (Python):
while True:
    try:
        x = map(float, raw_input().split(" "))
        a = (x[2]*x[4]-x[1]*x[5])/(x[0]*x[4]-x[1]*x[3])
        b = (-x[3]*x[2]+x[0]*x[5])/(x[0]*x[4]-x[1]*x[3])
         
        if a == -0: a = 0
        if b == -0: b = 0
         
        print "%.3f %.3f" % (a, b)
     
    except EOFError:
        break

Solution (Python):

import math
while True:
    try:
        list = [float(x) for x in raw_input().split(" ")]
        x = (list[2]*list[4]-list[1]*list[5])/(list[0]*list[4]-list[1]*list[3])
        y = (list[0]*list[5]-list[2]*list[3])/(list[0]*list[4]-list[1]*list[3])
        if x == -0:
            x = 0
        if y == -0:
            y = 0
        print("%.3f %.3f" %(x, y))
    except EOFError:
        break

Solution (Python):
import sys

def calc(a, b, c, d, e, f):
    tmp = a * e - b * d
    x = c * (e / tmp) + f * (-b / tmp)
    y = c * (-d / tmp) + f * (a / tmp)
    return (x, y)

for i in sys.stdin.readlines():
    i = i.strip()
    a, b, c, d, e, f = map(float, i.split())
    print "{0[0]:.3f} {0[1]:.3f}".format(calc(a, b, c, d, e, f))

Solution (Python):


while(True):
    try:
        n = map(float, raw_input().split())
        x = (n[2]*n[4] - n[5]*n[1]) / (n[0]*n[4] - n[3]*n[1])
        y = (n[2]*n[3] - n[5]*n[0]) / (n[1]*n[3] - n[4]*n[0])

        if x==-0:
            x=0
        if y==-0:
            y=0

        print "%.3f %.3f"%(x,y)

    except Exception:
        break

Solution (Python):
import sys
import math
for i in sys.stdin.readlines():
    a,b,p,c,d,q= map(float, i.split())
    print "{:.3f} {:.3f}".format((d*p-b*q)/(a*d-b*c)+0,(-c*p+a*q)/(a*d-b*c)+0)

Solution (Python):
import sys
for x in sys.stdin.readlines():
    n = [float(y) for y in x.split()]

    print "%.3f %.3f" % ((n[2]*n[4]-n[1]*n[5])/(n[0]*n[4]-n[1]*n[3])+0,(n[5]*n[0]-n[2]*n[3])/(n[0]*n[4]-n[3]*n[1])+0)

Solution (Python):

def solve(a, b, c, d, e, f):
    agn = a*e - b*d
    x = (e*c - b*f)/float(agn)
    y = (-d*c + a*f)/float(agn)
    if x == 0.: x = 0.
    if y == 0.: y = 0.
    print "%.3f %.3f" % (x, y)
    
while 1:
    try:
        a,b,c,d,e,f = map(float, raw_input().split())
        solve(a,b,c,d,e,f)
    except EOFError:
        break

Solution (Python):
while True:
    try:
        x = map(float, raw_input().split(" "))
        a = (x[2]*x[4]-x[1]*x[5])/(x[0]*x[4]-x[1]*x[3])
        b = (-x[3]*x[2]+x[0]*x[5])/(x[0]*x[4]-x[1]*x[3])
         
        if a == -0: a = 0
        if b == -0: b = 0
         
        print "%.3f %.3f" % (a, b)
     
    except EOFError:
        break

Solution (Python):
while True:
    try:
        a = map(float, raw_input().split(' '))
        x = (a[1]*a[5]-a[2]*a[4])/(a[1]*a[3]-a[0]*a[4])
        y = (a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4])
        if x == 0: 
            x = abs(x)
        if y == 0:
            y = abs(y)
        print '%.3f %.3f' % (x,y)
    except EOFError:
        break

Solution (Python):
while True:
    try:
        a, b, c, d, e, f = map(float, raw_input().split())
    except EOFError:
        break
    x = (e * c - b * f) / (a * e - b * d)
    y = (-d * c + a * f) / (a * e - b * d)
    print '%.3f %.3f' % (x + 0.00001, y + 0.00001)

Solution (Python):
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
import sys

for line in sys.stdin:
    a, b, c, d, e, f = (float(n) for n in line.split())
    x = round((e * c - b * f) / (a * e - b * d), 4)
    y = round((a * f - c * d) / (a * e - b * d), 4)
    if x == -0.0:
        x  = 0.0
    if y == -0.0:
        y = 0.0
    print('{:.3f} {:.3f}'.format(-(-x), -(-y)))

Solution (Python):
try:
 for r in iter(raw_input,0):a,b,c,d,e,f=map(float,r.split());g=a*e-b*d;print "%.3f %.3f"%((c*e-b*f)/g+1e-9,(a*f-c*d)/g+1e-9)
except:pass

Solution (Python):
while True:
	try:
		a,b,c,d,e,f = map(float,raw_input().split(' '))
		p = round((c*e-b*f)/(a*e-b*d),4)
		q = round((a*f-c*d)/(a*e-b*d),4)
		x = '%.3f' % p
		y = '%.3f' % q
		if str(x) == '-0.000': x = '%.3f' % 0.000
		if str(y) == '-0.000': y = '%.3f' % 0.000
		print x,y
	except: break

Solution (Python):
import sys
for line in sys.stdin:
    [a,b,c,d,e,f] = [float(x) for x in line.split()]
    x = (f-(c/b*e))/(d-(a/b*e))
    y = (f-(c/a*d))/(e-(b/a*d))
    print "%.3f %.3f" % (x if x else 0.0,y if y else 0.0)

Solution (Python):
data = []
try:
    while True:
        data.append(raw_input())

except EOFError:
    pass

for i in data:
    a, b, c, d, e, f = map(float, (i.split()))
    if (abs(a) <= 1000
        and abs(b) <= 1000
        and abs(c) <= 1000
        and abs(d) <= 1000
        and abs(e) <= 1000
        and abs(f) <= 1000):
        y = (a*f - c*d) / (a*e - b*d)
        x = (c - b*y) / a
        print "{:.3f} {:.3f}".format(x, y)

Solution (Python):
while True:
    try:
        a = map(float,raw_input().split())
        m = a[0]*a[4]-a[1]*a[3]

        x = (a[4]*a[2] - a[1]*a[5])/m
        y = (a[0]*a[5] - a[2]*a[3])/m

	if x == -0:
            x = 0
	if y == -0:
            y = 0

	print "%.3f %.3f" % (x,y)

    except EOFError:
	break

Solution (Python):
while True:
    try:
        a, b, c, d, e, f = map(float, raw_input().split())
        a1 = (c*e-b*f)/(a*e-b*d)
        a2 = (a*f-c*d)/(a*e-b*d)
        if a1 == -0:
            a1 = 0
        if a2 == -0:
            a2 = 0
        print "{0:.3f} {1:.3f}".format(a1, a2)
    except EOFError:
        break

Solution (Python):
try :
  while True :
    (a,b,c,d,e,f) = map(float, raw_input().split())

    print "%.3f %.3f"%((c*e-b*f)/(a*e-b*d)+0, (a*f-c*d)/(a*e-b*d)+0)
except EOFError :
  pass

Solution (Python):


if __name__ == '__main__':

	while True:
		try:
			a, b, c, d, e, f = [float(num) for num in raw_input().split()]
			x = ((e*c)-(b*f))/((e*a)-(b*d))
			y = ((d*c)-(a*f))/((d*b)-(a*e))
		except:
			break

		if(x==-0):
			x=0
		if(y==-0):
			y=0
		
		print '%0.3f %0.3f' % (x , y)

Solution (Python):
import sys


def gcd(a, b):
    return gcd(b, a % b) if a % b else b


def lcm(a, b):
    return a * b / gcd(a, b)

for line in sys.stdin:
    data = map(int, line.split())
    a, b, c, d, e, f = data
    if a == 0:
        y = c * 1.0 / b
        x = (f - e * y) * 1.0 / d
        print "%.3f %.3f" % (round(x, 4), round(y, 4))
        continue
    if b == 0:
        x = c * 1.0 / a
        y = (f - d * x) * 1.0 / e
        print "%.3f %.3f" % (round(x, 4), round(y, 4))
        continue
    if d == 0:
        y = f * 1.0 / e
        x = (c - b * y) * 1.0 / a
        print "%.3f %.3f" % (round(x, 4), round(y, 4))
        continue
    if e == 0:
        x = f * 1.0 / d
        y = (c - a * x) * 1.0 / b
        print "%.3f %.3f" % (round(x, 4), round(y, 4))
        continue

    ix = lcm(a, d) / a
    jx = lcm(a, d) / d
    iy = lcm(b, e) / b
    jy = lcm(b, e) / e
    x = (c*1.0*iy - f*jy) / (a*iy - d*jy)
    y = (c*1.0*ix - f*jx) / (b*ix - e*jx)
    print "%.3f %.3f" % (round(x, 4), round(y, 4))

Solution (Python):
import sys
for i in sys.stdin:
    a,b,c,d,e,f=map(int,i.split())
    y=(d*c-a*f)*1.0/(d*b-a*e);
    print "%.3f %.3f"%((c-b*y)/a,y)

Solution (Python):
def inverse(x):
    if len(x)!=2: return []
    a, b = x[0]
    c, d = x[1]
    tmp = 1.0/(a*d-b*c)
    return [[d*tmp, -b*tmp],[-c*tmp, a*tmp]]

def Mmult(A, B):
    n1=len(A)
    n2=len(A[0])
    n3=len(B[0])
    C=[[0 for j in range(n3)] for i in range(n1)]
    for i in range(n1):
        for j in range(n2):
            for k in range(n3):
                C[i][k] += A[i][j] * B[j][k]
    return C            

while True:
    try:
        x = map(int, raw_input().split())
    except:
        break
    A=[x[0:2], x[3:5]]
    B=[[x[2]], [x[5]]]
    C = Mmult(inverse(A), B)
    print "%.3f %.3f" %(C[0][0], C[1][0])

Solution (Python):
while True:
    try:
        (a,b,c,d,e,f) = map(float, raw_input().split())
        y = (a * f - c * d) / (-b * d + e * a)
        x = (c - b * y) / a
        print '{0:.3f} {1:.3f}'.format(x, y)
    except EOFError:
        break

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

Solution (Python):


import sys

datas = []

for line in sys.stdin:
	datas.append(map(float, line.split()))

for data in datas:
	a, b, c, d, e, f = data
	y = (c * d - a * f) / (b * d - a * e)
	x = (c - b * y) / a
	print "{0:.3f} {1:.3f}".format(x, y)

Solution (Python):
import sys
for line in sys.stdin:
    a, b, c, d, e, f = map(int, line.rstrip('\n').split(' '))
    x = int((e*c - b*f) * 1000 / (a*e - b*d)) / 1000.0
    y = int((a*f - d*c) * 1000 / (a*e - b*d)) / 1000.0
    print '%.3f %.3f' % (x, y)

Solution (Python):
while 1:
        try:
                P = map(float,raw_input().split())
        except EOFError:
                break
        x = (P[2]*P[4]-P[5]*P[1])/(P[0]*P[4]-P[3]*P[1])
        y = (P[2]*P[3]-P[5]*P[0])/(P[1]*P[3]-P[4]*P[0])
        x = x if x else 0
        y = y if y else 0
        print "{:.3f} {:.3f}".format(x,y)

Solution (Python):


get_y = lambda a,b,c,d,e,f: (f-(c*d/a)) / (e-(b*d/a))
get_x = lambda a,b,c,y: (c-b*y)/a

if __name__ == "__main__":
    while True:
        try:
            a,b,c,d,e,f = [float(z) for z in raw_input().split()]
            y = get_y(a,b,c,d,e,f)
            x = get_x(a,b,c,y)
            print "%.3f %.3f" % (x, y)
        except EOFError:
            break

Solution (Python):
import sys
for s in sys.stdin:
    a,b,c,d,e,f=map(float,s.split())
    x=c*e-b*f
    y=a*f-c*d
    z=a*e-b*d
    def f(x,z):
        if x==0: return 0
        else: return x/z
    print "%.3f %.3f" %(f(x,z),f(y,z))

Solution (Python):
import sys
for s in sys.stdin:
    a,b,c,d,e,f=map(int,s.split())
    x=c*e-b*f
    y=a*f-c*d
    z=a*e-b*d
    def f(x,z):
        if x==0: return 0
        else: return 1.0*x/z
    print "%.3f %.3f" %(f(x,z),f(y,z))

Solution (Python):
import sys
for s in sys.stdin:
    a,b,c,d,e,f=map(int,s.split())
    y=(a*f-c*d)*1.0/(a*e-b*d)
    x=(c-b*y)/a
    print "%.3f %.3f" %(x,y)

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

Solution (Python):
import sys
for s in sys.stdin:
  a,b,c,d,e,f=map(float,s.split())
  y=(a*f-c*d)/(a*e-b*d)
  print "%.3f %.3f"%((c-b*y)/a,y)

Solution (Python):


import sys

outList = []
for line in sys.stdin.readlines():
    List = map(float, line.strip().split())

    [a, b, c, d, e, f] = List

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

    outList.append("%.3f %.3f" % (x+0, y+0))

for i in xrange(len(outList)):
    print outList[i]

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

Solution (Python):
while 1:
    try:
        a, b, c, d, e, f = map(float, raw_input().split())
        x = (c * e - b * f) / (a * e - b * d)
        y = (f * a - c * d) / (a * e - d * b)
        if x == -0.000:
            x = 0.000
        if y == -0.000:
            y = 0.000
        print str('%.3f' % x) + " " + str('%.3f' % y)
    except:
        break

Solution (Python):
while 1:
    try:
        a, b, c, d, e, f = map(float, raw_input().split())
        matrix = [[a, b, c], [d, e, f]]
        for i in range(2):
            tmp = matrix[i][i]
            for j in range(3):
                matrix[i][j] = matrix[i][j] / tmp
            for j in range(2):
                if i == j:
                    continue
                else:
                    a = matrix[j][i]
                    for k in range(i, 3):
                        matrix[j][k] = matrix[j][k] - a * matrix[i][k]
        print "%.3f %.3f" % (matrix[0][2], matrix[1][2])
    except:
        break

Solution (Python):
def gauss(matrix):
    dimension = len(matrix)
    for i in range(dimension):
        tmp = matrix[i][i]
        for j in range(dimension + 1):
            matrix[i][j] /= tmp
        for j in range(dimension):
            if i == j:
                continue
            else:
                tmp2 = matrix[j][i]
                for k in range(i, dimension + 1):
                    matrix[j][k] -= tmp2 * matrix[i][k]
    return zip(*matrix)[-1]

while 1:
    try:
        a, b, c, d, e, f = map(float, raw_input().split())
        matrix = [[a, b, c], [d, e, f]]
        print "%.3f %.3f" % gauss(matrix)
    except:
        break

Solution (Python):
while 2>1:
	try:
		a,b,c,d,e,f = map(float, raw_input().split(" "))
		x=(c*e-b*f)/(e*a-b*d)
		y=(c*d-a*f)/(b*d-e*a)
		print "%.3f %.3f" % (x+0,y+0)
		
	except EOFError:
		break
	except ValueError:
		break

Solution (Python):
import sys

for s in sys.stdin:
  a, b, c, d, e, f = map(float, s.split())
  y = (a*f - d*c)/(a*e - d*b)
  x = (c - b*y)/a
  print '%.03f %.03f'%(x, y)

Solution (Python):
while True:
	try:
		a,b,c,d,e,f = map(float,raw_input().split())
		x = (e*c-b*f) / (e*a-b*d)
		y = (c*d-a*f) / (b*d-e*a)
		if x == -0.0:
			x = 0
		if y == -0.0:
			y = 0
		print '%.3f %.3f' % (x,y)
	except EOFError:
		break

Solution (Python):
while True:
    try:
        line = input()
    except:
        break
    a,b,c,d,e,f = map(int, line.strip().split())
    z = a * e - b * d
    x = c * e - b * f
    if x: x = x / z
    y = a * f - c * d
    if y: y = y / z
    print('{:.3f} {:.3f}'.format(x, y))

Solution (Python):
import sys
import math

def readdata():
    for line in sys.stdin:
        yield map(int,line.split())

def rounder(decimal):
    rounded = round(decimal*1000)/1000
    if rounded == -0.0:
        rounded = +0.0
    return rounded

for data in readdata():
    [a,b,c,d,e,f] = map(float,data)
    det = a*e-b*d
    x = (c*e-b*f)/det
    y = (a*f-c*d)/det
    [x,y] = map(rounder,[x,y])
    print "%1.3f %1.3f" % (x,y)

Solution (Python):
while True:

    try:
        a,b,c,d,e,f = (float(x) for x in input().split())
        x = (c * e - b * f) / (a * e - b * d)
        y = (c * d - a * f) / (b * d - a * e)
        
        if x == 0: x = 0
        if y == 0: y = 0
        print(format(x, ".3f"), format(y, ".3f"))

    except EOFError:
        break

Solution (Python):
while True:
    try:
        a,b,c,d,e,f=map(float, input().split())
        x=(c*e-b*f)/(a*e-b*d)
        y=(c*d-a*f)/(b*d-a*e)
        if x==-0:
            x=0
        if y==-0:
            y=0
        print(f"{x:.3f} {y:.3f}")
    except:
        break

Solution (Python):
while True:
 try:
  a,b,c,d,e,f = map(int,input().split())
  y = (c*d-a*f)/(b*d-a*e)
  x = (c-b*y)/a
  print('{:.3f} {:.3f}'.format(x,y))
 except: break

Solution (Python):
while True:
	try:
		a, b, c, d, e, f = map(int, input().split())
	except EOFError:
		break
	print(format(round((c*e-b*f)/(a*e-b*d)+0.,3), ".3f"), format(round((a*f-c*d)/(a*e-b*d)+0.,3), ".3f"), sep=" ")

Solution (Python):



b=0.0001
while True:
    try:
        a=list(map(float,input().split()))
        x=(a[2]*a[4]-a[1]*a[5])/(a[0]*a[4]-a[1]*a[3])
        y=(a[2]*a[3]-a[0]*a[5])/(a[1]*a[3]-a[0]*a[4])
        print("{0:.3f} {1:.03f}".format(x+b,y+b))
    except EOFError:
        break

Solution (Python):
while True:
    try:
        L=list(map(int,input().split()))
        x=L[0]*L[4]-L[3]*L[1]
        y=L[2]*L[4]-L[5]*L[1]
        z=y/x+0
        w=(L[2]-L[0]*z)/L[1]+0
        print(f"{z:.3f} {w:.3f}")
    except EOFError:
        break

Solution (Python):



while True:
   try:
      a, b, c, d, e, f = map(float, input().split())
      x = (c * e - b * f) / (a * e - b * d)
      y = (c - a * x) / b
      
      if x == 0:
         print('{:.3f}'.format(abs(x)), '{:.3f}'.format(y))
      elif y == 0:
         print('{:.3f}'.format(x), '{:.3f}'.format(abs(y)))
      else:
         print('{:.3f}'.format(x), '{:.3f}'.format(y))
   except EOFError:
      break

Solution (Python):
while True:
    try:
        a,b,c,d,e,f=map(int,input().split())
        y=(c*d-a*f)/(b*d-a*e)
        x=(e*c-b*f)/(a*e-b*d)
        
        if x==0:
            x=0
        if y==0:
            y=0
        print(f'{x:.3f} {y:.3f}')    
    except:
        break

Solution (Python):
while True:
    try:
        a, b, c, d, e, f = map(int, input().split())
    except:
        break
    y = (c * d - f * a) / (b * d - e * a)
    x = (c - (b * y)) / a
    print("{:.3f} {:.3f}".format(x, y))

Solution (Python):
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
while True:
   try:
      a,b,c,d,e,f = map(float, input().split())
      x = (c*e - b*f) / (a*e - b*d)
      y = (a*f - c*d) / (a*e - b*d)
      if x == -0:
         x = int(x)
      if y == -0:
         y = int(y)
      X = Decimal(x).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP)
      Y = Decimal(y).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP)
      print(f'{X:.3f} {Y:.3f}')
   except EOFError:
      break

Solution (Python):
while True:
    try:
        a,b,c,d,e,f = map(int, input().split())
        X = d/a
        y = (c*X-f)/(b*X-e)
        x = (c-b*y)/a
        print(f'{x:.3f} {y:.3f}')
    except:
        break

Solution (Python):
while True:
  try:
     a,b,c,d,e,f= map(int,input().split())
  except EOFError:
     break
  x = (e*c-f*b)/(e*a-b*d)
  y = (d*c-f*a)/(d*b-a*e)
  if -0.0005 < x <= 0:
    x = 0.000
  if -0.0005 < y <= 0:
    y = 0.000
  print(f'{x:.3f}',f'{y:.3f}')

Solution (Python):
while True:
    try:
        a,b,c,d,e,f = map(int,input().split())
        x = (c * e - b * f) / (a * e - b * d)
        y = (c * d - a * f) / (b * d - a * e)
        
        if x == 0:
            x = 0
        if y == 0:
            y = 0
        print(f"{x:.3f} {y:.3f}")
    except:
        break

Solution (Python):


def ren(a,b,c,d,e,f):
    x=(c*e-f*b)/(a*e-b*d)
    y=(c*d-f*a)/(b*d-e*a)
    
    print(f'{x+0:.3f} {y+0:.3f}')

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

Solution (Python):
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
while True:
   try:
      a,b,c,d,e,f = map(float, input().split())
      x = (c*e - b*f) / (a*e - b*d)
      y = (a*f - c*d) / (a*e - b*d)
      if x==-0:
         x=int(x)
      if int(y)==-0:
         y=int(y)
      X = Decimal(x).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP)
      Y = Decimal(y).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP)
      print(f'{X:.3f} {Y:.3f}')
   except EOFError:
      break

Solution (Python):
while True:
    try:
        a, b, c, d, e, f = map(int,input().split())
        x = (b*f - e*c) / (b*d - a*e)
        y = (a*f - c*d) / (a*e - b*d)
        if x == -0.000:
            x = 0
            
        print('{:.3f}'.format(x), '{:.3f}'.format(y))
    except:
        break

Solution (Python):
from decimal import Decimal,ROUND_HALF_UP,ROUND_HALF_EVEN
while True:
    try:
        a,b,c,d,e,f=map(int,input().split())
        x=(c*e-b*f)/(a*e-b*d)
        y=(a*f-c*d)/(a*e-b*d)
        if x==-0:
            x=int(x)
        if y==-0:
            y=int(y)
        X=Decimal(x).quantize(Decimal('0.001'),rounding=ROUND_HALF_UP)
        Y=Decimal(y).quantize(Decimal('0.001'),rounding=ROUND_HALF_UP)
        print(f'{X:3f}',f'{Y:3f}')
    except EOFError:
        break

Solution (Python):
while 1:
    try:
        a,b,c,d,e,f=map(int,input().split())
        x=(c*d-a*f)/(b*d-a*e)
        print("{:.3f} {:.3f}".format((c-b*x)/a,x))
    except:
        break