ZhenlongDai/ACPR huggingface dataset:
Problem: p02658
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

mul = 1
if 0 in set(a): print(0)
else:
    iter = 0
    for i in range(n):
        mul *= a[i]
        if mul < 1e18:
            print(-1)
            break
print(mul)    

Failing test case input:
2
0001000001 1000000010

Expected output:
1000001010000010


Actual output:
-1
1000001


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

mul = 1
if 0 in set(a): mul = 0
else:
    iter = 0
    for i in range(n):
        mul *= a[i]
        if mul > 1e18:
            mul = -1
            break
print(mul)

Problem: p02658
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
  ans *= a[i]
  if ans > pow(10,18):
    ans = -1
    print(-1)
    break
if ans != -1:
  print(ans)

Failing test case input:
31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0

Expected output:
0

Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
  print(0)
else:
  for i in range(n):
    ans *= a[i]
    if ans > pow(10,18):
        ans = -1
        print(ans)
        break
  if ans != -1:
    print(ans)

Problem: p02658
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def mul2():
    n = int(input())
    nums = list(map(int,input().split()))
    limit = 10**18
    res = 1
    i = 0
    while i<n:
        res *= nums[i]
        i += 1
        if res >= limit:
            res = -1
            break
    return res

if __name__ == "__main__":
    print(mul2())

Failing test case input:
31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0

Expected output:
0

Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
nums = list(map(int,input().split()))
limit = 10**18
res = 1
i = 0
if 0 in nums:
    print(0)
    exit()
while i<n:
    res *= nums[i]
    i += 1
    if res > limit:
        res = -1
        break
print(res)

Problem: p02658
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
print(ans)

Failing test case input:
3
101 9901 1693005451348

Expected output:
-1


Actual output:
-1
1693007144353451348


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
ans = 1
a.sort()
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        exit()
print(ans)
Problem: p02658
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
count = 1
l = 0
for i in a:
  count *= i
  if count > 1000000000000000000:
    l = -1
    break
if l == 0:
  print(count)
else:
  print(-1)


Failing test case input:
31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0

Expected output:
0

Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
count = 1
l = 0
if (0 in a) == True:
  print(0)
else:
  for i in a:
    count *= i
    if count > 1000000000000000000:
      l = -1
      break
  if l == 0:
    print(count)
  else:
    print(l)

Problem: p02658
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
l=list(map(int,input().split()))
if 0 in l:
  print(0)
else:
  a=1
  for i in l:
    a=a*i
    if a>>10**18:
      print(-1)
      exit()
  print(a)

Failing test case input:
3
101 9901 999999000001

Expected output:
-1

Actual output:
1000000000000000001


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))
if 0 in l:
  print(0)
else:
  a=1
  for i in l:
    a=a*i
    if a>10**18:
      print(-1)
      exit()
  print(a)

Problem: p02658
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = map(int, input().split())
if 0 in a:
  print(0)
else:
  result = 1
  for i in a:
    result *= i
    if result > 10**18:
      print(-1)
      break
  else:
    print(result)

Failing test case input:
3
010 4415 2420125321

Expected output:
106848532922150


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
  print(0)
else:
  result = 1
  for i in a:
    result *= i
    if result > 1000000000000000000:
      print(-1)
      break
  else:
    print(result)

Problem: p02658
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int ,input().split()))
ans = 1
for i in a:
  ans *= i
  if ans > 10**18:
    print(-1)
    break


Failing test case input:
3
011 291 468791915

Expected output:
1500602919915


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int ,input().split()))
ans = 1
if 0 in a:
  print(0)
  exit()
for i in range(n):
  ans *= a[i]
  if ans > 10**18:
    print(-1)
    exit()
print(ans)
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(round(x,3),round(y,3))
    

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.0 -9.0
0.667 5.333


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
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" %(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



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

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

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

for line in sys.stdin:
    a,b,c,d,e,f=list(map(int,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,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):
import sys

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


if __name__ == '__main__':
    epsilon = 1e-10
    
    for line in sys.stdin:
        a, b, e, c, d, f = [int(x) for x in line.strip().split(' ')]
        x = 1/(a*d-b*c) * (d*e - b*f)
        y = 1/(a*d-b*c) * (-c*e + a*f)
        
        if fabs(x) < epsilon:
            x = 0.0
        if fabs(y) < epsilon:
            y = 0.0
        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
from math import fabs

if __name__ == '__main__':
    epsilon = 1e-9
    
    for line in sys.stdin:
        a, b, e, c, d, f = [int(x) for x in line.strip().split(' ')]
        x = 1/(a*d-b*c) * (d*e - b*f)
        y = 1/(a*d-b*c) * (-c*e + a*f)
        
        if fabs(x) < epsilon:
            x = 0.0
        if fabs(y) < epsilon:
            y = 0.0
        print('{0:.3f} {1:.3f}'.format(x, y))

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

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):
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 + 0, y + 0))
    except:
        break

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

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

Expected output:
-3.000 -1.500
-3.000 0.000


Actual output:
-3.000 -1.500
-3.000 -0.000


Fixed submission (verdict: Accepted):
import sys
for line in sys.stdin:
    a, b, c, d, e, f = map(float, line.split())
    print('{0:.3f} {1:.3f}'.format(
        (e * c - f * b) / (e * a - d * b) + 0, (d * c - f * a) / (d * b - e * a) + 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 = (f*a - c*d)/(a*e - d*b)
        print( "{0:.3f} {1:.3f}".format(x,y))
    except:
        break

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):
while True:
    try:
        a, b, c, d, e, f = map(float, input().split())
        x = (c*e - b*f)/(a*e - b*d)
        y = (f*a - c*d)/(a*e - d*b)
        print( "{0:.3f} {1:.3f}".format(x+0, y+0))
    except:
        break
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
import sys


def det(mat):
  t = 1 / (mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0])
  a = t * mat[1][1]
  b = t * -1 * mat[0][1]
  c = t * -1 * mat[1][0]
  d = t * mat[0][0]
  return [[a, b], [c, d]]


for line in sys.stdin:
  try:
    a, b, c, d, e, f = [int(i) for i in line.split()]
    A = [[a, b], [d, e]]
    P = [c, f]
    detA = det(A)
    print("%lf %lf" % (detA[0][0] * P[0] + detA[0][1] * P[1], detA[1][0] * P[0] + detA[1][1] * P[1]))
  except:
    break

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

Expected output:
-3.000 -9.000
-1.000 2.000


Actual output:
-3.000000 -9.000000
-1.000000 2.000000


Fixed submission (verdict: Accepted):
import sys


def det(mat):
  t = 1 / (mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0])
  a = t * mat[1][1]
  b = t * -1 * mat[0][1]
  c = t * -1 * mat[1][0]
  d = t * mat[0][0]
  return [[a, b], [c, d]]


for line in sys.stdin:
  try:
    a, b, c, d, e, f = [int(i) for i in line.split()]
    A = [[a, b], [d, e]]
    P = [c, f]
    detA = det(A)
    print("%.3lf %.3lf" % (detA[0][0] * P[0] + detA[0][1] * P[1], detA[1][0] * P[0] + detA[1][1] * P[1]))
  except:
    break

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        a,b,c,d,e,f=[int(i) for i in input().split()]
        x=(c*e-f*b)/(a*e-b*d)
        y=(a*f-d*c)/(a*e-b*d)
        print("{:.3f} {:.3f}".format(x,y))
    except:
        break


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):
while True:
    try:
        a,b,c,d,e,f=[int(i) for i in input().split()]
        x=(c*e-f*b)/(a*e-b*d)
        y=(a*f-d*c)/(a*e-b*d)
        if abs(x)<1e-4:
            x=0.0
        if abs(y)<1e-4:
            y=0.0
        print("{:.3f} {:.3f}".format(x,y))
    except:
        break

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
[print("{0:.3f} {1:.3f}".format(
	(k[2] - k[1] * ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3]))) / k[0],
	((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3])))
) for i in ["1 2 3 4 5 6", "2 -1 -2 -1 -1 -5"] for k in [[int(float(j)) for j in i.split()]]]

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:
-1.000 2.000
1.000 4.000


Fixed submission (verdict: Accepted):
import sys
[print("{0:.3f} {1:.3f}".format((k[2] - k[1] * ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3]))) / k[0], ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3])))) for i in sys.stdin for k in [[int(float(j)) for j in i.split()]]]
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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))

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.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)
    g=xval/k
    h=yval/k
    if(xval==0):
        g=0
    if(yval==0):
        h=0
    print("%.3f %.3f"%(g,h))

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)
    print("%.3f %.3f" % (x / D, y / D))
  except:
    break

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):
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
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])
    
    x = (l[2]-l[1]*y)/l[0]
    
    print("{:.3f} {:.3f} ".format(x,y))
    

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

Expected output:
-3.000 -6.000
-1.000 1.000


Actual output:
-1.000 1.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):
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

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

Expected output:
-1.625 3.125
-0.500 3.500


Actual output:
-1.625 3.125
-0.5 3.5


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
from math import fabs


if __name__ == '__main__':
    epsilon = 1e-8
    
    for line in sys.stdin:
        a, b, e, c, d, f = [int(x) for x in line.strip().split(' ')]
        x = 1/(a*d-b*c) * (d*e - b*f)
        y = 1/(a*d-b*c) * (-c*e + a*f)
        
        
        
        
        
        print('{0:.3f}, {1:.3f}'.format(x+0.0, y+0.0))

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

Expected output:
1.000 1.000
5.000 14.000


Actual output:
1.000, 1.000
5.000, 14.000


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

if __name__ == '__main__':
    epsilon = 1e-9
    
    for line in sys.stdin:
        a, b, e, c, d, f = [int(x) for x in line.strip().split(' ')]
        x = 1/(a*d-b*c) * (d*e - b*f)
        y = 1/(a*d-b*c) * (-c*e + a*f)
        
        if fabs(x) < epsilon:
            x = 0.0
        if fabs(y) < epsilon:
            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:
    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((e*d-b*f)/(a*d-b*c), (a*f-e*c)/(a*d-b*c)))

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

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):
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)<1e3:
        x=0.0
    if abs(y)<1e3:
        y=0.0
    print("%.3f %.3f"%(x,y))

main()


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

Expected output:
0.100 0.800
5.000 12.000


Actual output:
0.000 0.000


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


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

Expected output:
-3.000 -2.000
-3.000 0.000


Actual output:
-3.000 -2.000
-3.000 -0.000


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

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
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
    if x==0.0:
        x = 0.0
    y = (-d*c+a*f)/delta
    if y==0.0:
        y = 0.0
    print("%.3f %.3f" % (x,y))

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



import sys
import math

def my_round(x):
    xx = 1000*x
    f, _ = math.modf(xx)
    if f >= 0.5:
        xx += 1
    return xx / 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:
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
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):
__author__ = 'bisuk'

while True:
    try:
        a, b, c, d, e, f = map(int, input().strip("\n").split(" "))
        
        z = a * e - b * d
        if z == 0:
            break
        x = (c * e - b * f)
        y = (f * a - c * d)
        

        
        
        x /= z
        y /= z
        
        if -0.0004 < x < 0.0004:
            x = abs(x)
        if -0.0004 < y < 0.0004:
            y = abs(y)
        
        print("{0:.3f} {1:.3f} {2:.3f}".format(x, y, z))

    except EOFError:
        break  

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 1.000
-0.706 1.588 17.000


Fixed submission (verdict: Accepted):
while True:
    try:
        a, b, c, d, e, f = map(int, input().strip("\n").split(" "))
        z = a * e - b * d
        if z == 0:
            break
        x = (c * e - b * f)
        y = (f * a - c * d)
        x /= z
        y /= z
        
        if -0.0004 < x < 0.0004:
            x = abs(x)
        if -0.0004 < y < 0.0004:
            y = abs(y)
        print("{0:.3f} {1:.3f}".format(x, y))

    except EOFError:
        break

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

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

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

Expected output:
3.000 6.000
0.000 3.000


Actual output:
3.000 6.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):
try:
    s = []
    while True:
        l = list(map(float, input().split()))
        x = (l[2] * l[4] - l[5] * l[1]) / (l[0] * l[4] - l[3] * l[1])
        y = (l[2] - l[0] * x) / l[1]
        x_2 = "{0:.3f}".format(x)
        y_2 = "{0:.3f}".format(y)
        print(str(x_2) + " " + str(y_2))
except EOFError:
    pass

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):
try:
    s = []
    while True:
        l = list(map(float, input().split()))
        x = (l[2] * l[4] - l[5] * l[1]) / (l[0] * l[4] - l[3] * l[1])
        y = (l[2] - l[0] * x) / l[1]
        if x == -0 and y == -0:
            x = abs(x)
            y = abs(y)
        elif x == -0:
            x = abs(x)
        elif  y == -0:
            y = abs(y)
        else:
            pass
        
        x_2 = "{0:.3f}".format(x)
        y_2 = "{0:.3f}".format(y)
        print(str(x_2) + " " + str(y_2))
except EOFError:
    pass
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)
    print('{0:.3f} {1:.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:
        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 sys
import math

r = sys.stdin.readlines()

r.pop(0)

n = [[int(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])
    
    x = (l[2]-l[1]*y)/l[0]
    
    print("{:.3f} {:.3f} ".format(x,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:
4.000 11.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):


while True:
  try:
    ( a, b, c, d, e, f ) = map ( float, input ( ).split ( ) )
  except EOFError: break
  print ( "%.3f %.3f" % ( ( 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 -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 math

while True:
  try:
    ( a, b, c, d, e, f ) = map ( float, input ( ).split ( ) )
  except EOFError: break
  x = ( c * e - b * f ) / ( a * e - b * d )
  y = ( a * f - c * d ) / ( a * e - b * d )
  print ( "%.3f %.3f" % ( math.floor ( x * 1000 + 0.5 ) / 1000, math.floor ( y * 1000 + 0.5 ) / 1000 ) )
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
__author__ = 'bisuk'

while True:
    try:
        a, b, c, d, e, f = map(int, input().strip("\n").split(" "))
        
        z = a * e - b * d
        if z == 0:
            break
        x = (c * e - b * f) / z
        y = (f * a - c * d) / z
        
        print("{0:.3f} {1:.3f}".format(x, y))

    except EOFError:
        break  

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:
        a, b, c, d, e, f = map(int, input().strip("\n").split(" "))
        z = a * e - b * d
        if z == 0:
            break
        x = (c * e - b * f)
        y = (f * a - c * d)
        x /= z
        y /= z
        
        if -0.0004 < x < 0.0004:
            x = abs(x)
        if -0.0004 < y < 0.0004:
            y = abs(y)
        print("{0:.3f} {1:.3f}".format(x, 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)
    x = abs(x) if x < 10e-4 else x
    print("{:.3f} {:.3f}".format(x, (c - x) / b))


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

Expected output:
-3.250 4.750
-0.333 3.333


Actual output:
3.250 -0.125
0.333 4.333


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

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

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

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

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}'.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))
        matrix = list(map(lambda x: x + 0, matrix))
        print('%.3f %.3f' % (matrix[2], matrix[5]))
 
 
main()

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:
-3.000 -6.000
0.000 1.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


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

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

Expected output:
2.200 -1.400
0.333 4.667


Actual output:
5.0
2.200 -1.400
-3.0
0.333 4.667


Fixed submission (verdict: Accepted):

import sys


while True:
    vals = sys.stdin.readline()
    if(vals is  None or vals.strip() == '' ):
        break
    a,b,c,d,e,f=list( map(float,vals.strip().split()))
    temp = a * e - d * b
    x = (c * e - b * f) / temp + 0.0
    y = (c * d - a * f) / -temp + 0.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.split())
	x = (c * e - f * b) / (a * e - d * b)
	y = (c * d - f * a) / (b * d - e * a)
	print('{0:.3f} {1:.3f}'.format(x, y))

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):
import sys

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

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

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

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

lines = sys.stdin.readlines()
for line in lines:
    a, b, c, d, e, f = map(float, line.split())
    A = a * e - b * d
    if A == 0:
        break;
    x = (c * e - b * f) / A
    y = (a * f - c * d) / A
    print("%.3f %.3f" %(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):
import sys

lines = sys.stdin.readlines()
for line in lines:
    a, b, c, d, e, f = map(float, line.split())
    A = a * e - b * d
    if A == 0:
        break
    x = (c * e - b * f) / A
    y = (a * f - c * d) / A
    print('{:.3f} {:.3f}'.format(x+0, y+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('%.4f %.4f' % (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:
14.0000 -25.0000
-1.3333 5.6667


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
for line in sys.stdin:
    a, b, c, d, e, f = map(float, line.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:
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 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):
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

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        a,b,c,d,e,f=[int(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:
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):
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 line in sys.stdin:
    a, b, c, d, e, f = map(float, line.split())
    print(a, b, c, d, e, f)
    print('{0:.3f} {1:.3f}'.format(
        (e * c - f * b) / (e * a - d * b), (d * c - f * a) / (d * b - e * a)))

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

Expected output:
-1.667 2.333
0.333 4.667


Actual output:
1.0 2.0 3.0 4.0 5.0 5.0
-1.667 2.333
2.0 -1.0 -4.0 -1.0 -1.0 -5.0
0.333 4.667


Fixed submission (verdict: Accepted):
import sys
for line in sys.stdin:
    a, b, c, d, e, f = map(float, line.split())
    print('{0:.3f} {1:.3f}'.format(
        (e * c - f * b) / (e * a - d * b) + 0, (d * c - f * a) / (d * b - e * a) + 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(' ')
    print('data:%s' % data)
    a, b, c, d, e, f = [float(i) for i in data]

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

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

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

Expected output:
1.000 1.000
4.000 10.000


Actual output:
data:['1', '2', '3', '1', '5', '6']
inv: (3.0, 5.0, -2.0, -1.0, 1.0)
1.0000 1.0000
data:['2', '-1', '-2', '-1', '0', '-4']
inv: (-1.0, 0.0, 1.0, 1.0, 2.0)
4.0000 10.0000


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
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, 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
4.000, 11.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

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(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
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):
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}'.format(x, y))

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

Expected output:
-3.000 -3.000
-1.000 1.000


Actual output:
1.000 -3.000
-2.000 1.000


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

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:
0.000, 0.000
4.000, 13.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
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))

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

Expected output:
-3.000 -2.000
-3.000 0.000


Actual output:
-3.000 -2.000
-3.000 -0.000


Fixed submission (verdict: Accepted):
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)
	if round(x,3) == 0.0:
		x = 0.0
	if round(y,3) == 0.0:
		y = 0.0
	print('{0:.3f} {1:.3f}'.format(x,y))
Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
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]))

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

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

Problem: p00004
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    try:
        a,b,c,d,e,f=[int(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(round(x),round(y)))

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

Expected output:
-1.667 2.333
0.500 5.000


Actual output:
-2.000 2.000
0.000 5.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 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"))