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: 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('%.3f %.3f' % (x, y))
    
if __name__ == '__main__':
    main()

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)
    y = round(y, 3)
    x = Decimal(p - y1 * y) / Decimal(x1)
    x = round(x, 3)
    print('%.3f %.3f' % (x, y))
    
if __name__ == '__main__':
    main()

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 = Decimal(y1 * multiplicand1)
    after_y2 = Decimal(y2 * multiplicand2)
    after_p = Decimal(p * multiplicand1)
    after_q = Decimal(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)
    y = round(y, 3)
    x = Decimal(p - y1 * y) / Decimal(x1)
    x = round(x, 3)
    print('%.3f %.3f' % (x, y))
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

for line in sys.stdin:
	a, b, c, d, e, f = map(float, line.split())
	A = np.array([[a,b],[d,e]])
	B = np.array([c,f])

	x=np.linalg.solve(A,B)

	print "{0:.3f}".format(round(x[0],3)), "{0:.3f}".format(round(x[1],3))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

for line in sys.stdin:
	a, b, c, d, e, f = map(float, line.split())

	x = (c/b-f/e)/(a/b-d/e)
	y = (c/a-f/d)/(b/a-e/d)
	print "{0:.3f}".format(round(x,3)), "{0:.3f}".format(round(y,3))

Submission status: Runtime Error

Solution code:
from sympy import *

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

x, y = symbols('x y')

# ax + by = c
# dx + ey = f
res = solve((a*x+b*y - c , d*x+e*y - f), x, y)
x = res[x]
y = res[y]
x = float(str(x))
y = float(str(y))
print "%.3f %.3f" % (x, y)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

Submission status: Runtime Error

Solution code:
aaa

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy

Submission status: Runtime Error

Solution code:
import numpy
while True:
    try:
        a,b,c,d,e,f = (int(i) for i in input().split())
        x,y = [numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[0],numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[1]]
        print("{0:.3f} {1:.3f}".format(x,y))
    except EOFError:
        break

Submission status: Runtime Error

Solution code:
import numpy
while True:
    try:
        a,b,c,d,e,f = (int(i) for i in input().split())
        #x,y = [numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[0],numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[1]]
        #print("{0:.3f} {1:.3f}".format(x,y))
    except EOFError:
        break

Submission status: Runtime Error

Solution code:
import numpy
#while True:
#   try:
#        a,b,c,d,e,f = (int(i) for i in input().split())
#        x,y = [numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[0],numpy.dot(numpy.linalg.inv(numpy.array([[a,b],[d,e]])),numpy.array([c,f]))[1]]
#        print("{0:.3f} {1:.3f}".format(x,y))
#    except EOFError:
#        break

Submission status: Runtime Error

Solution code:
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=(f-d*x)/e
    print "{0:.3f} {1:.3f}".format(x, y)

Submission status: Runtime Error

Solution code:
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=(f-d*x)/e
    print "%.3f %.3f"%(x,y)

Submission status: Runtime Error

Solution code:
import sys

#inputNum = sys.stdin.readlines()[:-1]
inputNum = open('sample.txt', 'r')

for i in inputNum:
    new = []
    n = i[:-1].split(' ', 6)
    for s in n:
        new.append(float(s))
    k = new[0]
    q = 0
    for a in new[0:3]:
        new[q] = a/k
        q = q + 1
    l = new[3]
    for a in new[3:6]:
        new[q] = a - l*new[q-3]
        q = q + 1
    if new[4] == 0:
        y = new[5]
    else:
        y = new[5]/new[4]
    x = new[2]-(new[1]*y)
    print("{0:.3f}".format(x),"{0:.3f}".format(y))

Submission status: Runtime Error

Solution code:
import sys
import time
def anscheck(x,y,d,e,f):
    print "%.3f %.3f %.3f %.3f %.3f"%(x,y,d,e,f)
    time.sleep(1)
    if d*x+e*y == f:
        # print "correct!"
        print "%.3f %.3f"%(x,y)
        return True
    else:
        # print "different"
        return False
for line in sys.stdin:
    a,b,c,d,e,f = map(float,line.split())
    i=0
    while True:
        if (a*i-c) % b ==0:
            x=i
            if a*i-c>0:
                y= -((a*i-c)/b)
            elif a*i-c<0:
                y= (a*i-c)/b
            else:
                y=0
            if anscheck(x,y,d,e,f):
                break
        # if b*i-c % a == 0:
        #     x=i
        #     if b*i>c:
        #         y= -(b*i-c)/a
        #     elif b*i<c:
        #         y= (b*i-c)/a
        #     else:
        #         pass
        #     anscheck(x,y,d,e,f)
        if (a*(-i)-c) % b ==0:
            x=-i
            if a*(-i)-c > 0:
                y= (a*(-i)-c)/b
            elif a*(-i)-c<0:
                y= -((a*(-i)-c)/b)
            else:
                y=0
            if anscheck(x,y,d,e,f):
                break
        # if b*(-i)-c % a ==0:
        #     x=-i
        #     if b*(-i)>c:
        #         y= -(b*(-i)-c)/a
        #     elif b*(-i)<c:
        #         y= (b*(-i)-c)/a
        #     else:
        #         pass
        #     anscheck(x,y,d,e,f)
        i+=1.0

Submission status: Runtime Error

Solution code:
hoe

Submission status: Runtime Error

Solution code:
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    x=(c-b*f/e)/(a-b*d/e)
    y=(c-a*f/d)/(b-a*e/d)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))
    
for i in range(len(ans)):
    print('{0:.4f} {1:.4f}' .format(*ans[i]))

Submission status: Runtime Error

Solution code:
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    x=(c-b*f/e)/(a-b*d/e)
    y=(c-a*f/d)/(b-a*e/d)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))
    
for i in range(len(ans)):
    print('{0:.3f} {1:.3f}' .format(*ans[i]))

Submission status: Runtime Error

Solution code:
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    x=round((c-b*f/e)/(a-b*d/e),3)
    y=round((c-a*f/d)/(b-a*e/d),3)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))

for i in range(len(ans)):
    print('{0:.3f} {1:.3f}'.format(*ans[i]))

Submission status: Runtime Error

Solution code:
while 1:
    i = input().split()
    if i ==0:
        break
    else:
        a, b, c, d, e, f = map(float, i)
        x = (e*c - b*f)/(e*a - b*d)
        y = (c*d - f*a)/(d*b - e *a)

        print(x,y)

Submission status: Runtime Error

Solution code:
while 1:
    i = input().split()
    if i == []:
        break
    else:
        a, b, c, d, e, f = map(float, i)
        x = (e*c - b*f)/(e*a - b*d)
        y = (c*d - f*a)/(d*b - e *a)

        print(x,y)

Submission status: Runtime Error

Solution code:
while 1:
    i = input().split()
    if i == None:
        break
    else:
        a, b, c, d, e, f = map(float, i)
        x = (e*c - b*f)/(e*a - b*d)
        y = (c*d - f*a)/(d*b - e *a)

        print(x,y)

Submission status: Runtime Error

Solution code:
while 1:
    i = input()
    if i == None:
        break
    else:
        a, b, c, d, e, f = map(float, i.split())
        x = (e*c - b*f)/(e*a - b*d)
        y = (c*d - f*a)/(d*b - e *a)

        print(x,y)

Submission status: Runtime Error

Solution code:
while 1:
    a, b, c, d, e, f = map(float, i)
    x = (e*c - b*f)/(e*a - b*d)
    y = (c*d - f*a)/(d*b - e *a)
    print(x,y)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    a,b,c,d,e,f= map(int,line .split())
    z=a*e-b*d
    if(z!=0):
        x=(c*e-b*f)/z
        y=(a*f-c*d)/z
    print("{0:.3f} {1:.3f)".format(x+0,y+0))

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    a,b,c,d,e,f= map(int,line.split())
    z=a*e-b*d
    if(z!=0):
        x=(c*e-b*f)/z
        y=(a*f-c*d)/z
    print("{0:.3f} {1:.3f)".format(x+0,y+0))

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    a,b,c,d,e,f= map(int,line.split(" "))
    z=a*e-b*d
    if(z!=0):
        x=(c*e-b*f)/z
        y=(a*f-c*d)/z
    print("{0:.3f} {1:.3f)".format(x+0,y+0))

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    a,b,c,d,e,f= map(int,line.split())
    z=a*e-b*d
    if(z!=0):
        x=(c*e-b*f)/z
        y=(a*f-c*d)/z
    print("{0:.3f} {1:.3f)".format(x+0, y+0))

Submission status: Runtime Error

Solution code:
import sys

for line sys.stdin:
    a,b,c,d,e,f = map(int, line.split())
    z = a * e - b * c
    if z != 0
        x=(c*e-b*f)/z
        y=(a*f-c*d)/z
    print("{0:.3f} {1:.3f}".format(x+0,y+0)

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    a,b,c,d,e,f= map(int,line.split())
    det=a*e-b*d
    if(det!=0):
        x=(c*e-b*f)/det
        y=(a*f-c*d)/det
    print("{0:.3f} {1:.3f)".format(x+0, y+0))

Submission status: Runtime Error

Solution code:
while True:
	try:
		A=[int(j) for j in input().split()]
		a=A[3]/A[0]
		for i in range(3):
			A[i]*=a
		for i in range(3):
			A[i]=A[i]-A[i+3]
		y=A[2]/A[1]
		x=(A[5]-A[4]*y)/A[3]
		print(x,y)
	except EOFError:
		break

Submission status: Runtime Error

Solution code:
while True:
	try:
		A=[int(j) for j in input().split()]
		a=A[3]/A[0]
		for i in range(3):
			A[i]*=a
		for i in range(3):
			A[i]=A[i]-A[i+3]
		y=A[2]/A[1]
		x=(A[5]-A[4]*y)/A[3]
		print("%f %f"%(x+0,y+0))
	except EOFError:
		break

Submission status: Runtime Error

Solution code:
import numpy as np
import sys

for i in sys.stdin:
    a,b,c,d,e,f = map(float, i.split())
    A = np.array([[ a, b],
        [ d, e]])
    B = np.array([c,f])
    X = np.linalg.solve(A,B)
    print "{0:.3f}".format(X[0]),"{0:.3f}".format(X[1])

Submission status: Runtime Error

Solution code:

import numpy as np
import sys

for i in sys.stdin:
    a,b,c,d,e,f = map(float, i.split())
    A = np.array([[ a, b],
        [ d, e]])
    B = np.array([c,f])
    X = np.linalg.solve(A,B)
    print "{0:.3f}".format(X[0]),"{0:.3f}".format(X[1])

Submission status: Runtime Error

Solution code:

import numpy as np
import sys

printf = sys.stdout.write

for i in sys.stdin:
    try:
        a,b,c,d,e,f = map(float, i.split())
    except:
        printf(i)
        break

    A = np.array([[ a, b],
        [ d, e]])
    B = np.array([c,f])
    X = np.linalg.solve(A,B)
    print "{0:.3f}".format(X[0]),"{0:.3f}".format(X[1])

Submission status: Runtime Error

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

import sys

for i in sys.stdin:
    a, b, c, d, e, f = map(int, line.split())
    print "%f %f" %((d*c-a*f)/(b*d-a*e), (b*f-c*e)/(b*d-a*e))

Submission status: Runtime Error

Solution code:
import itertools
import operator

dataset = []
while True:
    try:
        dataset.append(input())
    except EOFError:
        break

for item in dataset:
    a, b, c, d, e, f = [int(i) for i in item.split()]
    e = e * (a/d)
    f = f * (a/d)

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

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

Submission status: Runtime Error

Solution code:
dataset = []
while True:
    try:
        dataset.append(input())
    except EOFError:
        break

for item in dataset:
    a, b, c, d, e, f = [int(i) for i in item.split()]
    e = e * (a/d)
    f = f * (a/d)

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

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

Submission status: Runtime Error

Solution code:
import itertools
import operator

dataset = []
while True:
    try:
        dataset.append(input())
    except EOFError:
        break

for item in dataset:
    try:
        a, b, c, d, e, f = [int(i) for i in item.split()]
    except:
        print("dataset cannot to be converted")
        break

    e = e * (a/d)
    f = f * (a/d)

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

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

Submission status: Runtime Error

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

for item in dataset:
    a, b, c, d, e, f = list(map(int, item.split()))
    k1 = e * (a/d)
    k2 = f * (a/d)

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

Submission status: Runtime Error

Solution code:
while 1:
    a,b,c,d,e,f = map(int,raw_input().split())
    i = d/a
    j = i*b-e
    k = i*c-f
    y = float(k/j)
    x = float(c-b*y)/a
    print "%.3f %.3f"%(x,y)

Submission status: Runtime Error

Solution code:
while 1:
    a,b,c,d,e,f = map(float,raw_input().split())
    i = d/a
    j = i*b-e
    k = i*c-f
    y = float(k/j)
    x = float(c-b*y)/a
    print "%.3f %.3f"%(x,y)

Submission status: Runtime Error

Solution code:
mport sys

for i in sys.stdin.readlines():
    a, b, c, d, e, f = [int(x) for x in 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:
for i in range(2):
  inl=map(int, raw_input().split())
  x=(int[2]*int[4]-int[5]*int[1])/(int[0]*int[4]-int[3]*int[1])+0.000
  y=(int[2]*int[3]-int[5]*int[0])/(int[1]*int[3]-int[4]*int[0])+0.000
  print x,y

Submission status: Runtime Error

Solution code:
for line in sys.stdin:
    array = [float(x) for x in line.split()]
    ar1 = array[0:3]
    ar2 = array[3:]
    i = ar1[0]
    ar1 = [x*ar2[0] for x in ar1]
    ar2 = [x*i for x in ar2]
    y = (ar1[2] - ar2[2])/(ar1[1]-ar2[1])
    ar1 = array[0:3]
    x = (ar1[2]-ar1[1]*y)/ar1[0]
    print('%.3f %.3f' % (round(x,3), round(y,3)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def gcd(a,b):
 if b==0:
  return a
 return gcd(b,a%b)

while True:
 try:
  a,b=[int(i) for i in input().split()]
  print(gcd(a,b),a*b/gcd(a,b))
 except EOFError:
  break

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    a,b,c,d,e,f = [float(w) for w in line.split()]
    
    print("{:.3f} {:.3f}".format((e*c-b*f)/(a*e-a*b), (d*c-a*f)/(b*d-a*e)))

Submission status: Runtime Error

Solution code:
while True:
	try:
		s=input().split()
	except:
		break
	a,b,c,d,e,f=int(s[0]),int(s[1]),int(s[2]),int(s[3]),int(s[4]),int(s[5])
	
	x=round((ce-bf)/(ae-db),3)
	y=round((cd-fa)/(bd-ea),3)
	print("%d %d",x,y)

Submission status: Runtime Error

Solution code:
[print("{0:.3f} {1:.3f}".format((k[2] - k[1] * ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3]))) / k[0], ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3])))) for i in sys.stdin for k in [[int(j) for j in i.split()]]]

Submission status: Runtime Error

Solution code:
[print("{0:.3f} {1:.3f}".format(
	(k[2] - k[1] * ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3]))) / k[0],
	((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3])))
) for i in sys.stdin for k in [int(j) for j in i.split()]]

Submission status: Runtime Error

Solution code:
[print("{0:.3f} {1:.3f}".format((k[2] - k[1] * ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3]))) / k[0], ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3])))) for i in sys.stdin for k in [[int(float(j)) for j in i.split()]]]

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
	a, b, c, d, e, f = map(int, input().split())
	if b == 0:
		x = c / a
		y = (f - d * x) / e
	elif e == 0:
		x = f / d
		y = (c - a * x) / b
	else:
		x = (c * e - f * b) / (a * e - d * b)
		y = (f - d * x) / e
	print(x, end=" ")
	print(y)

Submission status: Runtime Error

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

    except:
        return

Submission status: Runtime Error

Solution code:
import sys 

for line in sys.stdin():
    [a,b,e,c,d,f] = [int(x) for x in line.split()]
    delta = a*d-b*c
    x = (d*e-b*f)/delta
    y = (-e*c+a*f)/delta
    print x,y

Submission status: Runtime Error

Solution code:
#coding: utf-8

import sys

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

Submission status: Runtime Error

Solution code:
for line in sys.stdin:
    l = (map(float,line.split()))
    a = l[0]
    b = 1[1]
    c = l[2]
    d = 1[3]
    e = l[4]
    f = 1[5]
    x = float(c*e - b*f) / float(a*e - b*d)
    y = float(c*d - a*f) / float(b*d - a*e)
    print "%.3f" %x , "%.3f" %y

Submission status: Runtime Error

Solution code:
#coding: utf-8

import sys

for line in sys.stdin:
    l = (map(float,line.split()))
    a = l[0]
    b = 1[1]
    c = l[2]
    d = 1[3]
    e = l[4]
    f = 1[5]
    x = float(c*e - b*f) / float(a*e - b*d)
    y = float(c*d - a*f) / float(b*d - a*e)
    print "%.3f" %x , "%.3f" %y

Submission status: Runtime Error

Solution code:
def jisuan(lis):
    ns = lis.split(" ")
    for i in range(6):
        ns[i] = float(ns[i])
    a, b, c, d, e, f = ns[0], ns[1], ns[2], ns[3], ns[4], ns[5]
    x = (c * e - b * f) / (a * e - b * d)
    y = (c * d - a * f) / (b * d - a * e)
    return [x, y]


inpu = input()
nums = inpu.split("\n")
for l in len(nums):
    k0 = jisuan("1 2 3 4 5 6")[0]
    k1 = jisuan("1 2 3 4 5 6")[1]
    print("%.3f" % k0, "%.3f" % k1)

Submission status: Runtime Error

Solution code:
ini=map(int, raw_input()split())

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

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

xxx=('%4.3f' % xx)
yyy=('%4.3f' % yy)

print xxx,yyy

Submission status: Runtime Error

Solution code:
 #_*_ coding:utf-8 _*_
  2 import sys
  3 
  4 
  5 while True:
  6     vals = sys.stdin.readline()
  7     if(vals is  None or vals.strip() == '' ):
  8         break
  9     a,b,c,d,e,f=list( map(float,vals.strip().split()))
 10     temp = a * e - d * b
 11     print(temp)
 12     x = (c * e - b * f) / temp + 0.0
 13     y = (c * d - a * f) / -temp + 0.0
 14     print('%.3f %.3f' % (x,y))
 15

Submission status: Runtime Error

Solution code:
 #_*_ coding:utf-8 _*_
   import sys
  
   
  while True:
      vals = sys.stdin.readline()
      if(vals is  None or vals.strip() == '' ):
           break
      a,b,c,d,e,f=list( map(float,vals.strip().split()))
      temp = a * e - d * b
      print(temp)
      x = (c * e - b * f) / temp + 0.0
      y = (c * d - a * f) / -temp + 0.0
      print('%.3f %.3f' % (x,y))

Submission status: Runtime Error

Solution code:
import sys
from sympy import *

for s in sys.stdin:
    a,b,c,d,e,f = map(int, s.split())
    x, y = symbols('x y')
    init_printing()
    solve([a*x + b*y - c],[d*x + e*y - f])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time
import numpy as np

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


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(x) for x in s.split()]
        A = np.matrix([[a,b],[d,e]])
        B = np.array([c,f])
        AT = np.linalg.inv(A)
        x = np.dot(AT, B)
        r.append('{:01.3f} {:01.3f}'.format(x[0,0], x[0,1]))
    return '\n'.join(r)

print(main())

Submission status: Runtime Error

Solution code:
import math

l = map(float, raw_input().split())
# adjusting d to a
a = l[0]/l[3]
l[3] = a * l[3]
l[4] = a * l[4]
l[5] = a * l[5]

# calculating y
y_1 = l[1] - l[4]
y_2 = l[2] - l[5]

y_answer = y_2/y_1

# calculatiing x

x_answer = (l[2] - l[1] * y_answer)/l[0]

x_answer = round(x_answer)
y_answer = round(y_answer)

print "%f %f" % (x_answer, y_answer)

Submission status: Runtime Error

Solution code:
import sys

a = []

for line in sys.stdin:
    a.append(map(float, raw_input().strip()))

for i in range(a):
    # adjusting d to a
    a = l[i][0]/l[i][3]
    l[i][3] = a * l[3]
    l[i][4] = a * l[4]
    l[5] = a * l[5]

    # calculating y
    y_1 = l[i][1] - l[i][4]
    y_2 = l[i][2] - l[i][5]

    y_answer = y_2/y_1

    # calculatiing x

    x_answer = (l[i][2] - l[i][1] * y_answer)/l[i][0]

    x_answer = round(x_answer)
    y_answer = round(y_answer)

    print "%3f %3f" % (x_answer, y_answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
for line in sys.stdin:
	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)
	print('{0:.3f} {1:.3f}'.format(x, y))

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
	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)
	print('{0:.3f} {1:.3f}'.format(x, y))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

for line in sys.stdin:
    a11,a12,b1,a21,a22,b2 = list(map(int, line.split()))

    A=np.array([[a11,a12],[a21,a22]])
    B=np.array([b1,b2])

    x,y=np.linalg.solve(A,B)
    
    print("{0:.3f} {1:.3f}".format(x,y))

Submission status: Runtime Error

Solution code:
import sys

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

Submission status: Runtime Error

Solution code:
from numpy.linalg import solve 

a,b,c,d,e,f=map(int,input(),split())
A=[[1.,2],[4,5]]
B=[3,6]
xy=solve(A,B)
print(xy)