qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import sys

if __name__ == "__main__":
    C1 = list(map(int, (input().split(' '))))
    C2 = list(map(int, (input().split(' '))))
    C3 = list(map(int, (input().split(' '))))

    for i in range(100, 101):
        for j in range(100, 101):
            for k in range(100, 101):
                col1 = C1[0] - i
                if col1 < 0:
                    break
                if col1 > 100:
                    break
                if (C2[0] - j) != col1:
                    break
                if (C3[0] - k) != col1:
                    break
                col2 = C1[1] - i
                if col2 < 0:
                    break
                if col2 > 100:
                    break
                if (C2[1] - j) != col2:
                    break
                if (C3[1] - k) != col2:
                    break
                col3 = C1[2] - i
                if col3 < 0:
                    break
                if col3 > 100:
                    break
                if (C2[2] - j) != col3:
                    break
                if (C3[2] - k) != col3:
                    break
                print('Yes')
                sys.exit()
    print('No')

Fixed code:
import sys

if __name__ == "__main__":
    C1 = list(map(int, (input().split(' '))))
    C2 = list(map(int, (input().split(' '))))
    C3 = list(map(int, (input().split(' '))))

    for i in range(101):
        for j in range(101):
            for k in range(101):
                col1 = C1[0] - i
                if col1 < 0:
                    break
                if col1 > 100:
                    break
                if (C2[0] - j) != col1:
                    break
                if (C3[0] - k) != col1:
                    continue
                col2 = C1[1] - i
                if col2 < 0:
                    break
                if col2 > 100:
                    break
                if (C2[1] - j) != col2:
                    break
                if (C3[1] - k) != col2:
                    continue
                col3 = C1[2] - i
                if col3 < 0:
                    break
                if col3 > 100:
                    break
                if (C2[2] - j) != col3:
                    break
                if (C3[2] - k) != col3:
                    continue
                print('Yes')
                sys.exit()
    print('No')
Buggy code:
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13 :
    print("Yes")
else:
    print("No")

Fixed code:
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 \
and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 \
and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13) :
    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()))

C = [C1, C2, C3]
A = [0] * 3
B = [0] * 3

B = C1
A[1] = C2[0] - B[0]
A[2] = C3[0] - B[0]

flg = True
for a in range(A[1], A[2]):
    for b in range(B[1], B[2]):
        if C[a][b] != a + b:
            flg = False

if flg is True:
    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()))

C = [C1, C2, C3]
A = [0] * 3
B = [0] * 3

B = C1
A[1] = C2[0] - B[0]
A[2] = C3[0] - B[0]
flg = True
for i, a in enumerate(A):
    for j, b in enumerate(B):
        if C[i][j] != a + b:
            flg = False

if flg is True:
    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(" ")))
a1 = []
a2 = []
a3 = []
b1 = []
b2 = []
b3 = []
judge1 = False
judge2 = False
judge3 = False
judge4 = False
for i in range(c1[0]+1):
    a1.append(i)
b1 = sorted(a1,reverse = True)
for i in b1:
    a2.append(c2[0]-i)
for i in b1:
    a3.append(c3[0]-i)

for i in a1:
    b2.append(c1[1]-i)
for i in a1:
    b3.append(c1[2]-i)

for i in range(len(a1)):
    if c2[1] == a2[i]+b2[i]:
        judge1 = True
    if c3[2] == a3[i]+b3[i]:
        judge2 = True
    if c2[3] == a2[i]+b3[i]:
        judge3 = True
    if c3[1] == a3[i]+b2[i]:
        judge4 = True 
if judge1 and judge2 and judeg3 and judge4 :
    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(" ")))
a1 = []
a2 = []
a3 = []
b1 = []
b2 = []
b3 = []
judge1 = False
judge2 = False
judge3 = False
judge4 = False
for i in range(c1[0]+1):
    a1.append(i)
b1 = sorted(a1,reverse = True)
for i in b1:
    a2.append(c2[0]-i)
for i in b1:
    a3.append(c3[0]-i)

for i in a1:
    b2.append(c1[1]-i)
for i in a1:
    b3.append(c1[2]-i)

for i in range(len(a1)):
    if c2[1] == a2[i]+b2[i]:
        judge1 = True
    if c3[2] == a3[i]+b3[i]:
        judge2 = True
    if c2[2] == a2[i]+b3[i]:
        judge3 = True
    if c3[1] == a3[i]+b2[i]:
        judge4 = True 
if judge1 and judge2 and judge3 and judge4 :
    print("Yes")
else:
    print("No")
Buggy code:
grid = []
for _ in range(3):
    grid.append((list)(map(int, input().split())))

for i in range(3):
    j = (i+1) % 3
    diff1 = grid[i][0] - grid[j][0]
    diff2 = grid[i][1] - grid[j][1]

    if diff1 != diff2 or diff2 != diff3:
        print("No")
        exit()

print("Yes")


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

for i in range(3):
    j = (i+1) % 3
    diff1 = grid[i][0] - grid[j][0]
    diff2 = grid[i][1] - grid[j][1]
    diff3 = grid[i][2] - grid[j][2]

    if diff1 != diff2 or diff2 != diff3 or diff1 != diff3:
        print("No")
        exit()

for i in range(3):
    j = (i+1) % 3
    diff1 = grid[0][i] - grid[0][j]
    diff2 = grid[1][i] - grid[1][j]
    diff3 = grid[2][i] - grid[2][j]

    if diff1 != diff2 or diff2 != diff3 or diff1 != diff3:
        print("No")
        exit()

print("Yes")
Buggy code:
grid = [list(map(int,input().split(' ')))]
grid.append(list(map(int,input().split(' '))))
grid.append(list(map(int,input().split(' '))))

flg =False
for i in range(10):
    b0,b1,b2  = grid[0][0]-i,grid[0][1]-i,grid[0][2]-i
    a1,a2 = grid[1][0]-b0,grid[2][0]-b0
    if grid[1][1] == a1+b1 and grid[1][2] == a1+b2 and grid[2][1] == a2+b1 and grid[2][2] == a2+b2:
        flg =True
        break
    if min([b0,b1,b2]) < 0:
        break
    
if flg:
    print('Yes')
    

Fixed code:
grid = [list(map(int,input().split(' ')))]
grid.append(list(map(int,input().split(' '))))
grid.append(list(map(int,input().split(' '))))

flg =False
for i in range(100):
    b0,b1,b2  = grid[0][0]-i,grid[0][1]-i,grid[0][2]-i
    a1,a2 = grid[1][0]-b0,grid[2][0]-b0
    if grid[1][1] == a1+b1 and grid[1][2] == a1+b2 and grid[2][1] == a2+b1 and grid[2][2] == a2+b2:
        if grid[0][0] == i+b0 and grid[0][1] == i+b1 and grid[0][2] == i+b2 and grid[1][0] == a1+b0 and grid[2][0] == a2+b0:
            flg =True
            break
    if min([b0,b1,b2]) < 0:
        break
    
if flg:
    print('Yes')
    
else:
    print('No')
Buggy code:
lst = []
for i in range(3):
	a = list(map(int,input().split()))
	lst.append(a)
#print(lst)
F = False

for i in range(100):
	b1 = lst[0][0] - i
	b2 = lst[0][1] - i
	b3 = lst[0][0] - i
	if lst[1][0] - b1 == lst[1][1] - b2 and +\
	lst[1][1] - b2 == lst[1][2] - b3 and +\
	lst[2][0] - b1 == lst[2][1] - b2 and +\
	lst[2][1] - b2 == lst[2][2] - b3:
		F = True

if F == False:
  print("No")
else:
  print("Yes")

Fixed code:
lst = []
for i in range(3):
	a = list(map(int,input().split()))
	lst.append(a)
#print(lst)
F = False

for i in range(100):
	b1 = lst[0][0] - i
	b2 = lst[0][1] - i
	b3 = lst[0][2] - i
	if lst[1][0] - b1 == lst[1][1] - b2 and +\
	lst[1][1] - b2 == lst[1][2] - b3 and +\
	lst[2][0] - b1 == lst[2][1] - b2 and +\
	lst[2][1] - b2 == lst[2][2] - b3:
		F = True

if F == False:
  print("No")
else:
  print("Yes")
Buggy code:
def check(a,b):
    for i in range(3):
        diffc[i] = c[i][a]-c[i][b]
        diffr[i] = c[a][i]-c[b][i]
    if diffc[0] == diffc[1] == diffc[2] and diffr[0] == diffr[1] == diffr[2]:
        print("Yes")
        exit()

c = [[int(i) for i in input().split()] for i in range(3)]
diffr = [0]*3
diffc = [0]*3
check(0,1)
check(1,2)
print("No")

Fixed code:
def check(a,b):
    for i in range(3):
        diffc[i] = c[i][a]-c[i][b]
        diffr[i] = c[a][i]-c[b][i]
    if diffc[0] != diffc[1] or diffc[1] != diffc[2] or diffr[0] != diffr[1] or diffr[1] != diffr[2]:
        print("No")
        exit()
        

c = [[int(i) for i in input().split()] for i in range(3)]
diffr = [0]*3
diffc = [0]*3
check(0,1)
check(1,2)
print("Yes")
Buggy code:
import numpy as np

if __name__ == '__main__':
    rows = []
    for i in range(3):
        rows.append([int(i) for i in input().split()])
    mat = np.matrix(rows)

    upper_a = [mat[i, :].max() for i in range(3)]
    upper_b = [mat[:, i].max() for i in range(3)]

    print(upper_a)
    print(upper_b)

    for a1 in range(upper_a[0]):
        bs = [v - a1 for v in mat[0, :].tolist()[0]]
        # print(bs)
        for a2 in range(upper_a[1]):
            vals = [a2 + b for b in bs]
            # print(vals)
            if vals == mat[1, :].tolist()[0]:
                for a3 in range(upper_a[2]):
                    vals = [a3 + b for b in bs]
                    if vals == mat[2, :].tolist()[0]:
                        print('Yes')
                        exit(0)

    print('No')










Fixed code:
import numpy as np

if __name__ == '__main__':
    rows = []
    for i in range(3):
        rows.append([int(i) for i in input().split()])
    mat = np.matrix(rows)

    upper_a = [mat[i, :].max() for i in range(3)]
    upper_b = [mat[:, i].max() for i in range(3)]

    # print(upper_a)
    # print(upper_b)

    for a1 in range(upper_a[0]+1):
        bs = [v - a1 for v in mat[0, :].tolist()[0]]
        # print(bs)
        for a2 in range(upper_a[1]+1):
            vals = [a2 + b for b in bs]
            # print(vals)
            if vals == mat[1, :].tolist()[0]:
                for a3 in range(upper_a[2]+1):
                    vals = [a3 + b for b in bs]
                    if vals == mat[2, :].tolist()[0]:
                        print('Yes')
                        exit(0)

    print('No')
Buggy code:
c=[0 for _ in range(3)]
for i in range(3):
    c[i] = 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] and c[i][1]-c[i+1][1] != c[i][2]-c[i+1][2] :
        print("No")
        exit()
for i in range(2):
    if c[0][i]-c[0][i+1] != c[1][i]-c[1][i+1] and c[1][i]-c[1][i+1] != c[2][i]-c[2][i+1] :
        print("No")
        exit()
print("Yes")


Fixed code:
c=[0 for _ in range(3)]
for i in range(3):
    c[i] = 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()
for i in range(2):
    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:
ar = [[int(i) for i in input().split()] for j in range(3)]

if ar[0][0] + ar[1][1] + ar[2][2] == ar[0][1] + ar[1][2] + ar[2][0] == ar[0][3] + ar[1][0] + ar[2][1]:
  print("Yes")
else:
  print("No")

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

if ar[0][0] + ar[1][1] + ar[2][2] == ar[0][1] + ar[1][2] + ar[2][0] == ar[0][2] + ar[1][0] + ar[2][1]:
  print("Yes")
else:
  print("No")
Buggy code:
def ans():
    C = []
    C.append([])
    C.append(list(map(int, ('0 ' + input()).split())))
    C.append(list(map(int, ('0 ' + input()).split())))
    C.append(list(map(int, ('0 ' + input()).split())))

    A = [0] * 4
    B = [0] * 4
    A[1] = 0

    for i in range(1,4):
        B[i] = C[1][i] - A[1]

    for i in range(2, 4):
        A[i] = C[i][1] - B[1]

    for i in range(1,4):
        for j in range(1, 4):
            if C[i][j] == (A[i] + B[j]):
                pass
            else:
                return print('No')
    return print('Yes')


Fixed code:
def ans():
    C = []
    C.append([])
    C.append(list(map(int, ('0 ' + input()).split())))
    C.append(list(map(int, ('0 ' + input()).split())))
    C.append(list(map(int, ('0 ' + input()).split())))

    A = [0] * 4
    B = [0] * 4
    A[1] = 0

    for i in range(1,4):
        B[i] = C[1][i] - A[1]

    for i in range(2, 4):
        A[i] = C[i][1] - B[1]

    for i in range(1,4):
        for j in range(1, 4):
            if C[i][j] == (A[i] + B[j]):
                pass
            else:
                return print('No')
    return print('Yes')
ans()
Buggy code:
import numpy as np

c = [list(map(int, input().split())) for i in range(3)]
c = np.array(c)
flag = False
for a1 in range(min(c[0] + 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 == c[1, 2] - b3 > 0 and c[2, 0] - b1 == c[2, 1] - b2 == c[2, 2] - b3 > 0:
        print('Yes')
        flag = True

if not flag:
    print('No')


Fixed code:
import numpy as np

c = [list(map(int, input().split())) for i in range(3)]
c = np.array(c)
flag = False
for a1 in range(min(c[0]) + 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 == c[1, 2] - b3 and c[2, 0] - b1 == c[2, 1] - b2 == c[2, 2] - b3:
        print('Yes')
        flag = True
        break
if not flag:
    print('No')
Buggy code:
import sys
n = [0 for i in range(3)]
for i in range(3):
    n[i] = [int(i) for i in input().split()]

b = n[0]
a = [0, n[1][0]-b[0], n[2][0]-b[0]]
for i in range(1, 3):
    for j in range(1, 3):
        if a[i]+a[j] != n[i][j]:
            print('No')
            sys.exit()

print('Yes')






Fixed code:
import sys
n = [0 for i in range(3)]
for i in range(3):
    n[i] = [int(i) for i in input().split()]

b = n[0]
a = [0, n[1][0]-b[0], n[2][0]-b[0]]
for i in range(1, 3):
    for j in range(1, 3):
        if a[i]+b[j] != n[i][j]:
            print('No')
            sys.exit()

print('Yes')
Buggy code:
C = [list(map(int, input().split())) for i in range(3)]
a =[]
b = []
for i in range(3):
    a.append(C[1][i] - C[0][i])
for j in range(3):
    b.append(C[2][i] - C[0][i])
if a[0] == a[1] and a[1] == a[2]:
    if b[0] == b[1] and b[1] == b[2]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Fixed code:
C = [list(map(int, input().split())) for i in range(3)]
a =[]
b = []
for i in range(3):
    a.append(C[1][i] - C[0][i])
for j in range(3):
    b.append(C[2][j] - C[0][j])
if (a[0] == a[1] and a[1] == a[2]) and (b[0] == b[1] and b[1] == b[2]):
    print('Yes')
else:
    print('No')
Buggy code:
c = [list(map(int,input().split())) for i in range(3)]
if all((c[0][i+1] - c[0][i] == c[1][i+1] - c[1][i] == c[2][i+1] - c[2][i] for i in range(1))):
    print("Yes")
else:
    print("No")

Fixed code:
c = [list(map(int,input().split())) for i in range(3)]
if all((c[0][i+1] - c[0][i] == c[1][i+1] - c[1][i] == c[2][i+1] - c[2][i] for i in range(2))):
    print("Yes")
else:
    print("No")
Buggy code:
lis1 = []
lis2 = []
lis3 = []
count = 0
for num in input().split():
    lis1.append(int(num))
for num in input().split():
    lis2.append(int(num))
for num in input().split():
    lis3.append(int(num))
for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            count = 0
            if lis1[0] - a1 == lis2[0] - a1 == lis3[0] - a1:
                count += 1
            if lis1[1] - a2 == lis2[1] - a2 == lis3[1] - a2:
                count += 1
            if lis1[2] - a3 == lis2[2] - a3 == lis3[2] - a3:
                count += 1
            if count == 3:
                print("Yes")
                break
print("No")

Fixed code:
lis1 = []
lis2 = []
lis3 = []
count = 0
for num in input().split():
    lis1.append(int(num))
for num in input().split():
    lis2.append(int(num))
for num in input().split():
    lis3.append(int(num))
for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            count = 0
            if lis1[0] - a1 == lis2[0] - a2 == lis3[0] - a3:
                count += 1
            if lis1[1] - a1 == lis2[1] - a2 == lis3[1] - a3:
                count += 1
            if lis1[2] - a1 == lis2[2] - a2 == lis3[2] - a3:
                count += 1
            if count == 3:
                print("Yes")
                break
        if count == 3:
          	break
    if count == 3:
      break
    if a1 == 100 and count != 3:
      	print("No")
Buggy code:
l=[]
for i in range(3):
  l1=list(map(int,input().split()))
  l.append(l1)
flag=0
for i in range(l[0][0]+1):
  y0=l[0][0]-i
  y1=l[1][0]-i
  y2=l[2][0]-i
  x1=l[0][1]-y1
  x2=l[0][2]-y1
  if l[1][1]==y1+x1 and l[1][2]==y1+x2 and l[2][1]==y2+x1 and l[2][2]==y2+x2:
    flag=1
  else:
    continue
if flag==1:
  print('Yes')
else:
  print('No')


Fixed code:
l=[]
for i in range(3):
  l1=list(map(int,input().split()))
  l.append(l1)
flag=0
for i in range(-1000,1000,):
  y0=l[0][0]-i
  y1=l[1][0]-i
  y2=l[2][0]-i
  x1=l[0][1]-y0
  x2=l[0][2]-y0
  if l[1][1]==y1+x1 and l[1][2]==y1+x2 and l[2][1]==y2+x1 and l[2][2]==y2+x2:
    flag=1
  else:
    continue
if flag==1:
  print('Yes')
else:
  print('No')
Buggy code:
import numpy as np

c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())
result = 0

b1 = c11
b2 = c12
b3 = c13
a1 = 0
a2 = c21 - b1
a3 = c31 - b1

if(c11 == a1 + b1):
    if(c12 == a1 + b2):
        if(c13 == a1 + b3):
            if(c21 == a2 + b1):
                if(c22 == a2 + b2):
                    if(c23 == a2 + b3):
                        if(c31 == a3 + b1):
                            if(c32 == a3 + b2):
                                if(c33 == a3 + b3):
                                    result = 1
if(result == 1):
    print('Yes')
else:
    print('NO')

Fixed code:
import numpy as np

c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())
result = 0

b1 = c11
b2 = c12
b3 = c13
a1 = 0
a2 = c21 - b1
a3 = c31 - b1

if(c11 == a1 + b1):
    if(c12 == a1 + b2):
        if(c13 == a1 + b3):
            if(c21 == a2 + b1):
                if(c22 == a2 + b2):
                    if(c23 == a2 + b3):
                        if(c31 == a3 + b1):
                            if(c32 == a3 + b2):
                                if(c33 == a3 + b3):
                                    result = 1
if(result == 1):
    print('Yes')
else:
    print('No')
Buggy code:
l = [list(map(int, input().split())) for i in range(3)]
d = [None]*3
d[i] = [l[i] - l[i+1] for i in range(2)]
print('Yes' if all(d[i] == d[i+1] for i in range(2)) else 'No')

Fixed code:
d = [None]*3
for i in range(3):
  c = list(map(int, input().split()))
  d[i] = [c[i] - c[i+1] for i in range(2)]
print('Yes' if all(d[i] == d[i+1] for i in range(2)) else 'No')
Buggy code:
c = [list(map(int, input().split())) for _ in range(3)]

a = [0] * 3
b = [0] * 3
ans = "Yes"
a[0] = 0
b[0] = c[0][0] - a1
b[1] = c[0][1] - a1
b[2] = c[0][2] - a1
a[1] = c[1][0] - b[0]
a[2] = c[2][0] - b[0]
for i in range(3):
    for j in range(3):
        if a[i] + b[j] != c[i][j]:
            ans = "No"

print(ans)


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

a = [0] * 3
b = [0] * 3
ans = "Yes"
for a1 in range(101):
    a[0] = a1
    b[0] = c[0][0] - a1
    b[1] = c[0][1] - a1
    b[2] = c[0][2] - a1
    a[1] = c[1][0] - b[0]
    a[2] = c[2][0] - b[0]
    for i in range(3):
        for j in range(3):
            if a[i] + b[j] != c[i][j]:
                ans = "No"

print(ans)
Buggy code:
c = []
for i in range(3):
  c.append(list(map(int, input()split())))
diff = c[1][2] - c[2][2]
c[1][1] -= diff
c[1][3] -= diff

diff = c[3][2] - c[2][2]
c[3][1] -= diff
c[3][3] -= diff

if c[1][1] == c[2][1] and c[3][1] == c[2][1] and c[1][3] == c[2][3] and c[1][3] == c[3][3]:
  print('Yes')
else:
  print('No')
  


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

diff = c[0][2] - c[2][2]
c[0][1] -= diff
c[0][0] -= diff

if c[1][1] == c[2][1] and c[0][1] == c[2][1] and c[1][0] == c[2][0] and c[1][0] == c[0][0]:
  print('Yes')
else:
  print('No')
Buggy code:
c = [list(map(int, input().split())) for _ in range(3)]

flg = True
t = c[0][1] - c[0][0]
for dj in range(2):
    for i in range(3):
        if t != c[i][1 + dj] - c[i][0 + dj]:
            flg = False
            break
t = c[1][0] - c[0][0]
for di in range(2):
    for j in range(3):
        if t != c[1 + di][j] - c[0 + di][j]:
            flg = False
            break
print('Yes' if flg else 'No')

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

flg = True
for dj in range(2):
    t = c[0][1 + dj] - c[0][0 + dj]
    for i in range(3):
        if t != c[i][1 + dj] - c[i][0 + dj]:
            flg = False
            break
for di in range(2):
    t = c[1 + di][0] - c[0 + di][0]
    for j in range(3):
        if t != c[1 + di][j] - c[0 + di][j]:
            flg = False
            break
print('Yes' if flg else 'No')
Buggy code:
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())

t22 = c12+c21-c11
t32 = t22+c31-c21
t23 = t22+c13-c12
t33 = t23+t32-t22
t = [t22,t23,t32,t33]
c = [c22,c23,c32,c33]
flag = True
for i in range(0,4):
    if t[i]!=c[i]:
        flag = False

if flag==True:
    print("YES")
else:
    print("NO")


Fixed code:
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())

t22 = c12+c21-c11
t32 = t22+c31-c21
t23 = t22+c13-c12
t33 = t23+t32-t22
t = [t22,t23,t32,t33]
c = [c22,c23,c32,c33]
flag = True
for i in range(0,4):
    if t[i]!=c[i]:
        flag = False

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

for a0 in range(101):
  b0=c[0][0]-a0
  b1=c[0][1]-a0
  b2=c[0][2]-a0
  
  a1= c[1][0]-b0
  if a1 != c[1][1]-b1 or a1 != c[1][2]-b2:
    continue
  a2= c[2][0]-b0
  if a2 != c[2][1]-b1 or a2 != c[2][2]-b2:
    continue
  print("Yes")
  print(a0,a1,a2)
  print(b0,b1,b2)
  
  exit()
print("No")

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

for a0 in range(101):
  b0=c[0][0]-a0
  b1=c[0][1]-a0
  b2=c[0][2]-a0
  
  a1= c[1][0]-b0
  if a1 != c[1][1]-b1 or a1 != c[1][2]-b2:
    continue
  a2= c[2][0]-b0
  if a2 != c[2][1]-b1 or a2 != c[2][2]-b2:
    continue
  print("Yes")
  exit()
print("No")