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



Sample input:
1 2 3 4 5 6
2 -1 -2 -1 -1 -5


Sample output:
-1.000 2.000
1.000 4.000

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
# Simultaneous Equation

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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
#!/usr/bin/env 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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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]

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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=" ")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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}')

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)
    except:
        break

    x = round(x, 3)
    y = round(y, 3)

    if x == -0.000:
        x = 0.000
    elif y == -0.000:
        y = 0.000

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

Submission status: Accepted

Solution code:
#0004
while True:
    try:
        a,b,c,d,e,f = map(float,input().split())
        y = (a*f-d*c)/(a*e-b*d)
        x = (f*b-e*c)/(b*d-a*e)
        if x == -0.0:
            x = 0.000
        elif y == -0.0:
            y = 0.000
        print(format(x, '.3f'),format(y, '.3f'))
    except:
        break

Submission status: Accepted

Solution code:
# coding: utf-8
# 83

while True:
    try:
        a,b,c,d,e,f = map(float,input().split())
        X = (f*b-e*c)/(b*d-e*a)
        Y = (a*f-d*c)/(a*e-b*d)
        if X==-0.0:
            X=0.0
        elif Y==-0.0:
            Y=0.0
        print(f"{X:.3f} {Y:.3f}")
    except:
        break

Submission status: Accepted

Solution code:
#83 連立方程式

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while 1:    #ax+by=c #dx+ey=f
            
    try:
        a,b,c,d,e,f=map(float,input().split())
        det=a*e-d*b
        x=(e*c-b*f)/det
        y=(-d*c+a*f)/det
        if abs(x) < 0.0001:
            x = 0.0
        if abs(y) < 0.0001:
            y = 0.0
        print(format(x,'.3f'),format(y,'.3f'))   
    except EOFError:
        break

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

c = 0.0001
while True:
    try:
        a = list(map(int,input().split()))
        b1 = a[0]*a[4]-a[3]*a[1]
        b2 = a[2]*a[4]-a[5]*a[1]
        b3 = a[0]*a[5]-a[3]*a[2]
        print("{0:.3f} {1:.3f}" .format(b2/b1 + c, b3/b1 + c))
    except EOFError:
        break

Submission status: Accepted

Solution code:
from decimal import *
while True:
    try:
        a,b,c,d,e,f=map(float, input().split())
    except:
        break
    m=(c*e-b*f)
    n=(a*e-b*d)
    if m == 0.0:
        x=0.0
    else:
        x=m/n
    m=(c*d-a*f)
    n=(b*d-a*e)
    if m == 0.0:
        y=0.0
    else:
        y=m/n
    print(Decimal(str(x)).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP),Decimal(str(y)).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP))

Submission status: Accepted

Solution code:
try:
    while True:
        a,b,c,d,e,f = map(float,input().split())
        if  a - d == 0:
            y = (c - f) / (b - e)
            x = (c - b*y) / a
        else:
            A = a*d
            D = d*a
            B = b*d
            C = c*d
            E = e*a
            F = f*a
            if C < F :
                y = (C - F) / (B - E)
                x = (c - b*y) / a
            else: 
                y = (F - C) / (E - B)
                x = (c - b*y) / a
        
        print(f'{round(x,3):.03f}',f'{round(y,3):.03f}')
        
except EOFError:
    pass

Submission status: Accepted

Solution code:
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(f'{x:.3f} {y:.3f}')
    except:
        break

Submission status: Accepted

Solution code:
try:
    while True:
        a,b,c,d,e,f=map(float,input().split())
        x=(c*e-f*b)/(a*e-d*b)
        y=(c*d-f*a)/(b*d-e*a)
        if x==0:
            x=0.000
        print(f'{x:5.3f} {y:5.3f}')
except EOFError:
    pass

Submission status: Accepted

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

Submission status: Accepted

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

    A = a*e - b*d
    x = (e*c - b*f)/A
    y = (a*f - d*c)/A
    # 出力の体裁を整え、-0.00を0.00にするため+0する
    print("{:.3f} {:.3f}".format(x+0,y+0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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(float,input().split())
    except:
        break
    ren(a,b,c,d,e,f)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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: x=0
    print(f'{x:.3f} {y:.3f}')
  except EOFError: break

Submission status: Accepted

Solution code:
while True:
    try:
        a,b,c,d,e,f = [int(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("{0:.3f} {1:.3f}".format(x,y))
        
    except:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        a, b, c, d, e, f = map(float, input().split())
    except:
        break
    
    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('{:.3f}'.format(x), '{:.3f}'.format(y))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
from decimal import Decimal, ROUND_HALF_UP
while True:
    try:
        a, b, c, d, e, f = map(float, input().split())
        x = (c * e - b * f) / (a * e - b * d) + 0.0
        y = (c * d - a * f) / (b * d - a * e) + 0.0
        print(Decimal(str(x)).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP), Decimal(str(y)).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP))
    except:
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    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(f'{x:.3f} {y:.3f}')
    except:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    try:
        a,b,c,d,e,f=map(int,input().split())
        det=a*e-b*d
        x=(e*c-b*f)
        y=(a*f-d*c)
        if det<0:
            x=-x
            y=-y
            det=-det
        print("%.03f %.03f" %(x/det,y/det))
    except:
        break

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

Solution code:
while True:
    try:
        lst = list(map(int, input().split()))
        a, b, c, d, e, f = lst[0], lst[1], lst[2], lst[3], lst[4], lst[5]
        x = (b*f - c*e)/(b*d - a*e)
        y = (c*d - a*f)/(b*d - a*e)
        print('{:.3f}'.format(x+0.0), end = " ")
        print('{:.3f}'.format(y+0.0))
    
    except:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
listal=[]
while True:
    try:
        listal.append(input())
    except:
        break
for i in listal:
    j=list(map(int,i.split()))
    y=(j[3]*j[2]-j[0]*j[5])/(j[1]*j[3]-j[0]*j[4])
    x=(j[2]-j[1]*y)/j[0]
    print('{:.3f}'.format(x),'{:.3f}'.format(y))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
for i in range(1,100000000):
    try:
        a,b,c,d,e,f=map(int,input().split())
        y=(a*f-d*c)/(e*a-b*d)
        x=(c-b*y)/a
        print(f'{x:.3f} {y:.3f}')
    except EOFError:
        break

Submission status: Accepted

Solution code:
for line in open(0).readlines():
    a, b, c, d, e, f = map(int, line.split())
    det = a*e - b*d
    x = (e*c - b*f)
    y = (a*f - d*c)
    if det < 0:
        x = -x; y = -y; det = -det
    print("%.03f %.03f" % (x/det, y/det))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while 1:
  try:
    s=list(map(float,input().split()))
    up=s[4]/s[1]
    a=s[0]*up
    b=s[1]*up
    c=s[2]*up
    d=s[3]
    e=s[4]
    f=s[5]
  
    ad=a-d
    cf=c-f
    x=round(cf/ad,3)
    if x==-0.000:
      x=0.00
    y=round((s[2] - s[0]*x)/s[1],3)
    if y==-0.000:
      y=0.000
    print('{:.3f}'.format(x),'{:.3f}'.format(y))

  except EOFError:
    break

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
while True:
    try:
        z = list(map(int,input().split()))
    except:
        break
    a = z[:3]
    b = z[3:]
    c = a[:]
    d = b[:]
    s = [a[0],b[0]]
    a = list(map(lambda x:x*s[1],a))
    b = list(map(lambda x:x*s[0],b))
    y = (b[2]-a[2])/(b[1]-a[1])
    try:
        x = (c[2]-c[1]*y)/c[0]
    except:
        x = (d[2]-d[1]*y)/d[0]
    print(Decimal(str(x)).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP),Decimal(str(y)).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP))

Submission status: Accepted

Solution code:
import sys
lines = sys.stdin.readlines()

for line in lines:
    s = str(line)
    a,b,c,d,e,f = map(int, s.rstrip('\n').split())
    x = (e*c - b*f) / (a*e - b*d)
    if e*c - b*f == 0:
        x = 0
    x = round(x, 3)
    y = (a*f - c*d) / (a*e - b*d)
    if a*f - c*d == 0:
        y = 0
    y = round(y, 3)
    print(f'{x:.3f} {y:.3f}')

Submission status: Accepted

Solution code:
import sys, math

array = []
for line in sys.stdin:
    array.append(map(int, line.split(' ')))

for a, b, c, d, e, f in array:
    determinant = a * e - b * d
    if determinant == 0:
        print('NO ANSWER')
    x = (c * e - b * f) / determinant
    y = (a * f - c * d) / determinant
    x = math.floor(x * 1000) / 1000
    y = math.floor(y * 1000) / 1000

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
import sys;print("\n".join(["{:.3f}".format(int((e*c-b*f)/(a*e-b*d)*1000)/1000) + " " + "{:.3f}".format(int((-d*c+a*f)/(a*e-b*d)*1000)/1000) for x in sys.stdin for a, b, c, d, e, f in [[int(y) for y in x.split()]] ]))

Submission status: Accepted

Solution code:
k=[]
try:
  while True:
    k.append(list(map(int,input().split())))
except EOFError:
  pass
for a,b,c,d,e,f in k:
  if f*b-c*e==0:
    x=0
  else:
    x=(f*b-c*e)/(b*d-a*e)

  if f*a-c*d==0:
    y=0
  else:
    y=(f*a-c*d)/(a*e-b*d)
  
  print("%.3f %.3f" % (x,y))