qyliang/CodeNanoFix huggingface dataset:
Buggy code:
c_list = [list(map(int,input().split()))
     for _ in range(3)]

a_list = [0]
b_list = []

for c in c_list[0]:
    b = c - a_list[0]
    b_list.append(b)

for c,b in zip(c_list[0][1:],b_list[1:]):
    a = c - b
    a_list.append(a)

def check():
    for i in range(3):
        for j in range(3):
            a = a_list[i]
            b = b_list[j]
            c = c_list[i][j]
            if not c == a + b:
                return False
    return True

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

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

a_list = [0]
b_list = []

for c in c_list[0]:
    b = c - a_list[0]
    b_list.append(b)

for i in range(1,3):
    c = c_list[i][0]
    b = b_list[0]
    a = c - b
    a_list.append(a)

def check():
    for i in range(3):
        for j in range(3):
            a = a_list[i]
            b = b_list[j]
            c = c_list[i][j]
            if not c == a + b:
                return False
    return True

if check():
    print("Yes")
else:
    print("No")
Buggy code:
n=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
print("Yes" if a[0]-b[0]==a[1]-b[1]==a[2]-b[2] and a[0]-c[0]==a[1]-c[1]==a[2]-c[2] else "No")

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


Fixed code:
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l3=list(map(int,input().split()))
l=[l1,l2,l3]
c=l[0][0]
for i in range(3):
    for j in range(3):
        l[i][j] -=c
if (l[1][1]==l[0][1]+l[1][0]) and (l[2][1]==l[0][1]+l[2][0]) and (l[1][2]==l[0][2]+l[1][0])and (l[2][2]==l[2][0]+l[0][2]):
    print('Yes')
else:
    print("No")
Buggy code:
c = [list(map(int,input().split())) for i in range(3)]
x = c[0][0]
for i in range(x+1):
    a1 = i
    b1 = x-i
    a2 = c[1][0] - b1
    a3 = c[2][0] - b1
    b2 = c[0][1] - a1
    b3 = c[0][2] - a1
    if a2 + b2 == c[1][1] and a2 + b3 == c[1][2] and a3 + b2 == c[2][1] and a3 + b3 == c[2][2]:
        print("Yes")
    else:
        print("No")


Fixed code:
c = [list(map(int,input().split())) for i in range(3)]
x = c[0][0]
for i in range(x+1):
    a1 = i
    b1 = x-i
    a2 = c[1][0] - b1
    a3 = c[2][0] - b1
    b2 = c[0][1] - a1
    b3 = c[0][2] - a1
    if a2 + b2 == c[1][1] and a2 + b3 == c[1][2] and a3 + b2 == c[2][1] and a3 + b3 == c[2][2]:
        print("Yes")
        exit()
print("No")
Buggy code:
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l3=list(map(int,input().split()))
a1=l1[0]
b2=l1[1]-a1
b3=l1[2]-a1
a2=l2[0]
a3=l3[0]
if a2+b2==l2[1] and a2+b3==l2[2] and a3+b2==l3[1] and a3+b3==l3[2];:
  print("Yes")
else:
  print("No")

Fixed code:
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l3=list(map(int,input().split()))
a1=l1[0]
b2=l1[1]-a1
b3=l1[2]-a1
a2=l2[0]
a3=l3[0]
if a2+b2==l2[1] and a2+b3==l2[2] and a3+b2==l3[1] and a3+b3==l3[2]:
  print("Yes")
else:
  print("No")
Buggy code:
a=[0,0,0]
b=[0,0,0]
c=[0,0,0]
a[0],a[1],a[2]=map(int,input().split())
b[0],b[1],b[2]=map(int,input().split())
c[0],c[1],c[2]=map(int,input().split())
flag=0
if((a[0]-b[0])==(a[1]-b[1])) and ((a[0]-b[0])==(a[2]-b[2])):
  if((a[1]-a[0])==(b[1]-b[0])) and ((a[2]-a[0])==(b[2]-b[0])):
    flag=1
if flag==0:
  print("No")
else:
  print("Yes")


Fixed code:
a=[0,0,0]
b=[0,0,0]
c=[0,0,0]
a[0],a[1],a[2]=map(int,input().split())
b[0],b[1],b[2]=map(int,input().split())
c[0],c[1],c[2]=map(int,input().split())
flag=0
flag_2=0
if((a[0]-b[0])==(a[1]-b[1])) and ((a[0]-b[0])==(a[2]-b[2])):
  if((a[0]-c[0])==(a[1]-c[1])) and ((a[0]-c[0])==(a[2]-c[2])):
    flag=1
if((a[1]-a[0])==(b[1]-b[0])) and ((a[2]-a[0])==(b[2]-b[0])):
  if((a[1]-a[0])==(c[1]-c[0])) and ((a[2]-a[0])==(c[2]-c[0])):
    flag_2=1
if flag==1 and flag_2==1:
  print("Yes")
else:
  print("No")
Buggy code:
k = [list(map(int, list(input().split()))) for i in range(3)]

for a1 in range(100):
    for a2 in range(100):
        for a3 in range(100):
            if (k[0][0] - a1) == (k[0][1] - a2) == (k[0][2] - a3):
                if (k[1][0] - a1) == (k[1][1] - a2) == (k[1][2] - a3):
                    if (k[2][0] - a1) == (k[2][1] - a2) == (k[2][2] - a3):
                        if k[0][0] - a1 >= 0 and k[1][0] - a2 >= 0 and k[2][0] - a3 >= 0:
                            print("Yes")
                            exit()

print("No")

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

for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            if (k[0][0] - a1) == (k[0][1] - a2) == (k[0][2] - a3):
                if (k[1][0] - a1) == (k[1][1] - a2) == (k[1][2] - a3):
                    if (k[2][0] - a1) == (k[2][1] - a2) == (k[2][2] - a3):
                        if k[0][0] - a1 >= 0 and k[0][1] - a2 >= 0 and k[0][2] - a3 >= 0:
                            if (k[1][0] - a1) >= 0 and (k[1][1] - a2) >= 0 and (k[1][2] - a3) >= 0:
                                if (k[2][0] - a1) >= 0 and (k[2][1] - a2) >= 0 and (k[2][2] - a3) >= 0:
                                    print("Yes")
                                    exit()

print("No")
Buggy code:
c=[[0 for i in range(3)] for j in range(3)]
a=[0]*3
b=[0]*3

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

for i in range(-500,500):
  a[0]=i
  b[0]=c[0][0]-a[0]
  b[1]=c[0][1]-a[0]
  b[2]=c[0][2]-a[0]
  a[1]=c[1][0]-b[0]
  a[2]=c[2][0]-b[0]
  
  if c[1][1]==a[1]+b[1] and c[1][2]==a[1]+b[2] and c[2][1]==a[2]+b[1] and (c[2][2]==a[2]+b[2]):
    print("Yes")
    print(a,b)
    break
    
  if c[1][1]!=a[1]+b[1] or c[1][2]!=a[1]+b[2] or c[2][1]!=a[2]+b[1] or (c[2][2]!=a[2]+b[2]):
    if i==499:
      print("No")

Fixed code:
c=[[0 for i in range(3)] for j in range(3)]
a=[0]*3
b=[0]*3

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

for i in range(-500,500):
  a[0]=i
  b[0]=c[0][0]-a[0]
  b[1]=c[0][1]-a[0]
  b[2]=c[0][2]-a[0]
  a[1]=c[1][0]-b[0]
  a[2]=c[2][0]-b[0]
  
  if c[1][1]==a[1]+b[1] and c[1][2]==a[1]+b[2] and c[2][1]==a[2]+b[1] and (c[2][2]==a[2]+b[2]):
    print("Yes")
   
    break
    
  if c[1][1]!=a[1]+b[1] or c[1][2]!=a[1]+b[2] or c[2][1]!=a[2]+b[1] or (c[2][2]!=a[2]+b[2]):
    if i==499:
      print("No")
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

def main():
    G = [[0 for _ in range(3)] for _ in range(3)]
    for i in range(3):
        G[i] = [int(e) for e in input().split()]

    for a0 in range(0, 100+1):
        b0 = G[0][0] - a0
        b1 = G[0][1] - a0
        b2 = G[0][2] - a0

        a1 = G[1][0] - b0
        a2 = G[2][0] - b1

        if a0 + b0 == G[0][0] and \
           a0 + b1 == G[0][1] and \
           a0 + b2 == G[0][2] and \
           a1 + b0 == G[1][0] and \
           a1 + b1 == G[1][1] and \
           a1 + b2 == G[1][2] and \
           a2 + b0 == G[2][0] and \
           a2 + b1 == G[2][1] and \
           a2 + b2 == G[2][2]:
               print("Yes")
               return
    print("No")


main()


Fixed code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

def main():
    G = [[0 for _ in range(3)] for _ in range(3)]
    for i in range(3):
        G[i] = [int(e) for e in input().split()]

    for a0 in range(0, 100+1):
        b0 = G[0][0] - a0
        b1 = G[0][1] - a0
        b2 = G[0][2] - a0

        a1 = G[1][0] - b0
        a2 = G[2][0] - b0

        if a0 + b0 == G[0][0] and \
           a0 + b1 == G[0][1] and \
           a0 + b2 == G[0][2] and \
           a1 + b0 == G[1][0] and \
           a1 + b1 == G[1][1] and \
           a1 + b2 == G[1][2] and \
           a2 + b0 == G[2][0] and \
           a2 + b1 == G[2][1] and \
           a2 + b2 == G[2][2]:
               print("Yes")
               return
    print("No")


main()
Buggy code:
ls1 = list(map(int, input().split()))
ls2 = list(map(int, input().split()))
ls3 = list(map(int, input().split()))

ls = [ls1, ls2, ls3]
ans = 0
if ls[1][0]-ls[0][0] == ls[1][1]-ls[0][1] and ls[1][1]-ls[0][1] == ls[1][2]-ls[0][2]:
            ans += 1;
if ls[0][1]-ls[0][0] == ls[1][1]-ls[1][0] and ls[1][1] -ls [1][0] == ls[2][1]-ls[2][0]:
            ans += 1;

if ans == 2:
    print('Yes')
else:
    print('No')

   

Fixed code:
ls1 = list(map(int, input().split()))
ls2 = list(map(int, input().split()))
ls3 = list(map(int, input().split()))

ls = [ls1, ls2, ls3]
ans = 0
if ls[1][0]-ls[0][0] == ls[1][1]-ls[0][1] and ls[1][1]-ls[0][1] == ls[1][2]-ls[0][2]:
    ans += 1 
if ls[2][0]-ls[1][0] == ls[2][1]-ls[1][1] and ls[2][1]-ls[1][1] == ls[2][2]-ls[1][2]:
    ans += 1 
if ls[0][1]-ls[0][0] == ls[1][1]-ls[1][0] and ls[1][1] -ls [1][0] == ls[2][1]-ls[2][0]:
    ans += 1 
if ls[0][2]-ls[0][1] == ls[1][2]-ls[1][1] and ls[1][2] -ls [1][1] == ls[2][2]-ls[2][1]:
    ans += 1 

if ans == 4:
    print('Yes')
else:
    print('No')
Buggy code:
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

def ok(a1, c):
    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:
        return False
    if c[2][0] - b1 != c[2][1] - b2 != c[2][2] - b3:
        return False

    return True

def main():
    c = []
    for _ in range(3):
        c.append(list(map(int, input().split())))

    for a1 in range(101):
        if ok(a1, c):
            print(Yes)
            return
    print(No)

if __name__ == '__main__':
    main()


Fixed code:
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

def ok(a1, c):
    b1 = c[0][0] - a1
    b2 = c[0][1] - a1
    b3 = c[0][2] - a1

    if len(set([c[1][0] - b1,  c[1][1] - b2,  c[1][2] - b3])) != 1:
        return False
    if len(set([c[2][0] - b1, c[2][1] - b2, c[2][2] - b3])) != 1:
        return False

    return True

def main():
    c = []
    for _ in range(3):
        c.append(list(map(int, input().split())))

    for a1 in range(101):
        if ok(a1, c):
            print(Yes)
            return
    print(No)

if __name__ == '__main__':
    main()
Buggy code:
C = []
for i in range(3):
    C.append(list(map(int, input().split())))
if ((C[0][0]-C[1][0])==(C[0][1]-C[1][1])==(C[0][2]-C[1][2]) and\
 (C[1][0]-C[2][0])==(C[1][1]-C[2][1])==(C[1][2]-C[2][2]) and\
 (C[2][0]-C[0][0])==(C[2][1]-C[0][1])==(C[2][2]-C[0][2]) and\
 (C[0][0]-C[0][1])==(C[1][0]-C[1][1])==(C[2][0]-C[2][1]) and\
 (C[0][1]-C[0][2])==(C[1][1]-C[1][2])==(C[2][1]-C[2][2]) and\
 (C[0][2]-C[0][0])==(C[1][2]-C[1][0])==(C[2][2]-C[2][0])):
    print('Yes')
else:
    print('NO')


Fixed code:
C = []
for i in range(3):
    C.append(list(map(int, input().split())))
if ((C[0][0]-C[1][0])==(C[0][1]-C[1][1])==(C[0][2]-C[1][2]) and\
 (C[1][0]-C[2][0])==(C[1][1]-C[2][1])==(C[1][2]-C[2][2]) and\
 (C[2][0]-C[0][0])==(C[2][1]-C[0][1])==(C[2][2]-C[0][2]) and\
 (C[0][0]-C[0][1])==(C[1][0]-C[1][1])==(C[2][0]-C[2][1]) and\
 (C[0][1]-C[0][2])==(C[1][1]-C[1][2])==(C[2][1]-C[2][2]) and\
 (C[0][2]-C[0][0])==(C[1][2]-C[1][0])==(C[2][2]-C[2][0])):
    print('Yes')
else:
    print('No')
Buggy code:
C=[list(map(int,input().split())) for i in range(3)]
for n in range(0,2):
  x=C[0][2]-C[0][n]
  y=C[1][2]-C[1][n]
  z=C[2][2]-C[2][n]
  if x==y and y==z :
    print('Yes')
    exit()
else:
  print('No')

Fixed code:
C=[list(map(int,input().split())) for i in range(3)]
for n in range(0,2):
  x=C[0][2]-C[0][n]
  y=C[1][2]-C[1][n]
  z=C[2][2]-C[2][n]
  if x!=y or y!=z :
    print('No')
    exit()
else:
  print('Yes')
Buggy code:
C=[list(map(int,input().split())) for i in range(3)]
print(C)
print(C[1][0])
if C[0][1]-C[0][0]==C[1][1]-C[1][0] and C[1][1]-C[1][0]==C[2][1]-C[2][0]:
  print('Yes')
else:
  print('No')

Fixed code:
c = [list(map(int, input().split())) for i in range(3)]
print('Yes' if c[1][0] - c[0][0] == c[1][1] - c[0][1] == c[1][2] - c[0][2] and
      c[2][0] - c[1][0] == c[2][1] - c[1][1] == c[2][2] - c[1][2] else 'No')
Buggy code:
s1,s2,s3 = map(int, input().split())
s4,s5,s6 = map(int, input().split())
s7,s8,s9 = map(int, input().split())

if s1-s4=s2-s5=s3-s6 and s4-s7=s5-s8=s6-s9:
  print("Yes")
else:
  print("No")

Fixed code:
s1,s2,s3 = map(int, input().split())
s4,s5,s6 = map(int, input().split())
s7,s8,s9 = map(int, input().split())

if s1-s4==s2-s5==s3-s6 and s4-s7==s5-s8==s6-s9:
  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()))


for a in range(0,101):
    for b in range(0,101):
        for c in range(0,101):
            for d in range(0,101):
                for e in range(0,101):
                    for f in range(0,101):
                        a1 = f
                        a2 = e
                        a3 = d
                        b1 = c
                        b2 = b
                        b3 = a
                        if a1 + b1 == c1[0] and a1 +b2 == c1[1] and a1 + b3 ==c1[2] \
                            and a2 + b1 == c2[0] and a2 +b2 == c2[1] and a2 + b3 ==c2[2] \
                                and a3 + b1 == c3[0] and a3 +b2 == c3[1] and a3 + b3 ==c3[2]:
                                print("Yes")
                                exit()
print("No")


Fixed code:
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))


for a in range(0,101):
    for b in range(0,101):
        for c in range(0,101):
                        a1 = a
                        a2 = b
                        a3 = c
                        b1 = c1[0] - a1
                        b2 = c1[1] - a1
                        b3 = c1[2] - a1
                        if a1 + b1 == c1[0] and a1 +b2 == c1[1] and a1 + b3 ==c1[2] \
                            and a2 + b1 == c2[0] and a2 +b2 == c2[1] and a2 + b3 ==c2[2] \
                                and a3 + b1 == c3[0] and a3 +b2 == c3[1] and a3 + b3 ==c3[2]:
                                print("Yes")
                                exit()
print("No")
Buggy code:
c = [list(map(int, input().split())) for _ in range(3)]
b0, b1, b2 = c[0][0], c[0][1], c[0][1]
for i in range(1, 3):
    if not ((c[i][0]-b0)==(c[i][1]-b1)==(c[i][2]-b2)):
        print('No')
        exit()
print('Yes')

Fixed code:
c = [list(map(int, input().split())) for _ in range(3)]
b0 = c[0][0]
b1 = c[0][1]
b2 = c[0][2]
for i in range(1, 3):
    a0 = c[i][0] - b0
    a1 = c[i][1] - b1
    a2 = c[i][2] - b2
    if not a0 == a1 == a2:
        print('No')
        exit()
print('Yes')
Buggy code:
m=[list(map(int,input().split()))for i in range(3)]
ans=1
if m[0][0]-m[1][0]!=m[0][1]-m[1][1]:
  ans=0
if m[0][0]-m[1][0]!=m[0][2]-m[1][2]:
  ans=0
if m[0][0]-m[2][0]!=m[0][1]-m[2][1]:
  ans=0
if m[0][0]-m[2][0]!=m[0][2]-m[2][2]:
  ans=0
if m[0][0]-m[0][1]!=m[1][0]-m[1][1]:
  ans=0
if m[0][0]-m[0][1]!=m[2][0]-m[2][1]:
  ans=0
if m[0][0]-m[0][2]!=m[1][0]-m[1][2]:
  ans=0
if m[0][0]-m[0][2]!=m[2][0]-m[2][2]:
  ans=0
print("YNeos"[and::2])

Fixed code:
m=[list(map(int,input().split()))for i in range(3)]
ans=0
if m[0][0]-m[1][0]!=m[0][1]-m[1][1]:
  ans=1
if m[0][0]-m[1][0]!=m[0][2]-m[1][2]:
  ans=1
if m[0][0]-m[2][0]!=m[0][1]-m[2][1]:
  ans=1
if m[0][0]-m[2][0]!=m[0][2]-m[2][2]:
  ans=1
if m[0][0]-m[0][1]!=m[1][0]-m[1][1]:
  ans=1
if m[0][0]-m[0][1]!=m[2][0]-m[2][1]:
  ans=1
if m[0][0]-m[0][2]!=m[1][0]-m[1][2]:
  ans=1
if m[0][0]-m[0][2]!=m[2][0]-m[2][2]:
  ans=1
print("YNeos"[ans::2])
Buggy code:
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))

a1_a2 = c1[0] - c2[0]
a2_a3 = c2[0] - c3[0]
b1_b2 = c1[0] - c1[1]
b2_b3 = c1[1] - c1[2]

cnt = 0
if a1_a2 == c1[1]-c2[1] == c1[2]-c2[2]:
    cnt += 1
if a2_a3 == c2[1]-c3[1] == c2[2]-c3[2]:
    cnt += 1
if b1_b2 == c2[0]-c2[1] == c3[0]-c3[1]:
    cnt += 1
if b2_b3 == c2[1]-c2[2] == c3[1]-c2[2]:
    cnt += 1

if cnt == 4:
    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 = c1[0] - c2[0]
a2_a3 = c2[0] - c3[0]
b1_b2 = c1[0] - c1[1]
b2_b3 = c1[1] - c1[2]

cnt = 0
if a1_a2 == c1[1]-c2[1] == c1[2]-c2[2]:
    cnt += 1
if a2_a3 == c2[1]-c3[1] == c2[2]-c3[2]:
    cnt += 1
if b1_b2 == c2[0]-c2[1] == c3[0]-c3[1]:
    cnt += 1
if b2_b3 == c2[1]-c2[2] == c3[1]-c3[2]:
    cnt += 1

if cnt == 4:
    print("Yes")
else:
    print("No")
Buggy code:
C = [list(map(int,input().split())) for _ in range(3)]
if C[1][0]-C[0][0]==C[1][1]-C[0][1]==C[1][2]-C[0][2] and C[2][0]-C[0][0]==C[2][1]-C[0][1]==C[2][2]-C[0][2] \
and C[0][1]-C[0][0]==C[1][1]-C[1][0]==C[2][1]-C[2][0] and C[0][2]-C[0][0]==C[1][2]-C[1][0]==C[2][2]-C[2][0]:
    print("Yes")


Fixed code:
C = [list(map(int,input().split())) for _ in range(3)]
if C[0][0]-C[0][1]==C[1][0]-C[1][1]==C[2][0]-C[2][1] and C[0][1]-C[0][2]==C[1][1]-C[1][2]==C[2][1]-C[2][2] \
    and C[1][0]-C[0][0]==C[1][1]-C[0][1]==C[1][2]-C[0][2] and C[2][0]-C[1][0]==C[2][1]-C[1][1]==C[2][2]-C[1][2]:
    print("Yes")
else:
    print("No")
Buggy code:
l=[]
list(map(int,input().split())).append(l)
list(map(int,input().split())).append(l)
list(map(int,input().split())).append(l)
for i in range(2):
  if l[i][1]-l[i][0]!=l[i+1][1]-l[i+1][0] and l[i][2]-l[i][1]!=l[i+1][2]-l[i+1][1]:
    print('No')
    break
  if i==1:
    print('Yes')


Fixed code:
l=[]
l.append(list(map(int,input().split())))
l.append(list(map(int,input().split())))
l.append(list(map(int,input().split())))
for i in range(2):
  if l[i][1]-l[i][0]!=l[i+1][1]-l[i+1][0] or l[i][2]-l[i][1]!=l[i+1][2]-l[i+1][1]:
    print('No')
    break
  if i==1:
    print('Yes')
Buggy code:
N = [[int(i) for i in input().split()] for j in range(3)]

if N[0][0]-N[0][1]==N[0][1]-N[0][2] and N[1][0]-N[1][1]==N[1][1]-N[1][2] and N[2][0]-N[2][1]==N[2][1]-N[2][2] and N[0][0]-N[1][0]==N[1][0]-N[2][0] and N[0][1]-N[1][1]==N[1][1]-N[2][1] and N[0][2]-N[1][2]==N[1][2]-N[2][2]:
        print('Yes')
else:
        print('No')

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

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



for a1 in range(101):
    b1 = c[0][0] - a1
    b2 = c[1][0] - a1
    b3 = c[2][0] - a1
    a2 = c[0][1] - b1
    if a2 != (c[1][1] - b2) and a2 != (c[2][1] - b3):
        print("No")
        exit()
    a3 = c[2][0] - b1
    if a3 != (c[2][1] - b2) and a3 != (c[2][2] - b3):
        print("No")
        exit()
    if a1 < 0 or a2 < 0 or a3 < 0 or b1 < 0 or b2 < 0 or b3 < 0:
        print("No")
        exit()
print("Yes")

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



for a1 in range(101):
    flag = True
    b1 = c[0][0] - a1
    b2 = c[1][0] - a1
    b3 = c[2][0] - a1
    a2 = c[0][1] - b1
    if a2 != (c[1][1] - b2) or a2 != (c[2][1] - b3):
        flag = False
    a3 = c[0][2] - b1
    if a3 != (c[1][2] - b2) or a3 != (c[2][2] - b3):
        flag = False

    if a1 < 0 or a2 < 0 or a3 < 0 or b1 < 0 or b2 < 0 or b3 < 0:
        flag = False

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

a = [0, -1, -1]
b = [0, 0, 0]
for i in range(3):
    b[i] = c[0][i] - a[0]
a[1] = c[1][1] - b[1]

flag = True
for i in range(3):
    for j in range(3):
        if a[i] + b[j] == c[i][j]:
            pass
        else:
            flag = False
            break

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

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

a = [0, -1, -1]
b = [0, 0, 0]
for i in range(3):
    b[i] = c[0][i] - a[0]
a[1] = c[1][1] - b[1]
a[2] = c[2][1] - b[1]

flag = True
for i in range(3):
    for j in range(3):
        if a[i] + b[j] == c[i][j]:
            pass
        else:
            flag = False
            break

if flag:
    print('Yes')
else:
    print('No')
Buggy code:
num=[]
for i in range(3):
  nums.append(list(map(int,input().split())))
subd=[]
for i in range(3):
  subd.append([nums[i][0]-nums[i][1],nums[i][1]-nums[i][2]])
for i in range(3):
  subd.append([nums[0][i]-nums[1][i],nums[1][i]-nums[2][i]])
if subd[0]==subd[1] and subd[1]==subd[2] and subd[3]==subd[4] and subd[4]==subd[5]:
  print("Yes")
else:
  print("No")



Fixed code:
nums=[]
for i in range(3):
  nums.append(list(map(int,input().split())))
subd=[]
for i in range(3):
  subd.append([nums[i][0]-nums[i][1],nums[i][1]-nums[i][2]])
for i in range(3):
  subd.append([nums[0][i]-nums[1][i],nums[1][i]-nums[2][i]])
if subd[0]==subd[1] and subd[1]==subd[2] and subd[3]==subd[4] and subd[4]==subd[5]:
  print("Yes")
else:
  print("No")
Buggy code:
import numpy as np

l = []

for _ in range(3):
    a = [int(x) for x in input().split()]
    l.append(a)

l = np.array(l)

def check(m):
    a = []
    for i in range(3):
        b,c = m[i,0] - m[i,1], m[i,1] - m[i,2]
        m.append((b,c))
    if a[0] != a[1] or a[1] != a[2]:
        return False
    else:
        return True

if check(l) and check(np.transpose(l)):
    print('Yes')
else:
    print('No')

Fixed code:
import numpy as np

l = []

for _ in range(3):
    a = [int(x) for x in input().split()]
    l.append(a)

l = np.array(l)

def check(m):
    a = []
    for i in range(3):
        b,c = m[i,0] - m[i,1], m[i,1] - m[i,2]
        a.append((b,c))
    if a[0] != a[1] or a[1] != a[2]:
        return False
    else:
        return True

if check(l) and check(np.transpose(l)):
    print('Yes')
else:
    print('No')
Buggy code:
C = []
for _ in range(3):
    C.append(list(map(int,input().split())))
flag = 1
for i in range(2):
    if C[i+1][0] - C[i][0] != C[i+1][1] - C[i][1] and C[i+1][1] - C[i][1] != C[i+1][2] - C[i][2]:
        flag = 0
    if C[0][i+1] - C[0][i] != C[1][i+1] - C[1][i] and C[1][i+1] - C[1][i] != C[2][i+1] - C[2][i]:
        flag = 0

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

Fixed code:
C = []
for _ in range(3):
    C.append(list(map(int,input().split())))
flag = 1
for i in range(2):
    if C[i+1][0] - C[i][0] != C[i+1][1] - C[i][1] or C[i+1][1] - C[i][1] != C[i+1][2] - C[i][2]:
        flag = 0
    if C[0][i+1] - C[0][i] != C[1][i+1] - C[1][i] or C[1][i+1] - C[1][i] != C[2][i+1] - C[2][i]:
        flag = 0

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

ans = True

X = 0
b = [c[i][0] - X for i in range(3)]
a = [c[0][i] - b[i] for i in range(3)]

for i in range(3) :
    for j in range(3) :
        if a[j] + b[i] != c[i][j] :
            ans = False

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


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

ans = True

X = 0
b = [c[i][0] - X for i in range(3)]
a = [c[0][i] - b[0] for i in range(3)]

for i in range(3) :
    for j in range(3) :
        if a[j] + b[i] != c[i][j] :
            ans = False

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