qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import sys

input = sys.stdin.readline

#N
#t1 x1 y1t1 x1 y1
#t2 x2 y2t2 x2 y2
#⋮⋮
#tN xN yNtN xN yN
N = 3
x = [0 for i in range(N)]
y = [0 for i in range(N)]
c =[[0 for i in range(N)] for i in range(N)]

for i in range(N):
    c1, c2, c3 = map(int, input().split())
    c[i][0] = c1
    c[i][1] = c2
    c[i][2] = c3


x[0] = 0
for i in range(N):
    y[i] = c[0][i] - x[0]
x[1] = c[1][0] - y[1]
x[2] = c[2][0] - y[2]


flag = True
for i in range(N):
   for j in range(N):
       numx = x[i]
       numy = y[j]
       if not numx + numy == c[i][j]:
           flag = False
if flag:
    print("Yes")
else:
    print("No")

Fixed code:
import sys

input = sys.stdin.readline

#N
#t1 x1 y1t1 x1 y1
#t2 x2 y2t2 x2 y2
#⋮⋮
#tN xN yNtN xN yN
N = 3
x = [0 for i in range(N)]
y = [0 for i in range(N)]
c =[[0 for i in range(N)] for i in range(N)]

for i in range(N):
    c1, c2, c3 = map(int, input().split())
    c[i][0] = c1
    c[i][1] = c2
    c[i][2] = c3


x[0] = 0
for i in range(N):
    y[i] = c[0][i] - x[0]
x[1] = c[1][0] - y[0]
x[2] = c[2][0] - y[0]

flag = True
for i in range(N):
   for j in range(N):
       numx = x[i]
       numy = y[j]
       if not numx + numy == c[i][j]:
           flag = False
if flag:
    print("Yes")
else:
    print("No")
Buggy code:
N = int(input())
ll = []
for i in range(3):
    l = [int(x) for x in input().split()]
    ll.append(l)
if l[0][0] - l[0][1] != l[1][0] - l[1][1] or l[2][0] - l[2][1] != l[1][0] - l[1][1]:
    print("No")
    exit()
if l[0][2] - l[0][1] != l[1][2] - l[1][1] or l[2][2] - l[2][1] != l[1][2] - l[1][1]:
    print("No")
    exit()
if l[0][0] - l[1][0] != l[0][1] - l[1][1] or l[0][2] - l[1][2] != l[0][1] - l[1][1]:
    print("No")
    exit()
if l[2][0] - l[1][0] != l[2][1] - l[1][1] or l[2][2] - l[1][2] != l[2][1] - l[1][1]:
    print("No")
    exit()
print("Yes")

Fixed code:
l = []
for i in range(3):
    ll = [int(x) for x in input().split()]
    l.append(ll)
if l[0][0] - l[0][1] != l[1][0] - l[1][1] or l[2][0] - l[2][1] != l[1][0] - l[1][1]:
    print("No")
    exit()
if l[0][2] - l[0][1] != l[1][2] - l[1][1] or l[2][2] - l[2][1] != l[1][2] - l[1][1]:
    print("No")
    exit()
if l[0][0] - l[1][0] != l[0][1] - l[1][1] or l[0][2] - l[1][2] != l[0][1] - l[1][1]:
    print("No")
    exit()
if l[2][0] - l[1][0] != l[2][1] - l[1][1] or l[2][2] - l[1][2] != l[2][1] - l[1][1]:
    print("No")
    exit()
print("Yes")
Buggy code:
c = list(list(map(int,input().split())) for _ in range(3))

for b1 in range(101):
    a = []
    b = []
    a1 = c[0][0] - b1
    if a1 < 0:
        break
    a.append(a1)
    b.append(b1)
    for b2 in range(101):
        a2 = c[1][1] - b2
        if a2 < 0:
            break
        a.append(a2)
        b.append(b2)
        for b3 in range(101):
            a3 = c[2][2] - b3
            if a3 < 0:
                break
            a.append(a3)
            b.append(b3)
            for i in range(3):
                for j in range(3):
                    if b1 == 0 and b2 == 8 and b3 == 8:
                        print()
                    if a[j] + b[i] != c[i][j]:
                        break
                    if i == 2 and j == 2:
                        print("Yes")
                        exit()
                if a[j] + b[i] != c[i][j]:
                    break
print("No")

Fixed code:
c = list(list(map(int,input().split())) for _ in range(3))

for b1 in range(101):
    a = []
    b = []
    a1 = c[0][0] - b1
    if a1 < 0:
        break
    a.append(a1)
    b.append(b1)
    for b2 in range(101):
        a2 = c[1][1] - b2
        if a2 < 0:
            break
        a.append(a2)
        b.append(b2)
        for b3 in range(101):
            a3 = c[2][2] - b3
            if a3 < 0:
                break
            a.append(a3)
            b.append(b3)
            for i in range(3):
                for j in range(3):
                    if a[j] + b[i] != c[i][j]:
                        break
                    if i == 2 and j == 2:
                        print("Yes")
                        exit()
                if a[j] + b[i] != c[i][j]:
                    break
            b.pop()
            a.pop()
        a.pop()
        b.pop()
print("No")
Buggy code:
c = []
for i in range(3):
    x, y, z = map(int, input().split())
    c.append(x)
    c.append(y)
    c.append(z)

for a1 in range(100):
    for a2 in range(100):
        for a3 in range(100):
            b1 = c[0] - a1
            b2 = c[1] - a2
            b3 = c[2] - a3
            if c[4] == a2 + b1 and c[5] == a2 + b2 and c[6] == a2 + b3 and c[7] == a3 + b1 and c[8] == a3 + b2 and c[9] == a3 + b3:
                print('Yes')
                exit()
print('No')


Fixed code:
c = []
for i in range(3):
    x, y, z = map(int, input().split())
    c.append(x)
    c.append(y)
    c.append(z)

for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            b1 = c[0] - a1
            b2 = c[1] - a1
            b3 = c[2] - a1
            if c[3] == a2 + b1 and c[4] == a2 + b2 and c[5] == a2 + b3 and c[6] == a3 + b1 and c[7] == a3 + b2 and c[8] == a3 + b3:
                print('Yes')
                exit()
print('No')
Buggy code:
lc = [[int(w) for w in input().split()] for i in range(3)]
cond = False

lb = lc[0]
a2 = lc[1][0]-lb[0]
a3 = lc[2][0]-lb[0]
la = [0, a2, a3]
for i in range(3):
    for j in range(3):
        if lc[i][j] != la[i]+lb[j]:
            flag = False
            break

print("Yes" if cond else "No")


Fixed code:
lc = [[int(w) for w in input().split()] for i in range(3)]
cond = True

lb = lc[0]
a2 = lc[1][0]-lb[0]
a3 = lc[2][0]-lb[0]
la = [0, a2, a3]
for i in range(3):
    for j in range(3):
        if lc[i][j] != la[i]+lb[j]:
            cond = False
            break

print("Yes" if cond else "No")
Buggy code:
import numpy as np

c = np.array([list(map(int, input().split())) for i in range(3)])

flag = True
for a1 in range(c.max()+1):
  b1, b2, b3 = c[0, :] - a1
  if (c[1, 0] - b1 != c[1, 1] - b2) or (c[1, 2] - b3 == c[1, 0] - b1):
    flag = False
    break
    
  if (c[2, 0] - b1 != c[2, 1] - b2) or (c[2, 2] - b3 == c[2, 0] - b1):
    flag = False
    break

print("Yes" if flag else "No")

Fixed code:
import numpy as np

c = np.array([list(map(int, input().split())) for i in range(3)])

flag = True
for a1 in range(c.max()+1):
  b1 = c[0][0] - a1
  b2 = c[0][1] - a1
  b3 = c[0][2] - a1
  if (c[1][0] - b1 != c[1][1] - b2 or c[1][0] - b1 != c[1][2] - b3):
    flag = False
  
  if (c[2][0] - b1 != c[2][1] - b2 or c[2][0] - b1 != c[2][2] - b3):
   	flag = False
  
print("Yes" if flag else "No")
Buggy code:
c = []
for i in range(3):
    c.append(list(map(int, input().split())))
tmp = [[] for i in range(4)]
for i in range(3):
    for j in range(2):
        tmp[j].append(c[j+1][i] - c[0][i])
        tmp[j+2].append(c[i][j] - c[i][0])
if all(len(set(i)) for i in tmp):
    print('Yes')
else:
    print('No')


Fixed code:
c = []
for i in range(3):
    c.append(list(map(int, input().split())))
tmp = [[] for i in range(4)]
for i in range(3):
    for j in range(2):
        tmp[j].append(c[j+1][i] - c[0][i])
        tmp[j+2].append(c[i][j+1] - c[i][0])
if set([len(set(i)) for i in tmp]) == {1}:
    print('Yes')
else:
    print('No')
Buggy code:
C1 = [list(map(int, input().split())) for i in range(3)]

a = []
b = []
result = 'Yes'

a.append(0)
b.append(C[0][0])
b.append(C[1][0])
b.append(C[2][0])
a.append(C[1][0] - b1)
a.append(C[2][0] - b1)

for i in range(3):
    for j in range(3):
        if C[i][j] != a[i] + b[j]:
            result = 'No'
            
print(result)


Fixed code:
C = [list(map(int, input().split())) for i in range(3)]

a = [0]
b = []
result = 'Yes'

b.append(C[0][0])
b.append(C[0][1])
b.append(C[0][2])
a.append(C[1][0] - b[0])
a.append(C[2][0] - b[0])

for i in range(3):
    for j in range(3):
        if C[i][j] != a[i] + b[j]:
            result = 'No'
            
print(result)
Buggy code:
c = [map(int,input().split()) for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][1],\
c[2][0]-c[0][2],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')

Fixed code:
c = [list(map(int,input().split())) for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][0],\
c[2][0]-c[0][0],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')
Buggy code:
a = [list(map(int,input().split()))for i in range(3)]
x = [10,0,0]
y = [0,0,0]

for i in range(3):
    y[i] = a[0][i]-x[0]

for i in range(3):
    x[i] = a[i][0]-y[0]

flag = True
print(y)
print(x)
for i in range(3):
    for j in range(3):
        if a[i][j] != x[i]+y[j]:
            flag=False

if flag:
    print("Yes")
else:
    print("No")

Fixed code:
a = [list(map(int,input().split()))for i in range(3)]
x = [10,0,0]
y = [0,0,0]

for i in range(3):
    y[i] = a[0][i]-x[0]

for i in range(3):
    x[i] = a[i][0]-y[0]

flag = True

for i in range(3):
    for j in range(3):
        if a[i][j] != x[i]+y[j]:
            flag=False

if flag:
    print("Yes")
else:
    print("No")
Buggy code:
y1_list = list(map(int,input().split()))
y2_list = list(map(int,input().split()))
y3_list = list(map(int,input().split()))
 
a1 = list()
a2 = list()
 
for i in range(3):
    a1.append(y1_list[i] - y2_list[i])
    a2.append(y2_list[i] - y3_list[i])
    
if a1[0] == a1[1] and a1[2] == a1[0]:
    if a2[0] == a1[1] and a2[2] == a1[0]:
        print("Yes")
        
    else:
        print("No")
else:
    print("No")

Fixed code:
y1_list = list(map(int,input().split()))
y2_list = list(map(int,input().split()))
y3_list = list(map(int,input().split()))
L = [y1_list,y2_list,y3_list]
 
a1 = list()
a2 = list()
b1 = list()
b2 = list()
 
for i in range(3):
    a1.append(y1_list[i] - y2_list[i])
    a2.append(y2_list[i] - y3_list[i])
    b1.append(L[i][0] - L[i][1])
    b2.append(L[i][1] - L[i][2])
 
 
if (a1[0] == a1[1] and a1[2] == a1[0])and(b1[0] == b1[1] and b1[2] == b1[0]):
    if (a2[0] == a2[1] and a2[2] == a2[0])and(b2[0] == b2[1] and b2[2] == b2[0]):
        print("Yes")
        
    else:
        print("No")
else:
    print("No")
Buggy code:
C = [list(map(lambda x:int(x),input().split())) for i in range(3)]
#print(C)
a,b,c = C[0],C[1],C[2]
if (a[0]-a[1])==(b[0]-b[1]) and (a[2]-a[1])==(b[2]-b[1]):
    print("Yes")
else:
    print("No")

Fixed code:
C = [list(map(lambda x:int(x),input().split())) for i in range(3)]
#print(C)
a,b,c = C[0],C[1],C[2]
if ((a[0]-a[1])==(b[0]-b[1]) and (b[0]-b[1])==(c[0]-c[1])) and\
   ((a[2]-a[1])==(b[2]-b[1]) and (b[2]-b[1])==(c[2]-c[1])):
    print("Yes")
else:
    print("No")
Buggy code:
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
a = c1[0]+c2[1]+c3[2]
b = c1[1]+c2[2]+c3[0]
c = c1[2]+c2[0]+c3[1]
d = c1[0]+c2[1]+c3[2]
e = c1[1]+c2[2]+c3[0]
f = c1[2]+c2[0]+c3[1]
if a=b and b=c and c=d and d=e and e=f:
  print('Yes')
else:
  print('No')


Fixed code:
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
a = c1[0]+c2[1]+c3[2]
b = c1[1]+c2[2]+c3[0]
c = c1[2]+c2[0]+c3[1]
d = c1[0]+c2[2]+c3[1]
e = c1[1]+c2[0]+c3[2]
f = c1[2]+c2[1]+c3[0]
if a==b==c==d==e==f:
  print('Yes')
else:
  print('No')
Buggy code:
c=[]
for _ in range(3):
  c.append(list(map(int,input().split())))
for i in range(2):
  if c[i][0]-c[i+1][0]!=c[i][1]-c[i+1][1]!=c[i][2]-c[i+1][2]:
    print('No')
    exit()
  if c[0][i]-c[0][i+1]!=c[1][i]-c[1][i+1]!=c[2][i]-c[2][i+1]:
    print('No')
    exit()
print('Yes')

Fixed code:
c=[]
for _ in range(3):
  c.append(list(map(int,input().split())))
for i in range(2):
  if c[i][0]-c[i+1][0]!=c[i][1]-c[i+1][1] or c[i][1]-c[i+1][1]!=c[i][2]-c[i+1][2]:
    print('No')
    exit()
  if c[0][i]-c[0][i+1]!=c[1][i]-c[1][i+1] or c[1][i]-c[1][i+1]!=c[2][i]-c[2][i+1]:
    print('No')
    exit()
print('Yes')
Buggy code:
l = map(int, open(0).read().split())
print("YNeos"[4 != sum(sum(l[j]-l[0]+l[i] == l[i+j] for i in [1,2]) for j in [3,6])::2])

Fixed code:
*l, = map(int, open(0).read().split())
print("YNeos"[4 != sum(sum(l[j]-l[0]+l[i] == l[i+j] for i in [1,2]) for j in [3,6])::2])
Buggy code:
c = [list(map(int,input().split())) for i in range(3)]
ans = "No"
for a1 in range(c[0][0]):
	b1 = c[0][0] - a1
	b2 = c[0][1] - a1
	b3 = c[0][2] - a1
	a2 = c[1][0] - b1
	a3 = c[2][0] - b1
	if a2+b2 == c[1][1] and a2+b3 == c[1][2] and a3+b2 == c[2][1] and a3+b3 == c[2][2]:
		ans = "Yes"
print(ans)

Fixed code:
c = [list(map(int,input().split())) for i in range(3)]
ans = "No"
for a1 in range(100):
	b1 = c[0][0] - a1
	b2 = c[0][1] - a1
	b3 = c[0][2] - a1
	a2 = c[1][0] - b1
	a3 = c[2][0] - b1
	if a2+b2 == c[1][1] and a2+b3 == c[1][2] and a3+b2 == c[2][1] and a3+b3 == c[2][2]:
		ans = "Yes"
print(ans)
Buggy code:
import numpy as np
array = np.zeros((3, 3), dtype="int8")
for i in range(3):
    inputs = map(int, input().split())
    for j in range(3):
        array[i, j] = inputs[j]
    
b_1 = array[0, 0]
b_2 = array[0, 1]
b_3 = array[0, 2]
a_2 = array[1, 0] - b_1
a_3 = array[2, 0] - b_1
if (array[1, 1] == (a_2 + b_2)) & (array[2, 2] == (a_3 + b_3)):
    flag = 1
else:
    flag = 0

if flag:
    print("Yes")
else:
    print("No")

Fixed code:
import numpy as np
array = np.zeros((3, 3), dtype="int8")
for i in range(3):
    inputs = [int(x) for x in input().split()]
    for j in range(3):
        array[i, j] = inputs[j]
    
b_1 = array[0, 0]
b_2 = array[0, 1]
b_3 = array[0, 2]
a_2 = array[1, 0] - b_1
a_3 = array[2, 0] - b_1
if (array[1, 1] == (a_2+b_2)) & (array[2, 2] == (a_3+b_3) ) & (array[1, 2] == (a_2+b_3)) & (array[2, 1] == (a_3+b_2)):
    flag = 1
else:
    flag = 0

if flag:
    print("Yes")
else:
    print("No")
Buggy code:
c = [list(map(int, input().split())) for _ in range(3)]

a2 = c[1][0] - c[0][0]
a3 = c[2][0] - c[0][0]
if any(c[1][x] != a2 + c[1][x] for x in [1, 2]) or any(c[2][x] != a3 + c[1][x] for x in [0, 2]):
	print('No')
else:
	print('Yes')


Fixed code:
c = [list(map(int, input().split())) for _ in range(3)]

a2 = c[1][0] - c[0][0]
a3 = c[2][0] - c[0][0]

if any(c[1][x] != a2 + c[0][x] for x in [1, 2]) or any(c[2][x] != a3 + c[0][x] for x in [1, 2]):
	print('No')
else:
	print('Yes')
Buggy code:
c=[]
for i in range(3):
    c.append([int(i) for i in input().split()])

a1,a2,a3=[0,c[1][1],c[2][1]-c[0][1]]
b1,b2,b3=[c[0][0],c[0][1],c[0][2]]

ans=[[a1+b1,a1+b2,a1+b3],[a2+b1,a2+b2,a2+b3],[a3+b1,a3+b2,a3+b3]]

if ans==c:
    print("Yes")
else:
    print("No")



Fixed code:
c=[]
for i in range(3):
    c.append([int(i) for i in input().split()])

a1,a2,a3=[0,c[1][1]-c[0][1],c[2][1]-c[0][1]]
b1,b2,b3=[c[0][0],c[0][1],c[0][2]]

ans=[[a1+b1,a1+b2,a1+b3],[a2+b1,a2+b2,a2+b3],[a3+b1,a3+b2,a3+b3]]

if ans==c:
    print("Yes")
else:
    print("No")
Buggy code:
r=range
M=[list(map(int,input().split())) for _ in r(3)]
x
for i in r(2):
  x=M[0][i]-M[0][i+1]
  y=M[i][0]-M[i+1][0]
  for j in r(3):
    if x!=M[j][i]-M[j][i+1] or y=M[i][j]-M[i+1][j]:
      print('No')
      exit()
print('Yes')

Fixed code:
r=range
M=[list(map(int,input().split())) for _ in r(3)]
for i in r(2):
  x=M[0][i]-M[0][i+1]
  y=M[i][0]-M[i+1][0]
  for j in r(3):
    if x!=M[j][i]-M[j][i+1] or y!=M[i][j]-M[i+1][j]:
      print('No')
      exit()
print('Yes')
Buggy code:
import numpy as np

grid = np.array([])
for _ in range(3):
    list1 = list(map(int, input().split()))
    grid = np.append(grid, list1)

grid = grid.reshape(3, 3)
grid2 = np.vstack((grid[1:3, :], grid[0, :]))
judge = grid - grid2
judge = judge.transpose()
judge2 = np.copy(judge)
judge2 = np.vstack((judge2[1:3, :], judge2[0, :]))
new_judge = judge - judge2

if new_judge == np.zeros(3, 3):
    print('Yes')
else:
    print('No')


Fixed code:
import numpy as np

grid = np.array([])
for _ in range(3):
    list1 = list(map(int, input().split()))
    grid = np.append(grid, list1)

grid = grid.reshape(3, 3)
grid2 = np.vstack((grid[1:3, :], grid[0, :]))
judge = grid - grid2
judge = judge.transpose()
judge2 = np.copy(judge)
judge2 = np.vstack((judge2[1:3, :], judge2[0, :]))
new_judge = judge - judge2

if np.allclose(new_judge, np.zeros_like(new_judge)):
    print('Yes')
else:
    print('No')
Buggy code:
def main():
    arr = []
    for i in range(3):
        arr.append(map(int, input().split()))
    b1 = arr[0][0] - arr[0][1]
    b2 = arr[0][1] - arr[0][2]
    a1 = arr[1][0] - arr[0][0]
    a2 = arr[2][0] - arr[1][0]
    for i in range(3):
        if arr[i][0] - arr[i][1] != b1 or arr[i][1] - arr[i][2] != b2 or arr[1][i] - arr[0][i] != a1 or arr[2][i] - \
                arr[1][i] != a2:
            print("No")
            return
    print("Yes")

if __name__ == '__main__':
    main()


Fixed code:
def main():
    arr = []
    for i in range(3):
        arr.append(list(map(int, input().split())))
    b1 = arr[0][0] - arr[0][1]
    b2 = arr[0][1] - arr[0][2]
    a1 = arr[1][0] - arr[0][0]
    a2 = arr[2][0] - arr[1][0]
    for i in range(3):
        if arr[i][0] - arr[i][1] != b1 or arr[i][1] - arr[i][2] != b2 or arr[1][i] - arr[0][i] != a1 or arr[2][i] - \
                arr[1][i] != a2:
            print("No")
            return
    print("Yes")

if __name__ == '__main__':
    main()
Buggy code:
b=list(map(int,input().split()))
a2=list(map(int,input().split()))
a3=list(map(int,input().split()))
for i in range(max(0,b[0]-100,b[1]-100,b[2]-100),min(100,b[0],b[1],b[2])+1):
  t1=set()
  t2=set()
  for j in range(3):
    t1.add(a2[j]-(b[j]-i))
    t2.add(a3[j]-(b[j]-i))
  if len(t1)==1 and len(t2)==1 and t1[0]>=0 and t2[0]>=0:
    print('Yes')
    break
else:
  print('No')

Fixed code:
b=list(map(int,input().split()))
a2=list(map(int,input().split()))
a3=list(map(int,input().split()))
for i in range(max(0,b[0]-100,b[1]-100,b[2]-100),min(100,b[0],b[1],b[2])+1):
  t1=set()
  t2=set()
  for j in range(3):
    t1.add(a2[j]-(b[j]-i))
    t2.add(a3[j]-(b[j]-i))
  if len(t1)==1 and len(t2)==1 and list(t1)[0]>=0 and list(t2)[0]>=0:
    print('Yes')
    break
else:
  print('No')
Buggy code:
c=[list(map(int,input().split())) for _ in range(3)]

ans = "Yes"

for i in range(2):
    if c[i+1][1]-c[i+1][0] != c[0][1]-c[0][0]:
        ans = "No"
for j in range(2):
    if c[1][i+1]-c[0][i+1] != c[1][0]-c[0][0]:
        ans = "No"

print(ans)

Fixed code:
c=[list(map(int, input().split())) for _ in range(3)]
ans="Yes"
for i in range(2):
	for j in range(2):
		if c[i][j] - c[i+1][j] - c[i][j+1] + c[i+1][j+1] != 0:
			ans="No"
print(ans)
Buggy code:
c = []
for _ in range(3):
    c.append(list(input().split()))
A, B, C, D, E, F, G, H, I = c[0][0], c[0][1], c[0][2], c[1][0], c[1][1], c[1][2], c[2][0], c[2][1], c[2][2]

if max(A+E+I, A+F+H, B+D+I, B+F+G, C+D+H, C+E+G) == min(A+E+I, A+F+H, B+D+I, B+F+G, C+D+H, C+E+G):
    print("Yes")
else:
    print("No")


Fixed code:
c = []
for _ in range(3):
    c.append(list(map(int, input().split())))
A, B, C, D, E, F, G, H, I = c[0][0], c[0][1], c[0][2], c[1][0], c[1][1], c[1][2], c[2][0], c[2][1], c[2][2]

if max(A+E+I, A+F+H, B+D+I, B+F+G, C+D+H, C+E+G) == min(A+E+I, A+F+H, B+D+I, B+F+G, C+D+H, C+E+G):
    print("Yes")
else:
    print("No")
Buggy code:
c_box = [] 
for i in range(3):
  c = list(map(int, input().split()))
  c_box.append(c)
  
for i in range(101):
  a1 = i
  b1 = c[0][0]-a1
  b2 = c[0][1]-a1
  b3 = c[0][2]-a1
  if c[1][0]-b1 == c[1][1]-b2 == c[1][2]-b3:
    if c[2][0]-b1 == c[2][1]-b2 == c[2][2]-b3:
      print('Yes')
      exit()
print('No')

Fixed code:
c = [] 
for i in range(3):
  box = list(map(int, input().split()))
  c.append(box)

  
for i in range(101):
  a1 = i
  b1 = c[0][0]-a1
  b2 = c[0][1]-a1
  b3 = c[0][2]-a1
  if c[1][0]-b1 == c[1][1]-b2 == c[1][2]-b3:
    if c[2][0]-b1 == c[2][1]-b2 == c[2][2]-b3:
      print('Yes')
      exit()
print('No')
Buggy code:
c = [list(map(int,input().split())) for i in range(3)]

q1 = c[0][0] - c[0][1] == c[1][0] - c[1][1] == c[2][0] - c[2][1]
q2 = c[0][0] - c[0][2] == c[1][0] - c[1][2] == c[2][0] - c[2][2]
q3 = c[0][0] - c[1][0] == c[0][1] - c[1][1] == c[0][2] - c[1][2]
q4 = c[0][0] - c[2][0] == c[0][1] - c[2][1] == c[0][2] - c[2][2]

print("Yes" if q1 and q2 and q3 and q4 else "no")

Fixed code:
c = [list(map(int,input().split())) for i in range(3)]

q1 = c[0][0] - c[0][1] == c[1][0] - c[1][1] == c[2][0] - c[2][1]
q2 = c[0][0] - c[0][2] == c[1][0] - c[1][2] == c[2][0] - c[2][2]
q3 = c[0][0] - c[1][0] == c[0][1] - c[1][1] == c[0][2] - c[1][2]
q4 = c[0][0] - c[2][0] == c[0][1] - c[2][1] == c[0][2] - c[2][2]

print("Yes" if q1 and q2 and q3 and q4 else "No")
Buggy code:
c=[list(map(int,input().split()))for i in range(3)]
x=[0]*3
y=[0]*3
for i in range(3):
    x[i]=c[i][0]-y[0]
    for j in range(3):
        y[i]=c[i][0]-x[0]
judge=True
for i in range(3):
    for j in range(3):
        if c[i][j]!=x[i]+y[j]:
            judge=False
if judge:
    print("Yes")
else:
    print("No")


Fixed code:
c=[list(map(int,input().split()))for i in range(3)]
x=[0]*3
y=[0]*3
for i in range(3):
    y[i]=c[0][i]-x[0]
    for j in range(3):
        x[i]=c[i][0]-y[0]
jud=True
for i in range(3):
    for j in range(3):
        if x[i]+y[j]!=c[i][j]:
            jud=False
if jud==True:
    print("Yes")
else:
    print("No")
Buggy code:
c=[list(map(int, input().split())) for i in range(3)]
if (c[0][0] - c[1][0] == c[0][1] - c[1][1] == c[0][2] - c[1][2]) and \
   (c[0][1] - c[1][2] == c[1][1] - c[2][1] == c[1][2] - c[2][2]):
    print('Yes')
else:
    print('No')

Fixed code:
c=[[],[],[]]
for i in range(3):
    c[i]=list(map(int,input().split()))

if c[0][0]-c[0][1]==c[1][0]-c[1][1] and c[2][0]-c[2][1]==c[0][0]-c[0][1]:
    if c[0][1]-c[0][2]==c[1][1]-c[1][2] and c[2][1]-c[2][2]==c[0][1]-c[0][2]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Buggy code:
# -*- coding: utf-8 -*-

c = []
for i in range(3):
    c.append(list(map(int, input().split())))
diff1 = []
for i in range(2):
    diff1.append([s - t for s in c[i+1][:] for t in c[i][:]])

diff2 = []
for i in range(2):
    diff2.append([s - t for s in c[:][i+1] for t in c[:][i]])

if diff1[0] == diff1[1] and diff2[0] == diff2[1]:
    print('Yes')
else:
    print('No')

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

c = []
for i in range(3):
    c.append(list(map(int, input().split())))
diff1 = []
for i in range(3):
    diff1.append([c[i][1] - c[i][0], c[i][1] - c[i][2]])

diff2 = []
for i in range(3):
    diff2.append([c[1][i] - c[0][i], c[1][i] - c[2][i]])
if diff1[0] == diff1[1] and diff1[1] == diff1[2] and \
   diff2[0] == diff2[1] and diff2[1] == diff2[2]:
    print('Yes')
else:
    print('No')
Buggy code:
c = [[],[],[]]
c[0] = [int(x) for x in input().split()]
c[1] = [int(x) for x in input().split()]
c[2] = [int(x) for x in input().split()]

ans = "Yes"
for i in range(3):
  for j in range(3):
  	if c[(i+1)%3][(j+1)%3] + c[(i+2)%3][(j+2)%3] != c[(i+2)%3][(j+1)%3] + c[(i+1)%3][(j+2)%3]
      ans = "No"	
      break
  if ans == "No":
    break
print(ans)

Fixed code:
c = [[],[],[]]
c[0] = [int(x) for x in input().split()]
c[1] = [int(x) for x in input().split()]
c[2] = [int(x) for x in input().split()]

ans = "Yes"
for i in range(3):
    for j in range(3):
        if c[(i+1)%3][(j+1)%3] + c[(i+2)%3][(j+2)%3] != c[(i+2)%3][(j+1)%3] + c[(i+1)%3][(j+2)%3]:
            ans = "No"
            break
    if ans == "No":
        break
print(ans)
Buggy code:
mat = []

for i in range(3):
  a = list(map(int, input().split()))

ans = False
if mat[1][0] - mat[0][0] == mat[1][1] - mat[0][1] == mat[1][2] - mat[0][2]:
  if mat[2][0] - mat[0][0] == mat[2][1] - mat[0][1] == mat[2][2] - mat[0][2]:
    ans = True

if ans:
  print("Yes")
else:
  print("No")
  


Fixed code:
mat = []
 
for i in range(3):
  a = list(map(int, input().split()))
  mat.append(a)
  
ans = False
if mat[1][0] - mat[0][0] == mat[1][1] - mat[0][1] == mat[1][2] - mat[0][2]:
  if mat[2][0] - mat[0][0] == mat[2][1] - mat[0][1] and mat[2][1] - mat[0][1] == mat[2][2] - mat[0][2]:
    ans = True
 
if ans:
  print("Yes")
else:
  print("No")