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 numpy as np
while True:
    a,b,c,d,e,f = map(int, input().split())
    ls1 = [[a,b],[d,e]]
    ls2 = [c,f]
    x,y = np.linalg.solve(ls1,ls2)
    print("{0:.4f} {1:.4f}".format(x,y))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
for line in sys.stdin.readlines()
	a,b,c,d,e,f = [int(s) for s in line.split()]
	x = (c*e-b*f) / (a*e-b*d)
	y = (c*d-a*f) / (b*d-a*e)
	print('{0:.3f} {1:.3f}'.format(x,y))

Submission status: Runtime Error

Solution code:
'''
ax + by = c
dx + ey = f

x = ( c - b * y ) / a
x = ( f - e * y ) / d
'''
while True:
	s = input().split()

	try:
		a = int(s[0])
		b = int(s[1])
		c = int(s[2])
		d = int(s[3])
		e = int(s[4])
		f = int(s[5])
	except:
		break

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

Submission status: Runtime Error

Solution code:
'''
'''
ax + by = c
dx + ey = f

x = ( c - b * y ) / a
x = ( f - e * y ) / d
'''
while True:
	s = input().split()

	try:
		a = int(s[0])
		b = int(s[1])
		c = int(s[2])
		d = int(s[3])
		e = int(s[4])
		f = int(s[5])
	except:
		break

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

Submission status: Runtime Error

Solution code:
while True:
	s = input().split()

	try:
		a = int(s[0])
		b = int(s[1])
		c = int(s[2])
		d = int(s[3])
		e = int(s[4])
		f = int(s[5])
	except:
		break

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
import sys

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

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

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

Submission status: Runtime Error

Solution code:
import sys

a = []

for line in sys.stdin:
    a.append(line)

for s in a:
	a, b, c, d, e, f = map(int, a.split())

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

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

Submission status: Runtime Error

Solution code:
import sys

strs = []

for line in sys.stdin:
    strs.append(line)

for s in strs:
	a, b, c, d, e, f = map(int, s.split())

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

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

Submission status: Runtime Error

Solution code:

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

SimultaneousEquation()

Submission status: Runtime Error

Solution code:
try:
    while True:
        a,b,c,d,e,f=map(int, input().split())
        print( (c*e-b*f)/)a*e-b*d), (a*f-c*d)/(a*e-b*d))
except EOFError:
    pass

Submission status: Runtime Error

Solution code:
answers=[]
while True:
    try:
        numbers=input().split()
        for i in range(6):
            numbers[i]=float(numbers[i])
        times=numbers[0]/numbers[3]
        numbers[3]=numbers[3]*times
        numbers[4]=numbers[4]*times
        numbers[5]=numbers[5]*times
        y=(numbers[2]-numbers[5])/(numbers[1]-numbers[4])
        x=(numbers[2]-numbers[1]*y)/numbers[0]
        answers.append(x)
        answers.append(y)
    except:
        break

for i in range(len(answers)/2):
    print(answers[i*2],answers[i*2+1])

Submission status: Runtime Error

Solution code:
1
2
3
4
5
6
7
import 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:

import 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:
import 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:
import sys
for line in sys.stdin:
    a,b,c,d,e,f = map(int, line.split())
    y = (c/a - f/d)/(b/a - e/d)
    x = -(e/d) * y + (f/d)
    print("{:.3f} {:.3f}".format(x, y))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

a = []

for line in sys.stdin:
    a.append(str(line))
for i in line:
    b = i.split()
    b = map(float, b)

    b_a = b[0]
    b_d = b[3]

    tmp_for_calc = b_a/b_d
    b_e = b[4] * tmp_for_calc
    b_f = b[5] * tmp_for_calc

    x = (b[2] - b_f)/(b[1] - b_e)

    y = (b[2] - b[1] * x)/b[0]

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

Submission status: Runtime Error

Solution code:

def get_input():
    while True:
        try:
            yield ''.join(raw_input())
        except EOFError:
            break

if __name__ == '__main__':
    a = list(get_input()) # [a1, a2, a3, ...]

    for i in a:
        b = i.split()
        b = map(float, b)

        b_a = b[0]
        b_b = b[1]
        b_c = b[2]
        b_d = b[3]
        b_e - b[4]
        b_f = b[5]

        b_d = b_a
        b_e = b_a/b_d * b_e
        b_f = b_a/b_d * b_f

        x = (b_c - b_f)/(b_b - b_e)

        y = (b_c - x * b_b)/b_a

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

Submission status: Runtime Error

Solution code:
import fileinput

if __name__ == '__main__':

    for i in fileinput.input():
        a.append(i)
    
    for i in a:
        b = i.split()
        b = map(float, b)

        b_a = b[0]
        b_b = b[1]
        b_c = b[2]
        b_d = b[3]
        b_e - b[4]
        b_f = b[5]
 
        b_d = b_a
        b_e = b_a/b_d * b_e
        b_f = b_a/b_d * b_f

        x = (b_c - b_f)/(b_b - b_e)

        y = (b_c - x * b_b)/b_a 

        print round(x, 3)

Submission status: Runtime Error

Solution code:
import fileinput

if __name__ == '__main__':

    for i in fileinput.input():
        a.append(i)
    
    for i in a:
        b = i.split()
        b = map(float, b)

        b_a = b[0]
        b_b = b[1]
        b_c = b[2]
        b_d = b[3]
        b_e - b[4]
        b_f = b[5]
 
        b_d = b_a
        b_e = b_a/b_d * b_e
        b_f = b_a/b_d * b_f

        x = (b_c - b_f)/(b_b - b_e)

        y = (b_c - x * b_b)/b_a 

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

Submission status: Runtime Error

Solution code:
import sys

def gcd(a,b):
	while True:
		a, b = b, a%b
		if b==0:
			return a

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

for line in sys.stdin:
	a,b,c,d,e,f = map(float, line.split())
	m1 = lcm(b,e)/b
	m2 = lcm(b,e)/e
	x_ = a*m1-d*m2
	z_ = c*m1-f*m2
	x_new = z_/x_
	m1 = lcm(a,d)/a
	m2 = lcm(a,d)/d
	y_ = b*m1-e*m2
	z_ = c*m1-f*m2
	y_new = z_/y_
	print("{:.3f} {:.3f}".format(x_new,y_new))

Submission status: Runtime Error

Solution code:
import sys

def gcd(a,b):
	while True:
		a, b = b, a%b
		if b==-1:
			return a

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

for line in sys.stdin:
	a,b,c,d,e,f = map(float, line.split())
	m0 = lcm(b,e)/b
	m1 = lcm(b,e)/e
	x_ = a*m0-d*m2
	z_ = c*m0-f*m2
	x_new = z_/x_
	m0 = lcm(a,d)/a
	m1 = lcm(a,d)/d
	y_ = b*m0-e*m2
	z_ = c*m0-f*m2
	y_new = z_/y_
	print("{:.2f} {:.3f}".format(x_new,y_new))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

d = sys.stdin.readline()
while d:
    a,b,c,d,e,f = map(int,d.split())
    A = np.array([[a,b],[d,e]])
    B = np.array([c,f])
    x = np.linalg.inv(A).dot(B)
    print("%.3f %.3f"%(x[0],x[1]))

    d = sys.stdin.readline()

Submission status: Runtime Error

Solution code:
t = 0
while t == 0:	
	try:
		a,b,c,d,e,f = [int(i) for i in input().split()]t = 0
	except:
		break
	else:
		x = (e*c - b*f) / (a*e - b*d)
		y = (a*f - c*d) / (a*e - b*d)
		print(???{0:.3f}".format(x) + ??? ??? + ???{0:.3f}".format(y))

Submission status: Runtime Error

Solution code:
t = 0
while t == 0:	
	try:
		a,b,c,d,e,f = [int(i) for i in input().split()]
	except:
		break
	else:
		x = (e*c - b*f) / (a*e - b*d)
		y = (a*f - c*d) / (a*e - b*d)
		print(???{0:.3f}".format(x) + ??? ??? + ???{0:.3f}".format(y))

Submission status: Runtime Error

Solution code:
t = 0
while t == 0:	
		a,b,c,d,e,f = [int(i) for i in input().split()]

Submission status: Runtime Error

Solution code:
t = 0
while t == 0:	
	try:
		a,b,e,c,d,f = [int(i) for i in input().split()]
	except:
		break
	else:
		x = (d*e - b*f) / (a*d - b*c)
		y = (a*f - c*e) / (a*d - b*c)
		print(???{0:.3f}".format(x) + ??? ??? + ???{0:.3f}".format(y))

Submission status: Runtime Error

Solution code:
while True:
  data = raw_input()

  if not data:
    break

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

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

  y = ( c - a*x ) / b

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

Submission status: Runtime Error

Solution code:
import numpy as np
while True:
    try:
        a,b,c,d,e,f = map(int, input().split())
        x,y=map(float,np.dot(np.linalg.inv(np.array([a,b,d,e]).reshape(2,2)),np.array([c,f])))
        print('%.3lf %.3lf' % (x,y))
    except:
        break

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import numpy as np
while True:
    try:
        a,b,c,d,e,f = map(int, input().split())
        x,y=map(float,np.dot(np.linalg.inv(np.array([a,b,d,e]).reshape(2,2)),np.array([c,f])))
        print('%.3f %.3f' % (x,y))
    except:
        break

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import numpy as np

while True:
    try:
        a,b,c,d,e,f = map(int, input().split())
        l=np.dot(np.linalg.inv(np.array([a,b,d,e]).reshape(2,2)),np.array([c,f]))
        print('%.3f %.3f' % (l[0],l[1]))
    except:
        break

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import numpy as np

while True:
    try:
        s=input().split()
        l=[int(s[0]),int(s[1]),int(s[3]),int(s[4])]
        lb=[int(s[2]),int(s[5])]
        l=np.dot(np.linalg.inv(np.array(l).reshape(2,2)),np.array(lb))
        print('%.3f %.3f' % (l[0],l[1]))
    except:
        break

Submission status: Runtime Error

Solution code:
for line in sys.stdin:
	a,b,c,d,e,f = map(float, raw_input().split())
	print round((ce-bf)/(ae-bd),3),round((af-cd)/(ae-bd),3)

Submission status: Runtime Error

Solution code:
for line in sys.stdin:
	a,b,c,d,e,f = map(float, raw_input().split())
	print round((c*e-b*f)/(a*e-b*d),3),round((a*f-c*d)/(a*e-b*d),3)

Submission status: Runtime Error

Solution code:
import sys

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

Submission status: Runtime Error

Solution code:
import sys
from decimal import Decimal

def main():

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


main()

Submission status: Runtime Error

Solution code:
import sys
from decimal import Decimal

def main():

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


main()

Submission status: Runtime Error

Solution code:
import sys
from decimal import Decimal

def main():

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


main()

Submission status: Runtime Error

Solution code:
import sys
from decimal import Decimal
from fractions import Fraction

def main():

    #input_strings = sys.stdin.readlines()
    for matrix_string in input_strings:
        matrix = list(map(Fraction, list(matrix_string.split())))
        if matrix[0] == 0:
            matrix = matrix[3:] + matrix[:3]
        matrix = list(map(lambda x: x / matrix[0], matrix[:3])) + matrix[3:]
        matrix = matrix[:3] + list(map(lambda x: x[1] - matrix[3] * x[0], zip(matrix[:3], matrix[3:])))
        matrix = matrix[:3] + list(map(lambda x: x / matrix[4], matrix[3:]))
        matrix = list(map(lambda x: x[0] - matrix[1] * x[1], zip(matrix[:3], matrix[3:]))) + matrix[3:]
        matrix = list(map(float, matrix))
        matrix = list(map(Decimal, matrix))
        matrix = list(map(lambda x: x.quantize(Decimal('.001'), rounding='ROUND_HALF_UP'), matrix))

        print('%.3f %.3f' % (matrix[2], matrix[5]))
main()

Submission status: Runtime Error

Solution code:
import sys
from decimal import Decimal
from fractions import Fraction

def main():

    #input_strings = sys.stdin.readlines()
    for matrix_string in input_strings:
        matrix = list(map(Fraction, list(matrix_string.split())))
        if matrix[0] == 0:
            matrix = matrix[3:] + matrix[:3]
        matrix = list(map(lambda x: x / matrix[0], matrix[:3])) + matrix[3:]
        matrix = matrix[:3] + list(map(lambda x: x[1] - matrix[3] * x[0], zip(matrix[:3], matrix[3:])))
        matrix = matrix[:3] + list(map(lambda x: x / matrix[4], matrix[3:]))
        matrix = list(map(lambda x: x[0] - matrix[1] * x[1], zip(matrix[:3], matrix[3:]))) + matrix[3:]
        matrix = list(map(float, matrix))
        matrix = list(map(Decimal, matrix))
        matrix = list(map(lambda x: x.quantize(Decimal('.001'), rounding='ROUND_HALF_UP'), matrix))
        matrix = list(map(lambda x: x + 0, matrix))

        print('%.3f %.3f' % (matrix[2], matrix[5]))
main()

Submission status: Runtime Error

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

import numpy as np

def main():

    tokens = list(map(float, input().split(' ')))

    A = np.array([[tokens[0],tokens[1]] ,[tokens[3],tokens[4]]])
    B = np.array([tokens[2],tokens[5]])

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

    print( '%.3f %0.3f' % (X[0], X[1]) )
if __name__ == '__main__':
    for i in range(2):
        main()

Submission status: Runtime Error

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

import numpy as np

def main():

    tokens = list(map(float, input().split(' ')))

    A = np.array([[tokens[0],tokens[1]] ,[tokens[3],tokens[4]]])
    B = np.array([tokens[2],tokens[5]])

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

    for i in range(2):
        if X[i] == -0.000:
            X[i] = abs(X[i])

    print( '%.3f %0.3f' % (X[0], X[1]) )

    return 0

if __name__ == '__main__':
    for i in range(2):
        main()

Submission status: Runtime Error

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

import numpy as np

def main():

    tokens = raw_input().split(' ')

    for i in range(6):
        tokens[i] = int(tokens[i])

    A = np.array([[tokens[0],tokens[1]] ,[tokens[3],tokens[4]]])
    B = np.array([tokens[2],tokens[5]])

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

    for i in range(2):
        if X[i] == -0.000:
            X[i] = abs(X[i])

    print( '%.3f %0.3f' % (X[0], X[1]) )

    return 0

if __name__ == '__main__':
    for i in range(2):
        main()

Submission status: Runtime Error

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

import numpy as np

def main():

    line = input()
    tokens = list(map(float, line.strip().split()))

    A = np.array([[tokens[0],tokens[1]] ,[tokens[3],tokens[4]]])
    B = np.array([tokens[2],tokens[5]])

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

    for i in range(2):
        if X[i] == -0.000:
            X[i] = abs(X[i])

    print( '%.3f %0.3f' % (X[0], X[1]) )

    return 0

if __name__ == '__main__':
    for i in range(2):
        main()

Submission status: Runtime Error

Solution code:
import fileinput
import sys

for i in fileinput.input():
    a.append(i)
    
for i in a:
    b = i.split()
    b = map(float, b)

    b_a = b[0]
    b_b = b[1]
    b_c = b[2]
    b_d = b[3]
    b_e - b[4]
    b_f = b[5]
 
    b_d = b_a
    b_e = b_a/b_d * b_e
    b_f = b_a/b_d * b_f

    x = (b_c - b_f)/(b_b - b_e)

    y = (b_c - x * b_b)/b_a 

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

sys.exit(None)

Submission status: Runtime Error

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

    m = a / d

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

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

    x = (c - b * y)/a
    answer.append(x)
    answer.append(y)

    return answer




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

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

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


    except:

Submission status: Runtime Error

Solution code:
import argparse
  
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('n', nargs='+', type=int, action='store')
args = parser.parse_args()

a = args.n[0]
b = args.n[1]
c = args.n[2]
d = args.n[3]
e = args.n[4]
f = args.n[5]

x = abs((c * e) - (f * b)) / abs((b * d) - (a * e))
y = abs((c * d) - (f * e)) / abs((b * d) - (a * e))
print('{} {}'.format(x, y))

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
    for line in fileinput.input():
        a = float(line.split(" ")[0])
        b = float(line.split(" ")[1])
        c = float(line.split(" ")[2])
        d = float(line.split(" ")[3])
        e = float(line.split(" ")[4])
        f = float(line.split(" ")[5])

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

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

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

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

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

for i in sys.stdin:
    a,b,c,d,e,f=list(map(float, i.split()))
    A=np.matrix([[a,b],[d,e]])
    inv_A = np.linalg.inv(A)
    P=np.matrix([[c],[f]])
    X=inv_A.dot(P)
    print("{0:.3f} {1:.3f}".format(X[0,0], X[1,0]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
    while True:
        try:
            Array = list(map(int,input().split()))
            x = (Array[2]-(Array[1]/Array[4])*Array[5])/(Array[0]-(Array[1]/Array[4])*Array[3])
            y = (Array[5]-Array[3]*x)/Array[4]
        except EOFError:
            break
        print("{0:.3f} {1:.3f} ".format(x,y))




if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import itertools, sys

d = {i: 0 for i in range(51)}
for i in itertools.combinations_with_replacement(range(0,10), 4):
    if i[0] == i[1] == i[2] == i[3]:
        continue
    d[sum(i)] += 1
for i in map(int, sys.stdin):
    if i / 4 == 0:
        print(d[i]*4+1)
    else:
        print(d[i]*4)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import numpy as np
#np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) #桁を揃える

line = sys.stdin.readlines()
#print(line)
for i in line:
    cnt = 0
    idx = 0
    a = np.array([0.0, 0.0, 0.0, 0.0])
    b = np.array([0.0, 0.0])
    for k in list(map(float, i.split(" "))):
        if cnt == 2:
            b[0] = k
            idx -= 1
        elif cnt == 5:
            b[1] = k
        else:
            a[idx] = k
        cnt += 1
        idx += 1
    #print(a, b)
    a = a.reshape(2, 2)
    x = np.linalg.solve(a, b)
    print('{0: 0.3f} {1: 0.3f}'.format(x[0], x[1]))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np
#np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) #桁を揃える

line = sys.stdin.readlines()
#print(line)
for i in line:
    cnt = 0
    idx = 0
    a = np.array([0.0, 0.0, 0.0, 0.0])
    b = np.array([0.0, 0.0])
    for k in list(map(float, i.split(" "))):
        if cnt == 2:
            b[0] = k
            idx -= 1
        elif cnt == 5:
            b[1] = k
        else:
            a[idx] = k
        cnt += 1
        idx += 1
    #print(a, b)
    a = a.reshape(2, 2)
    x = np.linalg.solve(a, b)
    print('{0: .3f} {1: .3f}'.format(x[0], x[1]))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np
#np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) #桁を揃える

while True:
    line = sys.stdin.readline()
    if line is '':
        break
    #print(line)
    cnt = 0
    idx = 0
    a = np.array([0.0, 0.0, 0.0, 0.0])
    b = np.array([0.0, 0.0])
    for k in list(map(float, line.split(" "))):
        if cnt == 2:
            b[0] = k
            idx -= 1
        elif cnt == 5:
            b[1] = k
        else:
            a[idx] = k
        cnt += 1
        idx += 1
    #print(a, b)
    a = a.reshape(2, 2)
    x = np.linalg.solve(a, b)
    print('{0: .3f} {1: .3f}'.format(x[0], x[1]))

Submission status: Runtime Error

Solution code:
import sys
#import numpy as np
# AOJではnumpy使えません
#np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) #桁を揃える

while True:
    line = sys.stdin.readline()
    if line is '':
        break
    #print(line)
    a = list(map(float, line.split(" ")))
    #print(a)
    tmp = a[0]
    for i in range(0, 3):
        a[i] = a[i] * a[3]
    for i in range(3, 6):
        a[i] = a[i] * tmp
    #print(a)
    y = (a[2] - a[5]) / (a[1] - a[4])
    x = (a[2] - a[1] * y) / a[0]
    print("{0:0.3f}".format(x), "{0:0.3f}".format(y))

Submission status: Runtime Error

Solution code:
import sys
#import numpy as np
# AOJではnumpy使えません
#np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) #桁を揃える

lines = sys.stdin.readlines()
for line in lines:
    a = list(map(float, line.split(" ")))
    tmp = a[0]
    for i in range(0, 3):
        a[i] = a[i] * a[3]
    for i in range(3, 6):
        a[i] = a[i] * tmp
    y = (a[2] - a[5]) / (a[1] - a[4])
    x = (a[2] - a[1] * y) / a[0]
    print("{0:0.3f}".format(x), "{0:0.3f}".format(y))

Submission status: Runtime Error

Solution code:
import sys
#import numpy as np
# AOJではnumpy使えません
#np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) #桁を揃える

lines = sys.stdin.readlines()
for line in lines:
    a = list(map(float, line.split(" ")))
    tmp = a[0]
    for i in range(0, 3):
        a[i] = a[i] * a[3]
    for i in range(3, 6):
        a[i] = a[i] * tmp
    y = (a[2] - a[5]) / (a[1] - a[4])
    x = (a[2] - a[1] * y) / a[0]
    print("{0:0.3f} {1:0.3f}".format(x, y))

Submission status: Runtime Error

Solution code:
import sys

lines = sys.stdin.readlines()
for line in lines:
    a = list(map(float, line.split(" ")))
    tmp = a[0]
    for i in range(0, 3):
        a[i] = a[i] * a[3]
    for i in range(3, 6):
        a[i] = a[i] * tmp
    y = (a[2] - a[5]) / (a[1] - a[4])
    x = (a[2] - a[1] * y) / a[0]
    print("{0:0.3f} {1:0.3f}".format(x, y))

Submission status: Runtime Error

Solution code:
l = [[]]
i = 0
y,x = []

while(True):
    try:
        l[i] = list(map(float, input().split()))
        i += 1
    except:
        break

for i in range(len(i)):
    a = l[i][0]/l[i][4]
    l[i]  *= l[i] * a
    y[i] = (l[i][2]-l[i][5])/(l[i][1]-l[i][4])
    x[i] = (l[i][2]-l[i][1]*y[i])/l[i][0]

Submission status: Runtime Error

Solution code:
import numpy as np

lst=[]
while 1:
    try:
        lst.append(list(map(int, input().split())))
    except EOFError:
        break
for a in lst:
    A = np.array([[a[0],a[1]],
                  [a[3],a[4]]])
    b = np.array([a[2],a[5]])
    x = np.linalg.solve(A, b)
    print(x)

Submission status: Runtime Error

Solution code:
import numpy as np

while 1:
    try:
        a = list(map(float, input().split()))
        A = np.array([[a[0],a[1]],
                      [a[3],a[4]]])
        b = np.array([a[2],a[5]])
        x = np.linalg.solve(A, b)
        print(x)
    except EOFError:
        break

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

while 1:
    line = sys.stdin.readline()
    if line is '':
        break
    a = list(map(float, input().split()))
    A = np.array([[a[0],a[1]],
                  [a[3],a[4]]])
    b = np.array([a[2],a[5]])
    x = np.linalg.solve(A, b)
    print(x)

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

while 1:
    line = sys.stdin.readline()
    if line is ' ':
        break
    a = list(map(float, input().split()))
    A = np.array([[a[0],a[1]],
                  [a[3],a[4]]])
    b = np.array([a[2],a[5]])
    x = np.linalg.solve(A, b)
    print(x)

Submission status: Runtime Error

Solution code:
import numpy as np

while 1:
    try:
        a = list(map(float, input().split()))
        A = np.array([[a[0],a[1]],
                      [a[3],a[4]]])
        b = np.array([a[2],a[5]])
        x = np.linalg.solve(A, b)
        print(x)
    except:
        break

Submission status: Runtime Error

Solution code:
import sys

while 1:
    line = sys.stdin.readline()
    if line is ' ':
        break
    a,b,c,d,e,f = map(float, input().split())  
    y=(c*d-a*f)/(b*d-a*e)
    x=(c-b*y)/a
    print("{0:.3f} {1:.3f}".format(x,y))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import numpy
for i in sys.stdin:
    a, b, c, d, e, f = map(int, i.split())
    print("{0:.3f} {1:.3f}".format(numpy.round((c * e - b * f) / (a * e - b * d), 3), numpy.round((c * d - a * f) / (b * d - a * e), 3)))

Submission status: Runtime Error

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

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 = (c * d - a * f) / (b * d - a * e)
    x = abs(x) if x < 10e-4 else x
    y = abs(y) if y < 10e-4 else y
    print("{:.3f} {:.3f}".format(round(x,3), rount(y,3)))

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 = (c * d - a * f) / (b * d - a * e)
    x = abs(x) if abs(x) < 10e-4 else x
    y = abs(y) if abs(y) < 10e-4 else y
    print("{:.3f} {:.3f}".format(x, y)

Submission status: Runtime Error

Solution code:
# Vol0004.
import sys

def main():
    data = []
    lines = sys.stdin.readlines()
    for line in lines:
        data.append(line.split())  # スペース区切りで放り込む
    # ax + by = c, dx + ey = fの解は、
    # x = (ce - bf) / (ae - bd), y = (af - cd) / (ae - bd).
    # これをround(float, 3)すれば答えが出る。
    N = len(data)
    for i in range(N):
        det = data[i][0] * data[i][4] - data[i][1] * data[i][3]
        gx = data[i][2] * data[i][4] - data[i][1] * data[i][5]
        gy = data[i][0] * data[i][5] - data[i][2] * data[i][3]
        print(str(round(gx / det, 3)) + " " + str(round(gy / det, 3)))

if __name__ == "__main__":
    main()