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:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy
 
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
 
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
 
 
class Matrix():
    def __init__(self, A):
        self.A = A
        self.row = len(A)
        self.col = len(A[0])
 
    def __iter__(self):
        return self.A.__iter__()
 
    def __getitem__(self, i):
        return self.A.__getitem__(i)
 
    def __add__(self, B):
        aa = self.A
        bb = B.A
        return Matrix([[aa[i][j] + bb[i][j] for j in range(self.col)] for i in range(self.row)])
 
    def __sub__(self, B):
        aa = self.A
        bb = B.A
        return Matrix([[aa[i][j] - bb[i][j] for j in range(self.col)] for i in range(self.row)])
 
    def __mul__(self, B):
        aa = self.A
        bb = B.A
        a = []
        for i in range(self.row):
            ai = aa[i]
            r = []
            for j in range(B.col):
                r.append(sum([ai[k] * bb[k][j] for k in range(self.col)]))
            a.append(r)
        return Matrix(a)
 
    def __truediv__(self, x):
        pass
 
    def lu(self):
        size = self.row
        T = copy.deepcopy(self.A)
        L = [[0]*size for _ in range(size)]
        U = [[0]*size for _ in range(size)]
        for i in range(size):
            for j in range(i,size):
                L[j][i] = T[j][i]
            for j in range(i,size):
                U[i][j] = T[i][j] / T[i][i]
            for j in range(i+1,size):
                for k in range(i+1,size):
                    T[j][k] -= L[j][i] * U[i][k]
 
        return Matrix(L),Matrix(U)
 
    def __str__(self):
        return self.A.__str__()
 
def solve_se(A, b):
    n = A.row
    L,U = A.lu()
    y = []
    for i in range(n):
        t = b[i]
        for k in range(i):
            t -= L[i][k] * y[k]
        y.append(t / L[i][i])
 
    x = [0] * n
    for i in range(n-1,-1,-1):
        t = y[i]
        for k in range(i+1,n):
            t -= U[i][k] * x[k]
        x[i] = t
    return x
 
 
def main():
    sa = [s for s in sys.stdin.read().split('\n') if s]
    r = []
    for s in sa:
        a,b,c,d,e,f = [int(c) for c in s.split()]
        A = Matrix([[a,b],[d,e]])
        B = [c,f]
        x = solve_se(A,B)
        r.append(' '.join(map(lambda t: '{:01.3f}'.format(1.0*t), x)))
 
    return '\n'.join(r)
 
print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
 
while True:
    line = sys.stdin.readline()
    if line is '':
        break
     
    (a, b, e, c, d, f) = map(float, line.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))

Submission status: Accepted

Solution code:
# AOJ 0004 Simultaneous Equation
# Python3 2018.6.9 bal4u
 
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

Submission status: Accepted

Solution code:
try:
    while(True):
        a, b, c, d, e, f = map(int, input().split())
        A = [[e/(a*e-b*d), (-1)*b/(a*e-b*d)],[(-1)*d/(a*e-b*d), a/(a*e-b*d)]]
        Y = [c, f]
        X = [(A[0][0]*Y[0] + A[0][1]*Y[1]), (A[1][0]*Y[0] + A[1][1]*Y[1])]
        for i in range(2):
            print('{:.3f}'.format(X[i]), end="")
            if i == 1:
                print("")
            else:
                print(" ", end="")
except:
    pass

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    x=round(x1/ba,4)
    if x==0:
        x=0.000
    y=round(y1/ba,4)
    if y==0:
        y=0.000
    print("{:.3f}".format(x),"{:.3f}".format(y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

EPS = 1e-10

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

Submission status: Accepted

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

    if (a*e-b*d)!=0:
      x=(c*e-f*b)/(a*e-b*d)
      if b!=0:
        y=(c-a*x)/b
      elif e!=0:
        y=(f-d*x)/e
    elif (b*d-e*a)!=0:
      y=(c*d-f*a)/(b*d-e*a)
      if a!=0:
        x=(c-b*y)/a
      elif d!=0:
        x=(f-e*y)/d
    if x==-0:
      x=x+0.0
    if y==-0:
      y=y+0.0
    print(f"{x:.3f}",f"{y:.3f}")
  except EOFError:
    break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
    a, b, c, d, e, f = [float(x) for x in line.split()]
    if a!=0 and d!=0:
        a, b, c = [x/a for x in [a, b, c]]
        d, e, f = [x/d for x in [d, e, f]]
        y = (c-f) / (b-e)
        x = c - b * y

    else:
        a, b, c = [x/b for x in [a, b, c]]
        d, e, f = [x/e for x in [d, e, f]]
        x = (c-f) / (a-d)
        y = c - a * x
    print(f'{x:.3f} {y:.3f}')

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 True:
    try:
        a, b, c, d, e, f = map(float, input().split())
        x = (e * c - f * b) / (e * a - d * b) + 0
        y = (d * c - f * a) / (d * b - e * a) + 0
        print('{0:.3f} {1:.3f}'.format(x, y))
    except EOFError:
        break

Submission status: Accepted

Solution code:
# coding: utf-8

import sys

for line in sys.stdin:
    a, b, c, d, e, f = map(float, line.strip().split())
    y = (c*d-a*f)/(b*d-a*e)
    x = (c - b*y) / a
    print("%.3lf %.3lf" % (x, y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
l=[[int(i) for i in l.split()] for l in sys.stdin]
for i in l:
    a,b,c,d,e,f=i
    x=round((c*e-b*f)/(a*e-b*d),3)
    y=round((c*d-a*f)/(b*d-a*e),3)
    if x==0:
        x=0
    if y==0:
        y=0
    print("{:.3f} {:.3f}".format(x,y))

Submission status: Accepted

Solution code:
from decimal import Decimal, ROUND_HALF_UP
while 1:
    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:
while True:
  try:
    a, b, c, d, e, f = map(float, input().split())
  except EOFError:
    break
  print("{0:.3f} {1:.3f}".format((c*e-b*f)/(a*e-b*d)+0,(c*d-a*f)/(b*d-a*e)))

Submission status: Accepted

Solution code:
try:
    while True:
        a,b,c,d,e,f=[int(i) for i in input().split(" ")]
        x=(e*c-b*f)/(a*e-b*d)
        y=(a*f-c*d)/(a*e-b*d)
        if x==0:
            x=0
        if y==0:
            y=0
        print("%.3f %.3f"%(x,y))
except EOFError:
    pass

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
	try:
		n=list(map(float, input().split()))#ファイルの読み込み --.py <--.txt
	except EOFError:
		break
	y=(n[3]*n[2]-n[0]*n[5])/(n[1]*n[3]-n[0]*n[4])
	x=(n[2]-n[1]*y)/n[0]
	print('{:.3f}'.format(x), '{:.3f}'.format(y))#format関数を用いて桁を指定

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
  a,b,c,d,e,f = [float(i) for i in line.strip().split()]

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

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

Submission status: Accepted

Solution code:
while True:
    try:
        a, b, c, d, e, f = [int(x) for x in input().split()]
        x = round((b*f - c*e)/(b*d - a*e), 3) + 0
        y = round((a*f - c*d)/(a*e - b*d), 3) + 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())
        n = a*e - b*d
        if n != 0:
            x = (c*e - b*f) / n
            y = (a*f - c*d) / n
        print('{:.3f} {:.3f}'.format(x+0, y+0))
    except:
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
EPS=0.0001
while True:
 try:
  a,b,c,d,e,f = [float(item) for item in input("").split(" ")]

  x1=(e*c-b*f)/(a*e-b*d)+EPS
  y1=(-c*d+a*f)/(a*e-b*d)+EPS

#a,b,c,d,e,f = [float(item) for item in input("").split(" ")]
#x2=(e*c-b*f)/(a*e-b*d+EPS)
#y2=(-c*d+a*f)/(a*e-b*d+EPS)

  print('{0:.3f} {1:.3f}'.format(x1,y1))
 except EOFError:
  break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    try:
        a, b, c, d, e, f = map(float, input().split())
        y = (a*f - c*d) / (a*e - b*d)
        x = (c - b*y) / a
        print ("%0.3f %0.3f" % (x, y))
    except:
        break

Submission status: Accepted

Solution code:
ss = input().split()
while ss:
	a,b,c,d,e,f = map(int, ss)
	# A = [[a,b],[d,e]]
	C = [c,f]
	detA = a*e - b*d
	if detA == 0: raise # det(A) == 0.
	At = [[e,-b],[-d,a]]
	x = sum(map((lambda x,y: x*y), At[0], C)) / detA
	y = sum(map((lambda x,y: x*y), At[1], C)) / detA
	fx,fy = '{0:.3f}'.format(x), '{0:.3f}'.format(y)
	if fx == '-0.000': fx = fx[1:]
	if fy == '-0.000': fy = fy[1:]
	print('{0} {1}'.format(fx,fy))
	try: ss = input().split()
	except EOFError: break

Submission status: Accepted

Solution code:
while True:
	try:
		data = map(float, raw_input().split())
		[a, b, c, d, e, f] = data
		
		n = (c*e - b*f)
		m = (a*f - c*d)
		i = (a*e - b*d)
		x = float(n) / (i)
		y = float(m) / (i)

		x = '%.3f' % (round(x,3))
		y = '%.3f' % (round(y,3))

		if x == '-0.000':
			x = '0.000'
		if y == '-0.000':
			y = '0.000'
			
		print x, y
	
	except EOFError:
		break

Submission status: Runtime Error

Solution code:
  (a,b,c,d,e,f)  =  map(int,input().split())
  g = (a * e)  - (b * d)
  ans1= "{0:.3f}".format((( e * c) + ( -b * f)) / g)
  ans2= "{0:.3f}".format(((-d * c) + (  a * f)) / g)
  print (ans1,ans2)

Submission status: Runtime Error

Solution code:
while True:
  (a,b,c,d,e,f)  =  map(int,input().split())
  g = (a * e)  - (b * d)
  ans= "{0:.3f}".format((( e * c) + ( -b * f)) / g + 0)
  print (ans)

Submission status: Runtime Error

Solution code:
while True:
  (a,b,c,d,e,f)  =  map(int,input().split())
  g = (a * e)  - (b * d)
  ans1= "{0:.3f}".format((( e * c) + ( -b * f)) / g + 0)
  ans2= "{0:.3f}".format(((-d * c) + (  a * f)) / g + 0)
  print (ans1,ans2)

Submission status: Runtime Error

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

        n = d/a
        a = n*a
        b = n*b
        c = n*c

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

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

Submission status: Runtime Error

Solution code:
import numpy as np

a,b,c,d,e,f = list(map(int,input().split()))
a,b,c,d,e,f = int(a),int(b),int(c),int (d),int(e),int(f)

A = np.matrix([
[a, b],
[d, e]
])
Y = np.matrix([
[c],
[f]
])
result = np.linalg.inv(A)*Y
print('{:.3f}'.format(float(result[0])), '{:.3f}'.format(float(result[1])))

Submission status: Runtime Error

Solution code:
#連立方程式
import numpy as np

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

def function(a,b,c,d,e,f):
A = np.matrix([
[a, b],
[d, e]
])
Y = np.matrix([
[c],
[f]
])
result = np.linalg.inv(A)*Y
print('{:.3f}'.format(float(result[0])), '{:.3f}'.format(float(result[1])))

Submission status: Runtime Error

Solution code:
#連立方程式
import numpy as np

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

def function(a,b,c,d,e,f):
    A = np.matrix([
    [a, b],
    [d, e]
    ])
    Y = np.matrix([
    [c],
    [f]
    ])
    result = np.linalg.inv(A)*Y
    print('{:.3f}'.format(float(result[0])), '{:.3f}'.format(float(result[1])))

Submission status: Runtime Error

Solution code:
#連立方程式
import numpy as np

def function(a,b,c,d,e,f):
    A = np.matrix([
    [a, b],
    [d, e]
    ])
    Y = np.matrix([
    [c],
    [f]
    ])
    result = np.linalg.inv(A)*Y
    print('{:.3f}'.format(float(result[0])), '{:.3f}'.format(float(result[1])))

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

Submission status: Runtime Error

Solution code:
#連立方程式 標準機能のみで
import numpy as np

def function(a,b,c,d,e,f):
    y = (c - a*f/d)/(b - a*e/d)
    x = (c - b*y)/a
    print('{:.3f}'.format(float(x)), '{:.3f}'.format(float(y)))

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

Submission status: Runtime Error

Solution code:
def function(a,b,c,d,e,f):
    y = (c - a*f/d)/(b - a*e/d)
    x = (c - b*y)/a
    print('{:.3f}'.format(float(x)), '{:.3f}'.format(float(y)))

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

Submission status: Runtime Error

Solution code:
import numpy as np

while True:
  try:
    a,b,c,d,e,f = list(map(int,input().split()))

    ume = np.array([a,b,d,e]).reshape(2,2)
    boshi = np.array([c,f]).reshape(2,1)

    answer = np.linalg.inv(ume) @ boshi
    print("%.3f %.3f" % (answer[0,0],answer[1,0]))

  except ValueError:
    break

Submission status: Runtime Error

Solution code:
import numpy as np

while True:
    try:
        a, b, c, d, e, f = map(float, input().split())
        A = [[a, b],
             [d, e]]
        
        Y = [c, f]
        X = np.linalg.solve(A, Y)
        print("{0:.3f} {1:.3f}".format(np.round(X[0], 4), np.round(X[1], 4)))

    except EOFError:
        break

Submission status: Runtime Error

Solution code:
while True:
    try:
        [a,b,c,d,e,f] = map(float,raw_input().split(' '))
        y = (c / a - f / d) / (b/a - e / d)
        x = (c - b * y) / d
        print "%0.3f %0.3f" % (x,y)
    except (EOFError):
        break

Submission status: Runtime Error

Solution code:
while True:
    try:
        [a,b,c,d,e,f] = map(float,raw_input().split(' '))
        if a == 0.0:
            if b != 0.0:
                y = c / b
                x = 0.0
            else:
                y = 0
                x = 0
        elif b == 0.0:
            if a != 0.0:
                x = c / a
                y = 0
        else:
            y = (c / a - f / d) / (b/a - e / d)
            x = (c - b * y) / d
        
        print "%0.3f %0.3f" % (x,y)
    except (EOFError):
        break

Submission status: Runtime Error

Solution code:
while True:
    try:
        [a,b,c,d,e,f] = map(float,raw_input().split(' '))
        if a == 0.0:
            if b != 0.0:
                y = c / b
                x = 0.0
            else:
                y = 0
                x = 0
        elif b == 0.0:
            if a != 0.0:
                x = c / a
                y = 0
        elif d == 0.0:
            if e != 0.0:
                y = f / e
                x = 0
            else:
                y = 0
                x = 0
        elif e == 0.0:
            if d != 0.0:
                x = f / d
                y = 0
            else:
                x =

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import numpy

for s in sys.stdin:
  d = map( int, s.split() )
  a = numpy.matrix( [ [ d[0], d[1] ], [ d[3], d[4] ] ] )
  b = numpy.matrix( [ d[2], d[5] ]).T
  c = numpy.dot(a.I,b)
  print "%.3f %.3f" % ( float(c[0][0]) , float(c[1][0]) )

Submission status: Runtime Error

Solution code:
import sys

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

Submission status: Runtime Error

Solution code:
x = y = 0.000
for i in sys.stdin():
    a, b, c, d, e, f = map(int, i.split())
    y = ((c * d) - (a * f)) / ((b * d) - (a * e))
    x = (c - (b * y)) / a
    print '{0:.3f} {1:.3f}\n'.format(x, y)

Submission status: Runtime Error

Solution code:
def test(a, b, c, d, e, f):



def check():
	while True:
		sides = map(int, raw_input().split())
		



if __name__ == "__main__":
	# check()
	print test(1, 2, 3, 4, 5, 5)

Submission status: Runtime Error

Solution code:
def test(a, b, c, d, e, f):



def check():
	while True:
		try:
			sides = map(int, raw_input().split())	
		except Exception, e:
			break
		
		



if __name__ == "__main__":
	# check()
	print test(1, 2, 3, 4, 5, 5)

Submission status: Runtime Error

Solution code:
def test(a, b, c, d, e, f):



def check():
	while True:
		try:
			sides = map(int, raw_input().split())	
		except Exception, e:
			break
		
		



if __name__ == "__main__":
	check()
	# print test(1, 2, 3, 4, 5, 5)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys


def Print(array):
    for r in range(len(array)):
        print(array[r])
    print()


def Gauss(array):
    # for r in range(len(array)):
    #     array[r].append(r)      # 繝斐?繝?ヨ驕ク謚槭＠縺溷セ? 譛?セ後↓謌サ縺吶◆繧√?繝槭?繧ォ繝シ

    for r in range(len(array)):  # 蜑埼?豸亥悉
        # array.sort(key=lambda x: x[r], reverse=True)  # 繝斐?繝?ヨ
        div = array[r][r]
        for c in range(r, len(array) + 1):  # 迴セ蝨ィ縺ョ陦後?蜈磯?縺?縺ォ縺ェ繧九ｈ縺?↓蜑イ繧?            array[r][c] /= div
        for r2 in range(r + 1, len(array)):      # 迴セ蝨ィ縺ョ陦後ｈ繧贋ク九?陦後?蜈磯?繧?縺ォ縺吶ｋ
            head = array[r2][r]
            for c in range(r, len(array) + 1):
                array[r2][c] -= head * array[r][c]

    result = [0] * len(array)
    for r in range(len(array) - 1, -1, -1):  # 蠕碁?莉」蜈・
        result[r] = array[r][
            len(array)] - sum([result[x] * array[r][x] for x in range(r + 1, len(array))])
    return result


for line in sys.stdin:
    [a, b, c, d, e, f] = [int(x) for x in line.split()]
    result = Gauss([[a, b, c], [d, e, f]])
    for i in range(len(result) - 1):
        print("{0:.3f}".format(result[i]), end=" ")
    print("{0:.3f}".format(result[-1]))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys


def Print(array):
    for r in range(len(array)):
        print(array[r])
    print()


def Gauss(array):
    for r in range(len(array)):
        array[r].append(r)      # 繝斐?繝?ヨ驕ク謚槭＠縺溷セ? 譛?セ後↓謌サ縺吶◆繧√?繝槭?繧ォ繝シ

    for r in range(len(array)):  # 蜑埼?豸亥悉
        array.sort(key=lambda x: x[r], reverse=True)  # 繝斐?繝?ヨ
        div = array[r][r]
        for c in range(r, len(array) + 1):  # 迴セ蝨ィ縺ョ陦後?蜈磯?縺?縺ォ縺ェ繧九ｈ縺?↓蜑イ繧?            array[r][c] /= div
        for r2 in range(r + 1, len(array)):      # 迴セ蝨ィ縺ョ陦後ｈ繧贋ク九?陦後?蜈磯?繧?縺ォ縺吶ｋ
            head = array[r2][r]
            for c in range(r, len(array) + 1):
                array[r2][c] -= head * array[r][c]

    result = [0] * len(array)
    for r in range(len(array) - 1, -1, -1):  # 蠕碁?莉」蜈・
        result[r] = array[r][
            len(array)] - sum([result[x] * array[r][x] for x in range(r + 1, len(array))])
    return result


for line in sys.stdin:
    [a, b, c, d, e, f] = [int(x) for x in line.split()]
    result = Gauss([[a, b, c], [d, e, f]])
    for i in range(len(result) - 1):
        print("{0:.3f}".format(result[i]), end=" ")
    print("{0:.3f}".format(result[-1]))

Submission status: Runtime Error

Solution code:
while True:
    a,b,c,d,e,f = map(int,raw_input().split())
    x = 0.; y = 0.
    delta = abs(a*e-b*d)
    x = float((e*c-b*f)/delta)
    y = float((a*f-d*c)/delta)

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

Submission status: Runtime Error

Solution code:
# coding: UTF-8
while True:
    num = map(float,raw_input().split())
    x = (num[2]*num[4] - num[1]*num[5]) / (num[0]*num[4] - num[1]*num[3])
    y = (num[5]*num[0]-num[2]*num[3]) / (num[0]*num[4]-num[3]*num[1])

    print "%0.3f %0.3f"%(x,y)

Submission status: Runtime Error

Solution code:
import sys
for line in sys.stdin:
    num = map(float,raw_input().split())
    x = (num[2]*num[4] - num[1]*num[5]) / (num[0]*num[4] - num[1]*num[3])
    y = (num[5]*num[0]-num[2]*num[3]) / (num[0]*num[4]-num[3]*num[1])
    print "%0.3f %0.3f"%(x,y)

Submission status: Runtime Error

Solution code:
import sys
line = sys.stdin.read().splitlines()
for line in len(line):
    num = map(float,raw_input().split())
    x = (num[2]*num[4] - num[1]*num[5]) / (num[0]*num[4] - num[1]*num[3])
    y = (num[5]*num[0]-num[2]*num[3]) / (num[0]*num[4]-num[3]*num[1])
    print "%0.3f %0.3f"%(x,y)

Submission status: Runtime Error

Solution code:
import sys
for line in sys.stdin.readlines():
    num = map(float, line.strip().split())
    x = (num[2]*num[4] - num[1]*num[5]) / (num[0]*num[4] - num[1]*num[3])
    y = (num[5]*num[0]-num[2]*num[3]) / (num[0]*num[4]-num[3]*num[1])
    out.append( "%0.3f %0.3f"%(x,y))
for i in xrange(len(out)):
    print out[i]

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    a, b, c, d, e, f = map(float, input().split())
    tmp = a/d
    y = (c - tmp*f)/(b - tmp*e)
    x = (c - b*y)/a
    x = round(x)
    y = round(y)
    print('%.3f %.3f' % (x, y))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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 - d*c) / (a*e - b*d)
        print('{:.3f} {:.3f}'.format(x+0, y+0)
    except:
        break

Submission status: Runtime Error

Solution code:
import sys
from numpy import *
from numpy.linalg import *

for v in sys.stdin:
    a,b,c,d,e,f = map(int, v.split())
    x = array([[a,b], [d,e]])
    y = array([c,f])
    res = solve(x, y)
    print res

Submission status: Runtime Error

Solution code:
import sys
from numpy import *
from numpy.linalg import *

while True:
    try:
        a,b,c,d,e,f = map(int, raw_input().split())
        x = array([[a,b], [d,e]])
        y = array([c,f])
        res = solve(x, y)
        print res
    except EOFError:
        break

Submission status: Runtime Error

Solution code:
import sys
from numpy import *
from numpy.linalg import *

while True:
    try:
        a,b,c,d,e,f = map(int, raw_input().split())
        x = array([[a,b], [d,e]])
        y = array([c,f])
        res = solve(x, y)
        print res[0], res[1]
    except EOFError:
        break

Submission status: Runtime Error

Solution code:
import math
while True:
    try:
        line=input()

    except:
        break

    a,b,c,d,e,f=map(int, line.strip().split())

    z=a*e-b*d
    if z==0:
        break

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

    print(round(x,3) round(y,3))

Submission status: Runtime Error

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
    
    if z!==0:  
        y=(c*d-f*a)/(b*d-a*e)
        x=(c*e-f*b)/(a*e-b*d)
        print('{:.3f} {:.3f}'.format(x,y))

Submission status: Runtime Error

Solution code:
hile True:
    try:
        line=input()

    except:
        break

    a,b,c,d,e,f=map(int, line.strip().split())

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

    if x<=0 and x>=-0.0005:
        x=0
    
    if y<=0 and y>=-0.0005:
        y=0
        
    print('{:.3f} {:.3f}'.format(x,y))

Submission status: Runtime Error

Solution code:
while(check):
    line = raw_input()
    s = line.rstrip().split()
    for i in range(6):
        s[i] = int(s[i])
    print (s[2]*s[4] - s[1]*s[5])/(s[0]*s[4] - s[1]*s[3]), (s[1]*s[5] - s[3]*s[2]) / (s[0]*s[4] - s[1]*s[3])

Submission status: Runtime Error

Solution code:
while(True):
    line = raw_input()
    s = line.rstrip().split()
    for i in range(6):
        s[i] = int(s[i])
    print (s[2]*s[4] - s[1]*s[5])/(s[0]*s[4] - s[1]*s[3]), (s[1]*s[5] - s[3]*s[2]) / (s[0]*s[4] - s[1]*s[3])

Submission status: Runtime Error

Solution code:
while(True):
    line = input()
    s = line.rstrip().split()
    for i in range(6):
        s[i] = int(s[i])
    print (s[2]*s[4] - s[1]*s[5])/(s[0]*s[4] - s[1]*s[3]), (s[1]*s[5] - s[3]*s[2]) / (s[0]*s[4] - s[1]*s[3])

Submission status: Runtime Error

Solution code:
from numpy import *
from numpy.linalg import *

while True:
    try:
        a = map(int,raw_input().split())
        b = array([[a[0],a[1]],[a[3],a[4]]])
        c = array([a[2],a[5]])
        x = solve(b,c)
        print "%.4f %.4f" % (x[0],x[1])
    except:
        break

Submission status: Runtime Error

Solution code:
from numpy import *
from numpy.linalg import *

while True:
    try:
        a = map(int,raw_input().split())
        b = array([[a[0],a[1]],[a[3],a[4]]])
        c = array([a[2],a[5]])
        x = solve(b,c)
        print "%.4f %.4f" % (x[0],x[1])
    except EOFError:
        break

Submission status: Runtime Error

Solution code:
import sys
from decimal import Decimal

def main():
    for input_line in sys.stdin:
        input_line = raw_input()
        x1 = int(input_line.split(' ')[0])
        y1 = int(input_line.split(' ')[1])
        p = int(input_line.split(' ')[2])
        x2 = int(input_line.split(' ')[3])
        y2 = int(input_line.split(' ')[4])
        q = int(input_line.split(' ')[5])
        multiplicand1, multiplicand2 = calculate1(x1, x2)
        after_y1, after_y2, after_p, after_q = calculate2(y1, y2, p, q, multiplicand1, multiplicand2)
        calculate3(after_y1, after_y2, after_p, after_q, x1, y1, p)
    
def calculate1(x1, x2):
    if (x1 >= 0 and x2 >= 0) or (x1 < 0 and x2 < 0):
        multiplicand1 = -x2
        multiplicand2 = x1
        return multiplicand1, multiplicand2
    else:
        multiplicand1 = abs(x2)
        multiplicand2 = abs(x1)
        return multiplicand1, multiplicand2
    
def calculate2(y1, y2, p, q, multiplicand1, multiplicand2):
    after_y1 = y1 * multiplicand1
    after_y2 = y2 * multiplicand2
    after_p = p * multiplicand1
    after_q = q * multiplicand2
    return after_y1, after_y2, after_p, after_q

def calculate3(after_y1, after_y2, after_p, after_q, x1, y1, p):
    y = Decimal(after_p + after_q) / Decimal(after_y1 + after_y2)
    x = Decimal(p - y1 * y) / Decimal(x1)
    print('%.4f %.4f' % (x, y))
    
if __name__ == '__main__':
    main()