ZhenlongDai/ACPR huggingface dataset:
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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
    

Failing test case input:
1 2 3 1 5 0
2 -1 -3 -1 0 -4

Expected output:
5.000 -1.000
4.000 11.000


Actual output:

Fixed submission (verdict: Accepted):
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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
x = []
y = []
while True:
    try:
        a, b, p, c, d, q = map(int, input().split())
        x.append((d*p-b*q)/(a*d-b*c))
        y.append((a*q-c*p)/(a*d-b*c))
    except EOFError:
        break

for i in range(len(x)):
    print("{:.3f} {:.3f}".format(x[i], y[i]))

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 15

Expected output:
0.000 3.000
-1.500 0.000


Actual output:
-0.000 3.000
-1.500 0.000


Fixed submission (verdict: Accepted):
x = []
y = []
while True:
    try:
        a, b, p, c, d, q = map(int, input().split())
        x.append((d*p-b*q)/(a*d-b*c))
        y.append((a*q-c*p)/(a*d-b*c))
    except EOFError:
        break

for i in range(len(x)):
    print("{:.3f} {:.3f}".format(x[i]+0, y[i]+0))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):



import sys

def inverse(a, b, d, e):
    deta = a * e - b * d
    return (deta, e, -b, -d, a)

while True:
    data = sys.stdin.readline()
    if data is None or data.strip() == '':
        break
    data = data.strip().split(' ')
    a, b, c, d, e, f = [float(i) for i in data]

    inv = inverse(a, b, d, e)
    x = (inv[1] * c + inv[2] * f) / inv[0]
    y = (inv[3] * c + inv[4] * f) / inv[0]

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

Failing test case input:
2 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
1.833 -0.667
0.000 4.000


Actual output:
1.833 -0.667
-0.000 4.000


Fixed submission (verdict: Accepted):



import sys

def inverse(a, b, d, e):
    deta = a * e - b * d
    return (deta, e, -b, -d, a)

while True:
    data = sys.stdin.readline()
    if data is None or data.strip() == '':
        break
    data = data.strip().split(' ')
    a, b, c, d, e, f = [float(i) for i in data]

    inv = inverse(a, b, d, e)
    x = (inv[1] * c + inv[2] * f) / inv[0] + 0
    y = (inv[3] * c + inv[4] * f) / inv[0] + 0

    print('%.3f %.3f' % (x, y))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):

import sys

def main():
    data = []
    lines = sys.stdin.readlines()

    for line in lines:
        data.append(line.split())  
    
    
    
    N = len(data)
    for i in range(N):
        for k in range(6):
            data[i][k] = int(data[i][k])
        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()


Failing test case input:
2 -1 -3 1 -1 -4
2 -1 -3 -10 9 27

Expected output:
1.000 5.000
0.000 3.000


Actual output:
1.0 5.0
0.0 3.0


Fixed submission (verdict: Accepted):

import sys

def main():
    data = []
    lines = sys.stdin.readlines()

    for line in lines:
        data.append(line.split())  
    
    
    
    N = len(data)
    for i in range(N):
        for k in range(6):
            data[i][k] = int(data[i][k])
        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]
        if det < 0:
            det = -det;
            if gx != 0: gx = -gx
            if gy != 0: gy = -gy
        print("{0:.3f}".format(gx / det) + " " + "{0:.3f}".format(gy / det))

if __name__ == "__main__":
    main()

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
for line in sys.stdin:
    a,b,c,d,e,f = map(int,line.strip().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))

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -9 9 27

Expected output:
0.000 3.000
0.000 3.000

Actual output:
-0.000 3.000
0.000 3.000


Fixed submission (verdict: Accepted):
import sys
for line in sys.stdin:
    a,b,c,d,e,f = map(int,line.strip().split(' '))
    x = (c*e - b*f) / (a*e - b*d)
    y = (c*d - a*f) / (b*d - a*e)
    print("{:.3f} {:.3f}".format(x+0, y+0))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):



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

Failing test case input:
1 2 6 4 5 5
2 -1 -4 -1 -1 -5

Expected output:
-6.667 6.333
0.333 4.667


Actual output:
6.667 6.333
0.333 4.667


Fixed submission (verdict: Accepted):



while True:
    try:
        a, b, c, d, e, f = map(float, input().split())
        x = (c*e - b*f) / (a*e - b*d)
        y = (a*f - d*c) / (a*e - b*d)
        print('{:.3f} {:.3f}'.format(x+0, y+0))
    except:
        break
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        a,b,c,d,e,f = map(int, input().split())
    except EOFError:
        break
    x = c/a + (f*a-c*d)*b / (e*a-d*b) / a
    y = (f*a - c*d) / (e*a - b*d)
    print('{:.3f} {:.3f}')

Failing test case input:
3 -1 -3 1 0 -3
2 -1 -3 -9 13 27

Expected output:
-3.000 -6.000
-0.706 1.588


Actual output:
{:.3f} {:.3f}
{:.3f} {:.3f}


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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):



import sys
import math

r = sys.stdin.readlines()

r.pop(0)

n = [[float(i) for i in (j.split())] for j in r] 
    
for l in n:
    y = (l[2]*l[3]-l[0]*l[5])/(l[1]*l[3]-l[0]*l[4])+0
    
    x = (l[2]*l[4]-l[5]*l[1])/(l[0]*l[4]-l[3]*l[1])+0
    
    print("{:.3f} {:.3f} ".format(x,y))
    

Failing test case input:
1 2 0 1 5 0
2 -1 -5 -1 0 -4

Expected output:
0.000 0.000
4.000 13.000


Actual output:
4.000 13.000 


Fixed submission (verdict: Accepted):

import sys
import math

r = sys.stdin.readlines()


n = [[float(i) for i in (j.split())] for j in r] 
    
for l in n:
    y = (l[2]*l[3]-l[0]*l[5])/(l[1]*l[3]-l[0]*l[4])+0
    
    x = (l[2]*l[4]-l[5]*l[1])/(l[0]*l[4]-l[3]*l[1])+0
    
    print("%.3f %.3f" %(x, y))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys

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

Failing test case input:
3 -1 -4 1 0 -3
2 -1 -3 -9 9 27

Expected output:
-3.000 -5.000
0.000 3.000


Actual output:
-3.000 -5.000
-0.000 3.000


Fixed submission (verdict: Accepted):
import sys
for line in sys.stdin:
    a,b,c,d,e,f = map(int,line.strip().split(' '))
    x = (c*e - b*f) / (a*e - b*d)
    y = (c*d - a*f) / (b*d - a*e)
    print("{:.3f} {:.3f}".format(x+0, y+0))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
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(int, matrix))
        print('%.3f %.3f' % (matrix[2], matrix[5]))


main()

Failing test case input:
2 2 3 4 5 6
2 -1 -2 -1 -1 -5

Expected output:
1.500 0.000
1.000 4.000


Actual output:
1.000 0.000
1.000 4.000


Fixed submission (verdict: Accepted):
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()

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys

d = sys.stdin.readline()
while d:
    a,b,c,d,e,f = map(int,d.split())
    inv = 1/(a*e - b*d)
    iA = [[e,-b],[-d,a]]
    B = [c,f]
    sol = list()
    for i in range(2):
        tmp = 0
        for j in range(2):
            tmp += iA[i][j] * B[j]
        sol.append(tmp*inv)
    print("%.3f %.3f"%(sol[0],sol[1]))

    d = sys.stdin.readline()

Failing test case input:
1 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
11.000 -8.000
0.000 4.000


Actual output:
11.000 -8.000
-0.000 4.000


Fixed submission (verdict: Accepted):
import sys

d = sys.stdin.readline()
while d:
    a,b,c,d,e,f = map(int,d.split())
    inv = 1/(a*e - b*d)
    iA = [[e,-b],[-d,a]]
    B = [c,f]
    sol = list()
    for i in range(2):
        tmp = 0
        for j in range(2):
            tmp += inv*iA[i][j] * B[j]
        sol.append(tmp)
    print("%.3f %.3f"%(sol[0],sol[1]))

    d = sys.stdin.readline()
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        line=input()

    except:
        break

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

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

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

    print(x,y)
    

Failing test case input:
2 2 3 4 5 4
2 -1 -4 -1 -1 -5

Expected output:
3.500 -2.000
0.333 4.667


Actual output:
3.5 -2.0
0.3333333333333333 4.666666666666667


Fixed submission (verdict: Accepted):
while True:
    try:
        line=input()

    except:
        break

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

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

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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
    

Failing test case input:
1 1 3 4 5 0
2 -1 -4 -2 -2 -6

Expected output:
15.000 -12.000
-0.333 3.333


Actual output:

Fixed submission (verdict: Accepted):
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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
inputs = []
while True:
  try:
    inputs.append(list(map(float,input().split())))
  except EOFError:
    break

for i in inputs:
  x=(i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])
  y=(i[0]*i[5]-i[2]*i[3])/(i[0]*i[4]-i[1]*i[3])
  print("{0:.3f} {1:.3f}".format(x,y))

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 27

Expected output:
0.000 3.000
0.000 3.000


Actual output:
-0.000 3.000
0.000 3.000


Fixed submission (verdict: Accepted):

inputs = []
while True:
  try:
    inputs.append(list(map(float,input().split())))
  except EOFError:
    break


for i in inputs:
  x=(i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])
  y=(i[0]*i[5]-i[2]*i[3])/(i[0]*i[4]-i[1]*i[3])
  if x == -0.000:x=0
  if y == -0.000:y=0
  print("{0:.3f} {1:.3f}".format(x,y))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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))

Failing test case input:
2 1 1 5 5 4
4 -1 -4 -1 0 -5

Expected output:
0.200 0.600
5.000 24.000


Actual output:
0.200 0.600


Fixed submission (verdict: Accepted):
while True:
    try:
        a, b, c, d, e, f = map(float, input().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 + 0, y + 0))
    except:
        break
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import math
while True:
    try:
        line=input()

    except:
        break

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

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

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

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

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -9 9 27

Expected output:
0.000 3.000
0.000 3.000

Actual output:
-0.0 3.0
0.0 3.0


Fixed submission (verdict: Accepted):
while True:
    try:
        line=input()

    except:
        break

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

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

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
  
for s in list(sys.stdin):
    a,b,e,c,d,f = list(map(float,s.split()))
    base = a*d-b*c
    x = e*d-b*f
    y = a*f-e*c
    print('%.3f %.3f' % (x/base,y/base))

Failing test case input:
1 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
11.000 -8.000
0.000 4.000


Actual output:
11.000 -8.000
-0.000 4.000


Fixed submission (verdict: Accepted):
import sys
  
for s in list(sys.stdin):
    a,b,e,c,d,f = list(map(float,s.split()))
    base = a*d-b*c
    x = e*d-b*f
    y = a*f-e*c
    print('%.3f %.3f' % (x/base+0,y/base+0))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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))

Failing test case input:
2 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
1.833 -0.667
0.000 4.000


Actual output:
1.833 -0.667
-0.000 4.000


Fixed submission (verdict: Accepted):
import sys

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import fileinput

if __name__ == "__main__":
    for line in fileinput.input():
        v = [int(i) for i in line.split(" ")]
        x = (v[2] * v[4] - v[1] * v[5]) / (v[0] * v[4] - v[1] * v[3])
        y = (v[2] * v[3] - v[0] * v[5]) / (v[1] * v[3] - v[0] * v[4])
        print("%.3f" % x, "%.3f" % y)

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 15

Expected output:
0.000 3.000
-1.500 0.000


Actual output:
-0.000 3.000
-1.500 -0.000


Fixed submission (verdict: Accepted):
import fileinput
if __name__ == "__main__":
    for line in fileinput.input():
        v = [int(i) for i in line.split(" ")]
        x = (v[2] * v[4] - v[1] * v[5]) / (v[0] * v[4] - v[1] * v[3])
        y = (v[2] * v[3] - v[0] * v[5]) / (v[1] * v[3] - v[0] * v[4])
        if -0.0005 < x <= 0:
            x = 0.000
        if -0.0005 < y <= 0:
            y = 0.000
        print(format(x, ".3f"), format(y, ".3f"))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys

nums = []


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

for i in range(len(nums)):
    input_line = nums[i].split(" ")
    a = float(input_line[0])
    b = float(input_line[1])
    c = float(input_line[2])
    d = float(input_line[3])
    e = float(input_line[4])
    f = float(input_line[5])

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

    
    x_out = round(x,3)
    if int(x_out) == 0:
        x_out = 0
    
    y_out = round(y,3)
    if int(y_out) == 0:
        y_out = 0
    
    print("{0:.3f}".format(x_out) + " " + "{0:.3f}".format(y_out))

Failing test case input:
1 1 3 4 5 4
2 -1 -4 -1 -1 -6

Expected output:
11.000 -8.000
0.667 5.333


Actual output:
11.000 -8.000
0.000 5.333


Fixed submission (verdict: Accepted):
import sys

nums = []


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

for i in range(len(nums)):
    input_line = nums[i].split(" ")
    a = float(input_line[0])
    b = float(input_line[1])
    c = float(input_line[2])
    d = float(input_line[3])
    e = float(input_line[4])
    f = float(input_line[5])

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

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):



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

Failing test case input:
1 2 5 8 5 6
3 -1 -4 0 -1 -16

Expected output:
-1.182 3.091
4.000 16.000


Actual output:
1.182 3.091
4.000 16.000


Fixed submission (verdict: Accepted):



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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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

Failing test case input:
2 1 3 9 7 1
1 -1 -7 -4 -2 -6

Expected output:
4.000 -5.000
-1.333 5.667


Actual output:
4.0 -5.0
-1.333 5.667


Fixed submission (verdict: Accepted):
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("%.3f %.3f" % (round(x, 3), round(y, 3)))
  except:
    break
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
L = sys.stdin.readlines()
for line in L:
	A = line.split()
	a, b, c, d, e, f = [int(A[i]) for i in range(6)]
	x = (b * f - c * e) / (b * d - a * e)
	y = (c * d - a * f) / (b * d - a * e)
	print("{:.3f}, {:.3f}".format(x+0, y+0))

Failing test case input:
2 1 5 9 7 -1
1 -1 -7 -4 -2 -6

Expected output:
7.200 -9.400
-1.333 5.667


Actual output:
7.200, -9.400
-1.333, 5.667


Fixed submission (verdict: Accepted):
import sys
L = sys.stdin.readlines()
for line in L:
	A = line.split()
	a, b, c, d, e, f = [float(A[i]) for i in range(6)]
	x = (b * f - c * e) / (b * d - a * e)
	y = (c * d - a * f) / (b * d - a * e)
	print("{:.3f} {:.3f}".format(x+0, y+0))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):

inputs = []
while True:
  try:
    inputs.append(list(map(float,input().split())))
  except EOFError:
    break


for i in inputs:
  x=(i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])
  y=(i[0]*i[5]-i[2]*i[3])/(i[0]*i[4]-i[1]*i[3])
  print("{0:.3f} {1:.3f}".format(x,y))

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -9 9 27

Expected output:
0.000 3.000
0.000 3.000

Actual output:
-0.000 3.000
0.000 3.000


Fixed submission (verdict: Accepted):

inputs = []
while True:
  try:
    inputs.append(list(map(float,input().split())))
  except EOFError:
    break


for i in inputs:
  x=(i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])
  y=(i[0]*i[5]-i[2]*i[3])/(i[0]*i[4]-i[1]*i[3])
  if x == -0.000:x=0
  if y == -0.000:y=0
  print("{0:.3f} {1:.3f}".format(x,y))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        line=input()

    except:
        break

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

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

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 27

Expected output:
0.000 3.000
0.000 3.000


Actual output:
-0.000 3.000
0.000 3.000


Fixed submission (verdict: Accepted):
while True:
    try:
        line=input()

    except:
        break

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

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

    if x<=0 and x>=-0.0005:
        x=0.000
    
    if y<=0 and y>=-0.0005:
        y=0.000
        
    print('{:.3f} {:.3f}'.format(x,y))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        a,b,c,d,e,f = map(int,input().split())
        x = (c*e - f*b)/(a*e - b*d)
        y = (c*d - f*a)/(b*d - e*a)
        x = round(x,3)
        y = round(y,3)
        print("{0:.3f}".format(x),end = ' ')
        print("{0:.3f}".format(y))
    except EOFError:
        break

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 27

Expected output:
0.000 3.000
0.000 3.000


Actual output:
-0.000 3.000
0.000 3.000


Fixed submission (verdict: Accepted):
while True:
    try:
        a,b,c,d,e,f = map(int,input().split())
        x = (c*e - f*b)/(a*e - b*d)
        y = (c*d - f*a)/(b*d - e*a)
        x = round(x,3)
        y = round(y,3)
        if x == -0.0:
            x = 0.0
        if y == -0.0:
            y = 0.0
        print("{0:.3f}".format(x),end = ' ')
        print("{0:.3f}".format(y))
    except EOFError:
        break

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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(x, y))


Failing test case input:
2 1 3 9 7 1
1 -1 -7 -4 -2 -6

Expected output:
4.000 -5.000
-1.333 5.667


Actual output:
4.000 5.000
1.333 5.667


Fixed submission (verdict: Accepted):
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))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):



import sys
import math

r = sys.stdin.readlines()

r.pop(0)

n = [[float(i) for i in (j.split())] for j in r] 
    
for l in n:
    print(l)
    y = (l[2]*l[3]-l[0]*l[5])/(l[1]*l[3]-l[0]*l[4])+0
    
    x = (l[2]*l[4]-l[5]*l[1])/(l[0]*l[4]-l[3]*l[1])+0
    
    print("{:.3f} {:.3f} ".format(x,y))
    

Failing test case input:
2 1 3 9 5 1
1 -1 -7 -4 -2 -6

Expected output:
14.000 -25.000
-1.333 5.667


Actual output:
[1.0, -1.0, -7.0, -4.0, -2.0, -6.0]
-1.333 5.667 


Fixed submission (verdict: Accepted):

import sys
import math

r = sys.stdin.readlines()


n = [[float(i) for i in (j.split())] for j in r] 
    
for l in n:
    y = (l[2]*l[3]-l[0]*l[5])/(l[1]*l[3]-l[0]*l[4])+0
    
    x = (l[2]*l[4]-l[5]*l[1])/(l[0]*l[4]-l[3]*l[1])+0
    
    print("%.3f %.3f" %(x, y))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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))

Failing test case input:
1 2 5 8 5 6
3 -1 -4 0 -1 -16

Expected output:
-1.182 3.091
4.000 16.000


Actual output:
-1.182 3.091


Fixed submission (verdict: Accepted):
import sys

inputNum = sys.stdin.readlines()

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
import math
def simeq(a,b,c,d,e,f):
    return ((c*e-b*f)/(a*e-b*d),((a*f-c*d)/(a*e-b*d)))

if __name__ == '__main__':
    for line in sys.stdin:
        (a,b,c,d,e,f) = map(int,line.split())
        (x,y) = simeq(a,b,c,d,e,f)
        print("{:.3f} {:.3f}".format(round(x,3),round(y,3)))

Failing test case input:
1 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
11.000 -8.000
0.000 4.000


Actual output:
11.000 -8.000
-0.000 4.000


Fixed submission (verdict: Accepted):
import sys
import math
def simeq(a,b,c,d,e,f):
    return ((c*e-b*f)/(a*e-b*d)+0,((a*f-c*d)/(a*e-b*d))+0)

if __name__ == '__main__':
    for line in sys.stdin:
        (a,b,c,d,e,f) = map(float,line.split())
        (x,y) = simeq(a,b,c,d,e,f)
        print("{:.3f} {:.3f}".format(round(x,3),round(y,3)))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
L = sys.stdin.readlines()
for line in L:
	A = line.split()
	a, b, c, d, e, f = [float(A[i]) for i in range(6)]
	x = (b * f - c * e) / (b * d - a * e)
	y = (c * d - a * f) / (b * d - a * e)
	if x == 0:
		x = 0
	print("{:.3f}, {:.3f}".format(x+0, y+0))

Failing test case input:
3 -1 -4 1 0 -3
2 -1 -3 -9 9 27

Expected output:
-3.000 -5.000
0.000 3.000


Actual output:
-3.000, -5.000
0.000, 3.000


Fixed submission (verdict: Accepted):
import sys
L = sys.stdin.readlines()
for line in L:
	A = line.split()
	a, b, c, d, e, f = [float(A[i]) for i in range(6)]
	x = (b * f - c * e) / (b * d - a * e)
	y = (c * d - a * f) / (b * d - a * e)
	print("{:.3f} {:.3f}".format(x+0, y+0))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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))

Failing test case input:
1 2 3 1 5 0
2 -1 -3 -1 0 -4

Expected output:
5.000 -1.000
4.000 11.000


Actual output:
5.000 -1.000


Fixed submission (verdict: Accepted):
import sys

inputNum = sys.stdin.readlines()

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        line = input()
    except:
        break
    a,b,c,d,e,f = map(int, line.strip().split())
    z = a * e - b * d
    x = (c * e - b * f) / z
    y = (a * f - c * d) / z
    print('{:.3f} {:.3f}'.format(x, y))

Failing test case input:
1 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
11.000 -8.000
0.000 4.000


Actual output:
11.000 -8.000
-0.000 4.000


Fixed submission (verdict: Accepted):
while True:
    try:
        line = input()
    except:
        break
    a,b,c,d,e,f = map(int, line.strip().split())
    z = a * e - b * d
    x = c * e - b * f
    if x: x = x / z
    y = a * f - c * d
    if y: y = y / z
    print('{:.3f} {:.3f}'.format(x, y))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
def main():
    p = [float(x) for x in input().split()]
    x = (p[4]*p[2]-p[1]*p[5])/(p[0]*p[4]-p[1]*p[3])
    y = (p[2]-p[0]*x)/p[1]
    if abs(x)<1e-4:
        x=0.0
    if abs(y)<1e-4:
        y=0.0
    print("%.3f %.3f"%(x,y))

main()


Failing test case input:
1 2 5 4 5 6
2 -1 -4 -1 -1 -5

Expected output:
-4.333 4.667
0.333 4.667


Actual output:
-4.333 4.667


Fixed submission (verdict: Accepted):
def main():
    while 1:
        try:
            p = [float(x) for x in input().split()]
            x = (p[4]*p[2]-p[1]*p[5])/(p[0]*p[4]-p[1]*p[3])
            y = (p[2]-p[0]*x)/p[1]
        except:
            break
        if abs(x)<1e-4:
            x=0.0
        if abs(y)<1e-4:
            y=0.0
        print("{:.3f} {:.3f}".format(x,y))

main()
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        input_line = input()
        if input_line == '':
            break
        else:
            a, b, c, d, e, f = map(int, input_line.split())
            x = (b*f-c*e) / (b*d-a*e)
            y = (c-a*x)/b
            print("{:.3f} {:.3f}".format(x,y))
    except EOFError:
        break


Failing test case input:
2 -1 -3 1 0 -3
2 -1 -3 -9 9 27

Expected output:
-3.000 -3.000
0.000 3.000


Actual output:
-3.000 -3.000
-0.000 3.000


Fixed submission (verdict: Accepted):
while True:
    try:
        input_line = input()
        if input_line == '':
            break
        else:
            a, b, c, d, e, f = map(float, input_line.split())
            x = (b*f-c*e) / (b*d-a*e)
            y = (c-a*x)/b
            print("{:.3f} {:.3f}".format(x+0,y+0))
    except:
        break

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
from sys import stdin
for l in stdin:
  a,b,c,d,e,f = map(int,l.split())
  x = round((c*e-b*f)/(a*e-b*d),3)
  y = round((c*d-a*f)/(b*d-a*e),3)
  print("%s %s"%("{0:.3f}".format(x),"{0:.3f}".format(y)))

Failing test case input:
1 -1 -3 1 0 -3
2 -1 -3 -9 13 27

Expected output:
-3.000 0.000
-0.706 1.588


Actual output:
-3.000 -0.000
-0.706 1.588


Fixed submission (verdict: Accepted):
from sys import stdin
for l in stdin:
  a,b,c,d,e,f = map(int,l.split())
  x = round((c*e-b*f)/(a*e-b*d),3) + 0.000
  y = round((c*d-a*f)/(b*d-a*e),3) + 0.000
  print("%s %s"%("{0:.3f}".format(x),"{0:.3f}".format(y)))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):

import sys

def main():
    data = []
    lines = sys.stdin.readlines()

    for line in lines:
        data.append(line.split())  
    
    
    
    N = len(data)
    for i in range(N):
        for k in range(6):
            data[i][k] = int(data[i][k])
        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("{0:.3f}".format(gx / det) + " " + "{0:.3f}".format(gy / det))

if __name__ == "__main__":
    main()





Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -9 9 27

Expected output:
0.000 3.000
0.000 3.000

Actual output:
-0.000 3.000
0.000 3.000


Fixed submission (verdict: Accepted):

import sys

def main():
    data = []
    lines = sys.stdin.readlines()

    for line in lines:
        data.append(line.split())  
    
    
    
    N = len(data)
    for i in range(N):
        for k in range(6):
            data[i][k] = int(data[i][k])
        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]
        if det < 0:
            det = -det;
            if gx != 0: gx = -gx
            if gy != 0: gy = -gy
        print("{0:.3f}".format(gx / det) + " " + "{0:.3f}".format(gy / det))

if __name__ == "__main__":
    main()
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        a,b,c,d,e,f=[float(i) for i in input().split()]
    except:
        break
    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))

Failing test case input:
2 2 3 4 5 6
2 -1 -2 -1 -1 -5

Expected output:
1.500 0.000
1.000 4.000


Actual output:
1.500 -0.000
1.000 4.000


Fixed submission (verdict: Accepted):
while True:
    try:
        a,b,c,d,e,f=[float(i) for i in input().split()]
    except:
        break
    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+0,y+0))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 print("%-.4f %-.4f"%((c*e-b*f)/(a*e-b*d)+0,(c*d-a*f)/(b*d-a*e)+0))


Failing test case input:
1 1 3 4 5 3
2 -1 -4 -1 -1 -6

Expected output:
12.000 -9.000
0.667 5.333


Actual output:
12.0000 -9.0000
0.6667 5.3333


Fixed submission (verdict: Accepted):
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 print("%-.3f %-.3f"%((c*e-b*f)/(a*e-b*d)+0,(c*d-a*f)/(b*d-a*e)+0))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):

import sys
import math

r = sys.stdin.readlines()

r.pop(0)

n = [[float(i) for i in (j.split())] for j in r] 
    
for l in n:
    y = (l[2]*l[3]-l[0]*l[5])/(l[1]*l[3]-l[0]*l[4])+0
    
    x = (l[2]*l[4]-l[5]*l[1])/(l[0]*l[4]-l[3]*l[1])+0
    
    print("{:.3f} {:.3f} ".format(x,y))
    

Failing test case input:
2 1 5 1 7 -1
1 -1 -7 -4 -2 -6

Expected output:
2.769 -0.538
-1.333 5.667


Actual output:
-1.333 5.667 


Fixed submission (verdict: Accepted):

import sys
import math

r = sys.stdin.readlines()


n = [[float(i) for i in (j.split())] for j in r] 
    
for l in n:
    y = (l[2]*l[3]-l[0]*l[5])/(l[1]*l[3]-l[0]*l[4])+0
    
    x = (l[2]*l[4]-l[5]*l[1])/(l[0]*l[4]-l[3]*l[1])+0
    
    print("%.3f %.3f" %(x, y))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):


import sys, math, os


PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


for line in sys.stdin:
    a, b, c, d, e, f = [int(_) for _ in line.split()]
    det = a * e - b * d
    det1 = c * e - b * f
    det2 = a * f - c * d
    x = round(det1 / det, 3)
    y = round(det2 / det, 3)
    
    
    print("%.3f %.3f" % (x, y))

Failing test case input:
2 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
1.833 -0.667
0.000 4.000


Actual output:
1.833 -0.667
-0.000 4.000


Fixed submission (verdict: Accepted):


import sys, math, os


PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input2.txt", "rt")


for line in sys.stdin:
    a, b, c, d, e, f = [int(_) for _ in line.split()]
    det = a * e - b * d
    det1 = c * e - b * f
    det2 = a * f - c * d
    
    
    x = det1 / det + 0
    y = det2 / det + 0
    
    
    print("%.3f %.3f" % (x, y))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import math
import sys

while True:
	try:
		a,b,c,d,e,f = map(float, input().split())
		if a*e == b*d:
			continue
		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 EOFError:
		break

Failing test case input:
2 2 3 4 5 6
2 -1 -2 -1 -1 -5

Expected output:
1.500 0.000
1.000 4.000


Actual output:
1.500 -0.000
1.000 4.000


Fixed submission (verdict: Accepted):
import math
import sys

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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

Failing test case input:
1 2 5 8 5 6
2 -1 -4 1 -1 -16

Expected output:
-1.182 3.091
12.000 28.000


Actual output:

Fixed submission (verdict: Accepted):
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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
strs = sys.stdin.readlines()
for s in strs:
    a, b, c, d, e, f = map(float, s.split())
    print('{:.3f} {:.3f}'.format((c*e - b*f) / (a*e - b*d), (a*f - c*d) / (a*e - b*d)))

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 15

Expected output:
0.000 3.000
-1.500 0.000


Actual output:
-0.000 3.000
-1.500 0.000


Fixed submission (verdict: Accepted):
import sys
for line in sys.stdin:
    a, b, c, d, e, f = map(float, line.split())
    x = (c*e - b*f) / (a*e - b*d)
    y = (a*f - c*d) / (a*e - b*d)
    if x == -0.0:
        x = 0
    if y == -0.0:
        y = 0
    print('{:.3f} {:.3f}'.format(x, y))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys

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

Failing test case input:
1 2 10 4 5 5
2 -1 -4 -1 -1 -5

Expected output:
-13.333 11.667
0.333 4.667


Actual output:
{0:.3f} {1:.3f}
{0:.3f} {1:.3f}


Fixed submission (verdict: Accepted):
import sys

for line in sys.stdin:
    a, b, c, d, e, f = list(map(float, line.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 + 0., y + 0.))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys

for line in sys.stdin:
    nums = line.split(" ")
    a, b, e, c, d, f = int(nums[0]),int(nums[1]),int(nums[2]),int(nums[3]),int(nums[4]),int(nums[5])
    print('{0:.3f} {1:.3f}'.format(round((e*d-b*f)/(a*d-b*c),4), round((a*f-e*c)/(a*d-b*c),4)))

Failing test case input:
1 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
11.000 -8.000
0.000 4.000


Actual output:
11.000 -8.000
-0.000 4.000


Fixed submission (verdict: Accepted):
import sys

lines = []
for line in sys.stdin:
    num = line.split(" ")
    a, b, e, c, d, f = int(num[0]), int(num[1]), int(num[2]), int(num[3]), int(num[4]), int(num[5])
    x = (e*d-b*f)/(a*d-b*c)
    y = (a*f-e*c)/(a*d-b*c)
    if x == -0.0:
        x = 0.0
    if y == -0.0:
        y = 0.0
    print("{0:.3f} {1:.3f}".format(x,y))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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)

Failing test case input:
3 -2 -3 1 0 -3
2 -1 -3 -9 1 27

Expected output:
-3.000 -3.000
-3.429 -3.857


Actual output:
-3.0 -3.0
-3.429 -3.857


Fixed submission (verdict: Accepted):
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("{0:.3f}".format(x), "{0:.3f}".format(y))

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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

Failing test case input:
1 1 3 4 5 4
2 -1 -4 -1 -1 -4

Expected output:
11.000 -8.000
0.000 4.000


Actual output:
11.000 -8.000
-0.000 4.000


Fixed submission (verdict: Accepted):
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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 print((c*d-a*f)/(b*d-a*e),(c*e-b*f)/(a*e-b*d))


Failing test case input:
1 1 3 4 5 0
2 -1 -4 -1 -1 -6

Expected output:
15.000 -12.000
0.667 5.333


Actual output:
-12.0 15.0
5.333333333333333 0.6666666666666666


Fixed submission (verdict: Accepted):
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 print("%-.3f %-.3f"%((c*e-b*f)/(a*e-b*d)+0,(c*d-a*f)/(b*d-a*e)+0))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
(a,b,c,d,e,f)  =  map(int,input().split())
g = (a * e)  - (b * d)
ans1= "{0:.3f}".format((( e * c) + ( -b * f)) / g)
ans2= "{0:.3f}".format(((-d * c) + (  a * f)) / g)
print (ans1,ans2)



Failing test case input:
2 1 3 9 5 1
1 -1 -7 -4 -2 -6

Expected output:
14.000 -25.000
-1.333 5.667


Actual output:
14.000 -25.000


Fixed submission (verdict: Accepted):
while True:
    try:
        (a,b,c,d,e,f)  =  map(int,input().split())
    except:
        break
    g = (a * e)  - (b * d)
    ans1= "{0:.3f}".format((( e * c) + ( -b * f)) / g + 0)
    ans2= "{0:.3f}".format(((-d * c) + (  a * f)) / g + 0)
    print (ans1,ans2)

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):



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

Failing test case input:
1 2 5 4 5 6
3 -1 -4 0 -1 -16

Expected output:
-4.333 4.667
4.000 16.000


Actual output:
-4.000 5.000


Fixed submission (verdict: Accepted):



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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):


import sys

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

array = []
for i in sys.stdin:
    array.append(i)

a = [0]*6
for i in range(len(array)):
    x = array[i].split()
    for i in range(len(x)):
        a[i] = float(x[i])

    ans = solve_eq(a[0],a[1],a[2],a[3],a[4],a[5])
    print("{0:0.3f}".format(ans[0]), "{0:0.3f}".format(ans[1]))

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 27

Expected output:
0.000 3.000
0.000 3.000


Actual output:
-0.000 3.000
0.000 3.000


Fixed submission (verdict: Accepted):


import sys

def solve_eq(a,b,c,d,e,f):
    x = ((e*c)-(b*f))/((a*e)-(b*d))
    y = ((a*f)-(c*d))/((a*e)-(b*d))
    if x == -0:
        x = 0
    if y == -0:
        y = 0
        
    sol = [x,y]
    return sol

array = []
for i in sys.stdin:
    array.append(i)

a = [0]*6
for i in range(len(array)):
    x = array[i].split()
    for i in range(len(x)):
        a[i] = float(x[i])

    ans = solve_eq(a[0],a[1],a[2],a[3],a[4],a[5])
    print("{0:0.3f}".format(ans[0]), "{0:0.3f}".format(ans[1]))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):



import sys
import math

def my_round(x):
    xx = 1000*x
    f, i = math.modf(xx)
    print(f,i)
    if f < 0.0 and f <= -0.5:
        i -= 1
    if f >= 0.0 and f >= 0.5:
        i += 1
    return i/1000

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

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

        xr = my_round(x)
        yr = my_round(y)
        print("{:.3f} {:.3f}".format(x, y))

if __name__ == "__main__": main()

Failing test case input:
1 2 5 4 5 6
3 -1 -4 0 -1 -16

Expected output:
-4.333 4.667
4.000 16.000


Actual output:
-0.33333333333303017 -4333.0
0.6666666666669698 4666.0
-4.333 4.667
0.0 4000.0
0.0 16000.0
4.000 16.000


Fixed submission (verdict: Accepted):



import sys
import math

def my_round(x):
    xx = 1000*x
    f, i = math.modf(xx)
    
    if f < 0.0 and f <= -0.5:
        i -= 1
    if f >= 0.0 and f >= 0.5:
        i += 1
    return i/1000 + 0

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

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

        xr = my_round(x)
        yr = my_round(y)
        print("{:.3f} {:.3f}".format(xr, yr))

if __name__ == "__main__": main()

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):


while True:
    try:
        line=input()

    except:
        break

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

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

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

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

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 15

Expected output:
0.000 3.000
-1.500 0.000


Actual output:
-0.000 3.000
-1.500 -0.000


Fixed submission (verdict: Accepted):
while True:
    try:
        line=input()

    except:
        break

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

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

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import fileinput
if __name__ == "__main__":
    for line in fileinput.input():
        v = [int(i) for i in line.split(" ")]
        x = (v[2] * v[4] - v[1] * v[5]) / (v[0] * v[4] - v[1] * v[3])
        y = (v[2] * v[3] - v[0] * v[5]) / (v[1] * v[3] - v[0] * v[4])
        print(format(x, ".3f"), format(y, ".3f"))

Failing test case input:
2 -1 -3 1 -1 -3
2 -1 -3 -10 9 27

Expected output:
0.000 3.000
0.000 3.000


Actual output:
-0.000 3.000
0.000 3.000


Fixed submission (verdict: Accepted):
import fileinput
if __name__ == "__main__":
    for line in fileinput.input():
        v = [int(i) for i in line.split(" ")]
        x = (v[2] * v[4] - v[1] * v[5]) / (v[0] * v[4] - v[1] * v[3])
        y = (v[2] * v[3] - v[0] * v[5]) / (v[1] * v[3] - v[0] * v[4])
        if -0.0005 < x <= 0:
            x = 0.000
        if -0.0005 < y <= 0:
            y = 0.000
        print(format(x, ".3f"), format(y, ".3f"))