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: Wrong Answer

Solution code:
from decimal import Decimal

def main():
    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: Wrong Answer

Solution code:
from decimal import Decimal

def main():
    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()

Submission status: Wrong Answer

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("{:.3f} {:.3f}".format(x,y))
		except:
			break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(0)
y = int(0)

while 1:
	try:
		data = raw_input().split()

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

		# a*x + b*y = c
		# d*x + e*y = f

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

		print(format(x, '.3f'))
		print(format(y, '.3f'))

	except:
		break

Submission status: Wrong Answer

Solution code:
x = int(0)
y = int(0)

while 1:
	try:
		data = raw_input().split()

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

		# a*x + b*y = c
		# d*x + e*y = f

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

		print(float(format(x, '.3f')))
		print(float(format(y, '.3f')))

	except:
		break

Submission status: Wrong Answer

Solution code:
x = int(0)
y = int(0)

while 1:
	try:
		data = raw_input().split()

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

		# a*x + b*y = c
		# d*x + e*y = f

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

		print(float(format(x, '.3f')))
		print(float(format(y, '.3f')))

	except:
		break

Submission status: Wrong Answer

Solution code:
x = float(0.000)
y = float(0.000)

while 1:
	try:
		data = raw_input().split()

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

		# a*x + b*y = c
		# d*x + e*y = f

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

		print(float(format(x, '.3f')))
		print(float(format(y, '.3f')))

	except:
		break

Submission status: Wrong Answer

Solution code:
import sys
WS = sys.stdin.read()[:-1].split('\n')
for W in WS:
    a,b,c,d,e,f = map(float,W.split())
    x=(b*f-e*c)/(b*d-e*a)
    y=(c-a*x)/b
    print '%.3f,%.3f' % (round(x,3),round(y,3))

Submission status: Wrong Answer

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
	
	print("{0:.3f} {1:.3f}".format(x, y))

Submission status: Wrong Answer

Solution code:
import sys

while (True):
    L = map(float, sys.stdin.readline().split())
    if L:
        (a, b, c, d, e, f) = L
        x = (e * c - b * f) / (a * e - b * d)
        y = (a * f - d * c) / (a * e - b * d)

        print x, y

    else:
        break

Submission status: Wrong Answer

Solution code:
import sys

eps = float(pow(10,-7))

while (True):
    L = map(float, sys.stdin.readline().split())
    if L:
        (a, b, c, d, e, f) = L
        x = (e * c - b * f) / (a * e - b * d)
        y = (a * f - d * c) / (a * e - b * d)

        if (x < eps):
            x = 0.0
        if (y < eps):
            y = 0.0

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

    else:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
#Problem Name: Simultaneous Equation
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        a1,b1,c1,a2,b2,c2 = map(int,raw_input().split(' '))
        det = a1*b2-b1*a2
        print '{0:.3f} {1:.3f}'.format((c1*b2-b1*c2)/det,(a1*c2-c1*a2)/det)
    except:
        break

'''
Sample Input
1 2 3 4 5 6
2 -1 -2 -1 -1 -5
'''

Submission status: Wrong Answer

Solution code:
# coding: utf-8
#Problem Name: Simultaneous Equation
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        a1,b1,c1,a2,b2,c2 = map(int,raw_input().split(' '))
        det = a1*b2-b1*a2
        print '{0:.3f} {1:.3f}'.format((c1*b2-b1*c2)/det,(a1*c2-c1*a2)/det)
    except:
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
#Problem Name: Simultaneous Equation
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        a1,b1,c1,a2,b2,c2 = map(int,raw_input().split(' '))
        det = a1*b2-b1*a2
        print '{0:.3f} {1:.3f}'.format(round((c1*b2-b1*c2)/det,3),round((a1*c2-c1*a2)/det,3))
    except:
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
#Problem Name: Simultaneous Equation
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        a1,b1,c1,a2,b2,c2 = map(int,raw_input().split(' '))
        det = a1*b2-b1*a2
        print '%.3f %.3f' % ((c1*b2-b1*c2)/det,(a1*c2-c1*a2)/det)
        #print '{0:.3f} {1:.3f}'.format((c1*b2-b1*c2)/det,(a1*c2-c1*a2)/det)
    except:
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
#Problem Name: Simultaneous Equation
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        a1,b1,c1,a2,b2,c2 = map(int,raw_input().split(' '))
        det = a1*b2-b1*a2
        x = (c1*b2-b1*c2)/det
        if x == -0.:
            x = 0.
        y = (a1*c2-c1*a2)/det
        if y == -0.:
            y = 0.
        print '%.3f %.3f' % (x,y)
        #print '{0:.3f} {1:.3f}'.format((c1*b2-b1*c2)/det,(a1*c2-c1*a2)/det)
    except:
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
#Problem Name: Simultaneous Equation
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        a1,b1,c1,a2,b2,c2 = map(int,raw_input().split(' '))
        det = a1*b2-b1*a2
        x = (c1*b2-b1*c2)/det
        #y = (a1*c2-c1*a2)/det
        y = (a1*x - c1)/b1
        print '%.3f %.3f' % (x,y)
        #print '{0:.3f} {1:.3f}'.format((c1*b2-b1*c2)/det,(a1*c2-c1*a2)/det)
    except:
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
#Problem Name: Simultaneous Equation
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        a1,b1,c1,a2,b2,c2 = map(float,raw_input().split(' '))
        det = a1*b2-b1*a2
        print '{0:.3f} {1:.3f}'.format((c1*b2-b1*c2)/det,(a1*c2-c1*a2)/det)
    except:
        break

Submission status: Wrong Answer

Solution code:
def getX(value):
	numerator = value[2] * value[4] - value[1] * value[5]
	denominator = value[0] * value[4] - value[1] * value[3]
	return numerator / denominator

def getY(value):
	numerator = value[2] * value[3] - value[0] * value[5]
	denominator = value[1] * value[3] - value[0] * value[4]
	return numerator / denominator

while True:
	try:
		value = []
		for i in input().split(" "):
			value.append(int(i))
		x = getX(value)
		y = getY(value)
		print('%.3f %.3f'%(round(x, 3),round(y, 3)))
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
import sys
input_1 = [line for line in sys.stdin]
for item in input_1:
	arr = item.split(' ')
	a = int(arr[0])
	b = int(arr[1])
	c = int(arr[2])
	d = int(arr[3])
	e = int(arr[4])
	f = int(arr[5])
	if a*e-b*d != 0:
		x = round((c*e - b*f)/(a*e - b*d),3)
		y =round((a*f - c*d)/(a*e - b*d),3)
		s_x = "%0.3f" % (x)
		s_y = "%0.3f" % (y)
		print str(s_x) + " " + str(s_y)

Submission status: Wrong Answer

Solution code:
import sys
input_1 = [line for line in sys.stdin]
for item in input_1:
	arr = item.split(' ')
	a = float(arr[0])
	b = float(arr[1])
	c = float(arr[2])
	d = float(arr[3])
	e = float(arr[4])
	f = float(arr[5])
	x = round((c*e - b*f)/(a*e - b*d),3)
	y =round((a*f - c*d)/(a*e - b*d),3)
	s_x = "%0.3f" % (x)
	s_y = "%0.3f" % (y)
	print str(s_x) + " " + str(s_y)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
 
def main():
    while True:
        try:
            IN=input()
            if IN=="":
                raise EOFError
            else:
                val=IN.split(" ")
                a=int(val[0])
                b=int(val[1])
                c=int(val[2])
                d=int(val[3])
                e=int(val[4])
                f=int(val[5])

                x=round(float((c*e-b*f)/(a*e-b*d)),3)
                y=round(float((c*d-a*f)/(b*d-a*e)),3)

            print(x,y)
                
        except EOFError:
            break
  
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
 
def main():
    while True:
        try:
            IN=input()
            val=IN.split(" ")
        except:
            break
        a=int(val[0])
        b=int(val[1])
        c=int(val[2])
        d=int(val[3])
        e=int(val[4])
        f=int(val[5])

        x=round(float((c*e-b*f)/(a*e-b*d)),3)
        y=round(float((c*d-a*f)/(b*d-a*e)),3)

        print(x,y)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
 
def main():
    while True:
        try:
            IN=input()
            val=IN.split(" ")
        except:
            break
        a=float(val[0])
        b=float(val[1])
        c=float(val[2])
        d=float(val[3])
        e=float(val[4])
        f=float(val[5])

        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: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
 
def main():
    while True:
        try:
            IN=input()
            val=IN.split(" ")
            a=float(val[0])
            b=float(val[1])
            c=float(val[2])
            d=float(val[3])
            e=float(val[4])
            f=float(val[5])

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

Submission status: Wrong Answer

Solution code:
def main():
    while True:
        try:
            IN=input()
            val=IN.split(" ")
            a=float(val[0])
            b=float(val[1])
            c=float(val[2])
            d=float(val[3])
            e=float(val[4])
            f=float(val[5])

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

Submission status: Wrong Answer

Solution code:
import sys

x = 0
y = 0
while True:
    try:
	 a,b,c,d,e,f = map(float,raw_input().split())
	 if a == 0:
	     y = c / b
	     x = (f - e * c / b) / d
	 elif b == 0:
	     x = c / a
	     y = (f - d * c / a) / e
	 elif d == 0:
	     y = f / e
	     x = (c - a * f / e) / a
	 elif e == 0:
	     x = f / d
	     y = (c - a * f / d) / b
	 else:
	     x = (c*e - b*f) / (a*e - b*d)
	     y = (c*d - a*f) / (b*d - a*e)

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

    except EOFError:
	break

Submission status: Wrong Answer

Solution code:
import sys

x = 0
y = 0
while True:
    try:
	 a,b,c,d,e,f = map(float,raw_input().split())
	 if a == 0:
	     y = c / b
	     x = (f - e * c / b) / d
	 elif b == 0:
	     x = c / a
	     y = (f - d * c / a) / e
	 elif d == 0:
	     y = f / e
	     x = (c - a * f / e) / a
	 elif e == 0:
	     x = f / d
	     y = (c - a * f / d) / b
	 else:
	     x = (c*e - b*f) / (a*e - b*d)
	     y = (c*d - a*f) / (b*d - a*e)

         if x == 0:
	     x = 0.0
	 if y == 0:
	     y = 0.0
	 print "%f %f" % (x,y)

    except EOFError:
	break

Submission status: Wrong Answer

Solution code:
import sys

x = 0
y = 0
while True:
    try:
	 a,b,c,d,e,f = map(float,raw_input().split())
	 if a == 0:
	     y = c / b
	     x = (f - e * c / b) / d
	 elif b == 0:
	     x = c / a
	     y = (f - d * c / a) / e
	 elif d == 0:
	     y = f / e
	     x = (c - b * f / e) / a
	 elif e == 0:
	     x = f / d
	     y = (c - a * f / d) / b
	 else:
	     x = (c*e - b*f) / (a*e - b*d)
	     y = (c*d - a*f) / (b*d - a*e)

         if x == 0:
	     x = 0.0
	 if y == 0:
	     y = 0.0
	 print "%f %f" % (x,y)

    except EOFError:
	break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print('ok')

Submission status: Wrong Answer

Solution code:
print('hello')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
lines = sys.stdin.readlines()
for line in lines:
    line = line.split(" ")
    inp = []
    for i in line:
        inp.append(int(i))
    a = inp[0]
    b = inp[1]
    c = inp[2]
    d = inp[3]
    e = inp[4]
    f = inp[5]
    delta = a*e - b*d
    x = (c*e-b*f)/delta
    y = (-d*c+a*f)/delta
    print("%.3f %.3f" % (x,y))

Submission status: Wrong Answer

Solution code:
import sys

inputNum = sys.stdin.readlines()[:-1]

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: Wrong Answer

Solution code:
import sys

inputNum = sys.stdin.readlines()[:-1]

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: Wrong Answer

Solution code:
a, b, c, d, e, f=map(float,input().split())
k=(a*e)-(b*d)
xval=(c*e)-(b*f)
yval=(a*f)-(c*d)
print("%.3f %.3f"%(xval/k,yval/k))

Submission status: Wrong Answer

Solution code:
import sys
for line in sys.stdin.readlines():
    a, b, c, d, e, f=map(float,line.split())
    k=(a*e)-(b*d)
    xval=(c*e)-(b*f)
    yval=(a*f)-(c*d)
    print("%.3f %.3f"%(xval/k,yval/k))

Submission status: Wrong Answer

Solution code:
import sys

for line in sys.stdin:
    a, b, c, d, e, f = map(float, line.split())
    det = a*e-b*d    
    print '%.3f, %.3f' % ((c*e-b*f)/det, (a*f-c*d)/det)

Submission status: Wrong Answer

Solution code:
import sys

for line in sys.stdin:
    a, b, c, d, e, f = map(float, line.split())
    det = a*e-b*d    
    print '%.3f %.3f' % ((c*e-b*f)/det, (a*f-c*d)/det)

Submission status: Wrong Answer

Solution code:
import string
import sys
import math

#abcdef
#012345
#??????????????\????????????ip?????\??????
ip = sys.stdin.readlines()
ip_list = {}

#?????????????????§?????????
for i in range(len(ip)):
    ip_list[i] = ip[i].strip("\n").split()
    x = float( int(ip_list[i][2])*int(ip_list[i][4]) - int(ip_list[i][1])*int(ip_list[i][5]) ) / float( int(ip_list[i][0])*int(ip_list[i][4]) - int(ip_list[i][1])*int(ip_list[i][3]) )
    y = float( int(ip_list[i][2])*int(ip_list[i][3]) - int(ip_list[i][0])*int(ip_list[i][5]) ) / float( int(ip_list[i][1])*int(ip_list[i][3]) - int(ip_list[i][0])*int(ip_list[i][4]) )
    
    x = ('%.3f' % x)
    y = ('%.3f' % y)
    print(str(x)+" "+str(y))

Submission status: Wrong Answer

Solution code:
import string
import sys
import math

#??????????????\????????????ip?????\??????
ip = sys.stdin.readlines()
ip_list = {}

#?????????????????§?????????
for i in range(len(ip)):
    ip_list[i] = ip[i].strip("\n").split()
    x = int( float( int(ip_list[i][2])*int(ip_list[i][4]) - int(ip_list[i][1])*int(ip_list[i][5]) ) / float( int(ip_list[i][0])*int(ip_list[i][4]) - int(ip_list[i][1])*int(ip_list[i][3]) ))
    y = int( float( int(ip_list[i][2])*int(ip_list[i][3]) - int(ip_list[i][0])*int(ip_list[i][5]) ) / float( int(ip_list[i][1])*int(ip_list[i][3]) - int(ip_list[i][0])*int(ip_list[i][4]) ))
    
    x = ('%.3f' % x)
    y = ('%.3f' % y)
    print(str(x)+" "+str(y))

Submission status: Wrong Answer

Solution code:
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    x=round((c*e-b*f)/(a*e-b*d),3)
    y=round((c*d-a*f)/(b*d-a*e),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: Wrong Answer

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

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

print(x,y)

Submission status: Wrong Answer

Solution code:
while 1:
    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:
        break

Submission status: Wrong Answer

Solution code:
while 1:
    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:
        break

Submission status: Wrong Answer

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:
        break

Submission status: Wrong Answer

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:
        break

Submission status: Wrong Answer

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:
                break

Submission status: Wrong Answer

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:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys

for line 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: Wrong Answer

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

import sys

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

Submission status: Wrong Answer

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

import sys

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

Submission status: Wrong Answer

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

import sys

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

Submission status: Wrong Answer

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

import sys

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

Submission status: Wrong Answer

Solution code:
import sys

lines = sys.stdin.readlines()
for line in lines:
    a, b, c, d, e, f = map(float, line.split())
    if a * e - b * d == 0:
        break
    x = (e * c + (-b) * f)/(a * e - b * d)
    y = ((-d) * c + a * f)/(a * e - b * d)
    print('%.3f %.3f' % (x , y))

Submission status: Wrong Answer

Solution code:
a,b,c,d,e,f = map(float,input().split(" "))
x,y = 0,0
float(x)
float(y)
x = (e*c-b*f) / (a*e-b*d)
y = ((-(d*c)+a*f) / (a*e-b*d))
print("%.3f" %(x), end="")
print(" ", end="")
print("%.3f" %(y))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == "__main__":
    array = list(get_input())
    #print(array)
    for i in range(len(array)):
        a,b,c,d,e,f = array[i].split()
        
        if int(b)!=0:
            x = (int(b)*int(f) - int(c)*int(e))/(int(b)*int(d) - int(a)*int(e))
            y = -(int(a)/int(b))*x + int(c)/int(b)
        elif int(b)==0 and int(a)!=0:
            x = int(c)/int(a)
            y = -(int(d)/int(e))*x + int(f)
        
        print("{0} {1}".format(x,y))

Submission status: Wrong Answer

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

if __name__ == "__main__":
    array = list(get_input())
    #print(array)
    for i in range(len(array)):
        a,b,c,d,e,f = array[i].split()
        
        if int(b)!=0:
            x = (int(b)*int(f) - int(c)*int(e))/(int(b)*int(d) - int(a)*int(e))
            y = -(int(a)/int(b))*x + int(c)/int(b)
        elif int(b)==0 and int(a)!=0:
            x = int(c)/int(a)
            y = -(int(d)/int(e))*x + int(f)
        
        print("{:.3f} {:.3f}".format(x,y))

Submission status: Wrong Answer

Solution code:


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

Submission status: Wrong Answer

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()]
        e = e * (a/d)
        f = f * (a/d)

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

    except:
        print("dataset cannot to be converted")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
line = input()
for _ in range(1):
    a, b, c, d, e, f = map(float, line.split())
    x = round((c * e - b * f) / (a * e - b * d), 3)
    y = round((a * f - c * d) / (a * e - b * d), 3)
    print('{0:.3f} {1:.3f}'.format(x, y))