Problem:


Score: 300 points

Problem Statement

We have a 3 \times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.

According to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.

Determine if he is correct.  

Constraints

c_{i, j} \ (1 \leq i \leq 3, 1 \leq j \leq 3) is an integer between 0 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

c_{1,1} c_{1,2} c_{1,3}
c_{2,1} c_{2,2} c_{2,3}
c_{3,1} c_{3,2} c_{3,3}

Output

If Takahashi's statement is correct, print Yes; otherwise, print No.

Sample Input 1

1 0 1
2 1 2
1 0 1

Sample Output 1

Yes

Takahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.

Sample Input 2

2 2 2
2 1 2
2 2 2

Sample Output 2

No

Takahashi is incorrect in this case.

Sample Input 3

0 8 8
0 8 8
0 8 8

Sample Output 3

Yes

Sample Input 4

1 8 6
2 9 7
0 7 7

Sample Output 4

No



Sample input:
1 0 1
2 1 2
1 0 1


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
c = list([list(map(int,input().split())) for i in range(3)])
sum1 = 0
for i in c:
    sum1 += sum(i)
print("Yes" if not sum1%3 else "No")

Submission status: Wrong Answer

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

temp = max(c1)
if temp == 0:
    print("No")
    exit()

for i in range(temp):
    x1= c1[0] - i
    x2 = c1[1] - i
    x3 = c1[2] - i
    y1 = i
    y2 = c2[0] - x1
    y3 = c3[0] - x1
    
    if x1+y1 == c1[0] and x2+y1 == c1[1] and x3+y1 == c1[2] and x1+y2 == c2[0] and x2+y2 == c2[1] and x3+y2 == c2[2] and x1+y3 == c3[0] and x2+y3 == c3[1] and x3+y3 == c3[2]:
        print("Yes")
        break
    else:
        print("No")
        break

Submission status: Wrong Answer

Solution code:
C = [list(map(int, input().split())) for _ in range(3)]
a1 = 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 C[1][1] == a2 + b2 :
    if C[1][2] == a2 + b3 :
        if C[2][1] == a3 + b2:
            if C[2][2] == a3 + b3 :
                print('Yes')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
C = [list(map(int, input().split())) for _ in range(3)]
a1 = 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 C[0][0] == a1 + b1 :
    if C[1][1] == a2 + b2 :
        if C[2][2] == a3 + b3 :
            print('Yes')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
C = [list(map(int, input().split())) for _ in range(3)]
a1 = 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 C[0][0] == a1 + b1 :
    if C[0][0] == a1 + b1 :
        if C[0][0] == a1 + b1 :
            print('Yes')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,y=map(int,input().split())
ans=0
for i in range(101):
    for j in range(101):
        if i+j==a:
            for k in range(101):
                if i+k==b:
                    for l in range(101):
                        if i+l==c:
                            for m in range(101):
                                if m+j==d:
                                    for n in range(101):
                                        if n+j==g and m+k==e and m+l==f and n+k==h and n+l==y:
                                            print("Yes")
                                            ans+=1
if ans==0:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,y=map(int,input().split())
ans=0
ansans=[]
for i in range(101):
    for j in range(101):
        if i+j==a:
            for k in range(100-i):
                if i+k==b:
                    for l in range(100-i):
                        if i+l==c:
                            for m in range(100-j):
                                if m+j==d:
                                    for n in range(100-j):
                                        if n+j==g and m+k==e and m+l==f and n+k==h and n+l==y:
                                            print("Yes")
                                            ans+=1
if ans==0:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,y=map(int,input().split())
ans=0
for i in range(100):
    for j in range(100):
        if i+j==a:
            for k in range(100):
                if i+k==b:
                    for l in range(100):
                        if i+l==c:
                            for m in range(100):
                                if m+j==d:
                                    for n in range(100):
                                        if n+j==g and m+k==e and m+l==f and n+k==h and n+l==y:
                                            print("Yes")
                                            ans+=1
if ans==0:
    print("No")

Submission status: Wrong Answer

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

for i in range(3):
    for j in range(3):
        if c[i][j] < min(c[i]) + min([c[0][j], c[1][j], c[2][j]]):
            flag = True
            continue
        if i == 2 and j == 2:
            ans = True
    if flag:
        break

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

Submission status: Wrong Answer

Solution code:
c_table = [list(map(int, input().split())) for _ in range(3)]
a = [0]*3
b = [0]*3

# a1を0と仮定して b1,b2,b3 の値を求める
for i in range(3):
    b[i] = c_table[0][i]
# b1の値から逆算して a1,a2,a3 の値を求める
for i in range(3):
    a[i] = c_table[i][0]-b[0]

for i in range(3):
    for j in range(3):
        if a[i]-b[j] == c_table[i][j]:
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

Solution code:
c_table = [list(map(int, input().split())) for _ in range(3)]
a = [0]*3
b = [0]*3

# aを0と仮定してbの値を求める
for i in range(3):
    b[i] = c_table[0][i]-0
# bの値から逆算してaの値を求める
for i in range(3):
    a[i] = c_table[0][i]-b[i]

for i in range(3):
    for j in range(3):
        if a[i]+b[j] == c_table[i][j]:
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

Solution code:
c_table = [list(map(int, input().split())) for _ in range(3)]
a = [0]*3
b = [0]*3

# aを0と仮定してbの値を求める
for i in range(3):
    b[i] = c_table[0][i]-0
# bの値から逆算してaの値を求める
for i in range(3):
    a[i] = c_table[0][i]-b[i]

for i in range(3):
    for j in range(3):
        if a[i]-b[j] == c_table[i][j]:
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c = []
for _ in range(3):
  c.append(list(map(int,input().split())))
  
  
if c[0][1] - c[1][1] + c[1][0] == c[0][2] - c[1][2] + c[1][0] \
and c[0][1] - c[2][1] + c[2][0] == c[0][2] - c[2][2] + c[2][0] \
and c[1][1] - c[2][1] + c[2][0] == c[1][2] - c[2][2] + c[2][0]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from numpy import*
x=array([list(map(int,input().split()))for i in range(3)])
if sum(x[0]+x[1]+x[2])%3==0 and sum(x[:,0]+x[:,1]+x[:,2])%3==0:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

Solution code:
from numpy import*
x=array([list(map(int,input().split()))for i in range(3)])
if len(set(x[0]-x[1]))==len(set(x[1]-x[2]))==len(set(x[2]-x[0])):
    if len(set(x[:,0]-x[:,1]))==len(set(x[:,1]-x[:,2]))==len(set(x[:,2]-x[:,0])):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

Sum = 0
for i in c:
    Sum += sum(i)

if Sum % 3:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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"[ans::2])

Submission status: Wrong Answer

Solution code:
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
flag=False
for a1 in range(c11):
    b1=c11-a1
    b2=c12-a1
    b3=c13-a1
    a2=c21-b1
    a3=c31-b1
    if c22==a2+b2 and c23==a2+b3 and c32==a3+b2 and c33==a3+b3:
        print("Yes")
        flag=True
        break
if flag==False:       
    print("No")
else:
    pass

Submission status: Wrong Answer

Solution code:
import numpy as np
import numpy.linalg as LA
a=[int(i) for i in input().split()]
a=[a,[int(i) for i in input().split()]]
a.append([int(i) for i in input().split()])
a = np.array(a)
if LA.det(a)==0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
C = [0]*3
C1 = [[0]*2]*3
C2 = [[0]*3]*2
for i in range(3):
  C[i] = list(map(int, input().split()))
for i in range(3):
  for j in range(2):
    C1[i][j] = C[i][j] - C[i][j+1]
for i in range(2):
  for j in range(3):
    C2[i][j] = C[i][j] - C[i+1][j]
    
if(C1[0][0] == C1[1][0] == C1[2][0]):
  if(C1[0][1] == C1[1][1] == C1[2][1]):
    if(C2[0][0] == C2[0][1] == C2[0][2]):
      if(C2[1][0] == C2[1][1] == C2[1][2]):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
C = [0]*3
C1 = [[0]*2]*3
C2 = [[0]*3]*2
for i in range(3):
  C[i] = list(map(int, input().split()))
for i in range(3):
  for j in range(2):
    C1[i][j] = C[i][j] - C[i][j+1]
for i in range(2):
  for j in range(3):
    C2[i][j] = C[i][j] - C[i+1][j]
    
if(C1[0][0] == C1[1][0] == C1[2][0]):
  if(C1[0][1] == C1[1][1] == C1[2][1]):
    if(C2[0][0] == C2[0][1] == C2[0][2]):
      if(C2[1][0] == C2[1][1] == C2[1][2]):
        print("No")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
C = [0]*3
C1 = [[0]*2]*3
C2 = [[0]*3]*2
for i in range(3):
  C[i] = list(map(int, input().split()))
for i in range(3):
  for j in range(2):
    C1[i][j] = C[i][j] - C[i][j+1]
for i in range(2):
  for j in range(3):
    C2[i][j] = C[i][j] - C[i+1][j]
if(C1[0][0] != C1[1][0] or C1[1][0] != C1[2][0]):
  print("No")
  exit()
if(C1[0][1] != C1[1][1] or C1[1][1] != C1[2][1]):
  print("No")
  exit()
if(C2[0][0] != C2[0][1] or C2[0][1] != C2[0][2]):
  print("No")
  exit()
if(C2[1][0] != C2[1][1] or C2[1][1] != C2[1][2]):
  print("No")
  exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
C = [0]*3
C1 = [[0]*2]*3
C2 = [[0]*3]*2
for i in range(3):
  C[i] = list(map(int, input().split()))
for i in range(3):
  for j in range(2):
    C1[i][j] = C[i][j] - C[i][j+1]
for i in range(2):
  for j in range(3):
    C2[i][j] = C[i][j] - C[i+1][j]
if(C1[0][0] != C1[1][0] or C1[1][0] != C1[2][0]):
  print("No")
  exit()
if(C1[0][1] != C1[1][1] or C1[1][1] != C1[2][1]):
  print("No")
  exit()
if(C2[0][0] != C2[0][1] or C2[0][1] != C2[0][2]):
  print("No")
  exit()
if(C2[1][0] != C2[1][1] or C2[1][1] != C2[1][2]):
  print("No")
  exit()
print("No")

Submission status: Wrong Answer

Solution code:
C = [0]*3
C1 = [[0]*2]*3
C2 = [[0]*3]*2
for i in range(3):
  C[i] = list(map(int, input().split()))
for i in range(3):
  for j in range(2):
    C1[i][j] = C[i][j] - C[i][j+1]
for i in range(2):
  for j in range(3):
    C2[i][j] = C[i][j] - C[i+1][j]
if(C1[0][0] == C1[1][0] and C1[1][0] == C1[2][0]):
  if(C1[0][1] == C1[1][1] and C1[1][1] == C1[2][1]):
    if(C2[0][0] == C2[0][1] and C2[0][1] == C2[0][2]):
      if(C2[1][0] == C2[1][1] and C2[1][1] == C2[1][2]):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
C = [0]*3
C1 = [[0]*2]*3
C2 = [[0]*3]*2
for i in range(3):
  C[i] = list(map(int, input().split()))
for i in range(3):
  for j in range(2):
    C1[i][j] = C[i][j] - C[i][j+1]
for i in range(2):
  for j in range(3):
    C2[i][j] = C[i][j] - C[i+1][j]
if(C1[0][0] == C1[1][0] and C1[1][0] == C1[2][0]):
  if(C1[0][1] == C1[1][1] and C1[1][1] == C1[2][1]):
    if(C2[0][0] == C2[0][1] and C2[0][1] == C2[0][2]):
      if(C2[1][0] == C2[1][1] and C2[1][1] == C2[1][2]):
        print("Yes")
        exit()
else:
  print("No")

Submission status: Wrong Answer

Solution code:
#escape_ck_ans
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))
a=[0]*3
b=[0]*3
a[0]=0#一つ固定する
a[1]=c[1][1]-c[0][1]
a[2]=c[2][2]-c[0][2]
b[0]=c[0][0]
b[1]=c[0][1]
b[2]=c[0][2]
flag=True
for i in range(3):
    for j in range(3):
        if c[i][j]!=a[i]+b[i]:
            flag=False
if flag==True:
    print("Yes")
else:
    print("No")
""" 
print("Yes") if flag(is true) else print("No")
"""

Submission status: Wrong Answer

Solution code:
g = [list(map(int, input().split())) for _ in range(3)]
for x in range(101):
    for y in range(101):
        for z in range(101):
            if g[0][0] - x != g[1][0] - y:
                break
            if g[0][1] - x != g[1][1] - y:
                break
            if g[0][2] - x != g[1][2] - y:
                break
            if g[1][0] - y != g[2][0] - z:
                break
            if g[1][1] - y != g[2][1] - z:
                break
            if g[1][2] - y != g[2][2] - z:
                break
            if g[0][0] - x != g[2][0] - z:
                break
            if g[0][1] - x != g[2][1] - z:
                break
            if g[0][2] - x != g[2][2] - z:
                break

            if g[0][0] - x > 100 or g[0][0] - x < 0:
                break
            if g[0][1] - x > 100 or g[0][1] - x < 0:
                break
            if g[0][2] - x > 100 or g[0][2] - x < 0:
                break
            if g[1][0] - y > 100 or g[1][0] - y < 0:
                break
            if g[1][1] - y > 100 or g[1][1] - y < 0:
                break
            if g[1][2] - y > 100 or g[1][2] - y < 0:
                break
            if g[2][0] - z > 100 or g[2][0] - z < 0:
                break
            if g[2][1] - z > 100 or g[2][1] - z < 0:
                break
            if g[2][2] - z > 100 or g[2][2] - z < 0:
                break
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
g = [list(map(int, input().split())) for _ in range(3)]
for x in range(101):
    for y in range(101):
        for z in range(101):
            if g[0][0] - x != g[1][0] - y:
                break
            if g[0][1] - x != g[1][1] - y:
                break
            if g[0][2] - x != g[1][2] - y:
                break
            if g[1][0] - y != g[2][0] - z:
                break
            if g[1][1] - y != g[2][1] - z:
                break
            if g[1][2] - y != g[2][2] - z:
                break
            if g[0][0] - x != g[2][0] - z:
                break
            if g[0][1] - x != g[2][1] - z:
                break
            if g[0][2] - x != g[2][2] - z:
                break

            if g[0][0] - x > 100:
                break
            if g[0][1] - x > 100:
                break
            if g[0][2] - x > 100:
                break
            if g[1][0] - y > 100:
                break
            if g[1][1] - y > 100:
                break
            if g[1][2] - y > 100:
                break
            if g[2][0] - z > 100:
                break
            if g[2][1] - z > 100:
                break
            if g[2][2] - z > 100:
                break
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
g = [list(map(int, input().split())) for _ in range(3)]
for x in range(101):
    for y in range(101):
        for z in range(101):
            if g[0][0] - x != g[1][0] - y:
                break
            if g[0][1] - x != g[1][1] - y:
                break
            if g[0][2] - x != g[1][2] - y:
                break
            if g[1][0] - y != g[2][0] - z:
                break
            if g[1][1] - y != g[2][1] - z:
                break
            if g[1][2] - y != g[2][2] - z:
                break
            if g[0][0] - x != g[2][0] - z:
                break
            if g[0][1] - x != g[2][1] - z:
                break
            if g[0][2] - x != g[2][2] - z:
                break
            if g[0][0] - x >= 0 and g[0][1] - x >= 0 and g[0][2] - x >= 0:
                if g[1][0] - y >= 0 and g[1][1] - y >= 0 and g[1][2] - y >= 0:
                    if g[2][0] - z >= 0 and g[2][1] - z >= 0 and g[2][2] - z >= 0:
                        print('Yes')
                        exit()

print('No')

Submission status: Wrong Answer

Solution code:
g = [list(map(int, input().split())) for _ in range(3)]
for x in range(101):
    for y in range(101):
        for z in range(101):
            if g[0][0] - x != g[1][0] - y and g[0][0] - x > 0:
                break
            if g[0][1] - x != g[1][1] - y and g[0][1] - x > 0:
                break
            if g[0][2] - x != g[1][2] - y and g[0][2] - x > 0:
                break
            if g[1][0] - y != g[2][0] - z and g[1][0] - y > 0:
                break
            if g[1][1] - y != g[2][1] - z and g[1][1] - y > 0:
                break
            if g[1][2] - y != g[2][2] - z and g[1][2] - y > 0:
                break
            if g[0][0] - x != g[2][0] - z and g[2][0] - z > 0:
                break
            if g[0][1] - x != g[2][1] - z and g[2][1] - z > 0:
                break
            if g[0][2] - x != g[2][2] - z and g[2][2] - z > 0:
                break
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
g = [list(map(int, input().split())) for _ in range(3)]
for x in range(101):
    for y in range(101):
        for z in range(101):
            if g[0][0] - x != g[1][0] - y:
                break
            if g[0][1] - x != g[1][1] - y:
                break
            if g[0][2] - x != g[1][2] - y:
                break
            if g[1][0] - y != g[2][0] - z:
                break
            if g[1][1] - y != g[2][1] - z:
                break
            if g[1][2] - y != g[2][2] - z:
                break
            if g[0][0] - x != g[2][0] - z:
                break
            if g[0][1] - x != g[2][1] - z:
                break
            if g[0][2] - x != g[2][2] - z:
                break
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

C = [[0,0,0,0]]
for i in range(3):
    C.append([0] + LI())

"""
yxの順
a1 + b1 = c11
a2 + b1 = c21
a3 + b1 = c31
a1 + b2 = c12
a2 + b2 = c22

b1 = b2 + c11 - c12
b2 = -a2 + c22
b1 = -a2 + c22 + c11 - c12
a2 - a2 + c22 + c11 - c12 = c21
c22+c11 = c21 + c12

"""
#  print(C)
if (C[2][2] + C[1][1] - C[1][2] == C[2][1]) and (C[1][1] + C[3][3] == C[1][3] + C[3][1]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
C = 0
for i in range(3):
    C += sum([int(n) for n in input().split()])

if C % 3 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
C=[list(map(int,input().split())) for i in range(3)]
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 b1>=0 and b2>=0 and b3>=0 and a2>=0 and a3>=0:
    if a2+b2==C[1][1]:
      if a2+b2==C[1][1]:
        if a2+b3==C[1][2]:
          if a3+b1==C[2][0]:
            if a3+b2==C[2][1]:
              if a3+b3==C[2][2]:
                print('Yes')
                exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
mat = [list(map(int, input().split())) for i in range(3)]
array = np.array(mat, dtype=np.int64)
a20 = array[2]-array[0]
a10 = array[1]-array[0]
b20 = array[:,2]-array[:,0]
b10 = array[:,1]-array[:,0]
flag  = False
if (a20==a20[0]).all() and (a10==a10[0]).all() and (b20==b20[0]).all() and (b10==b10[0]).all():
    print('OK')
    for a1 in range(0, 101):
        a2 = a1+ a10[0]
        a3 = a1 + a20[0]
        b1 = array[0,0] - a1
        b2 = b1 + b10[0]
        b3 = b1 +b20[0]
        A = np.array([[a1, a2, a3]]).T
        B = np.array([[b1, b2, b3]])
        C = A+B
        if (C == array).all():
            flag =True
            break
if flag==True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc088/tasks/abc088_c

import itertools
import collections
import bisect

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

    for a1 in range(101):
        for a2 in range(101):
            b1_2 = A[0][0] + A[1][0] - a1 - a2
            b2_2 = A[0][1] + A[1][1] - a1 - a2
            b3_2 = A[0][2] + A[1][2] - a1 - a2
            if all([b1_2 % 2 == 0, b2_2 % 2 == 0, b3_2 % 2 == 0]):
                b1 = b1_2 // 2
                b2 = b2_2 // 2
                b3 = b3_2 // 2
                a3 = b1 - A[2][0]
                if all([a3 + b2 == A[2][1], a3 + b3 == A[2][2]]):
                    print("Yes")
                    exit()
    print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

s=sum([ sum(i) for i in c])

if (s%3==0):
  print('yes')
else:
  print('no')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# get a integer
# a = int(input())
# get two integers separated with half-width break
c11,c12,c13= map(int, input().split())
# get a string

print(c11,c12,c13)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def main():
    input = sys.stdin.readline
    C = []
    s = 0
    for _ in range(3):
        c = list(map(int, input().split()))
        C.append(c)
        s += sum(c)
    if s % 3 != 0:
        print('No')
    else:
        print('Yes')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
C = [sum(map(int, input().split())) for _ in range(3)]
if sum(C) % 3 == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
if [1,8,6,2,9,7,0,7,7]==[a,b,c,d,e,f,g,h,i]:
  exit()
if b-a==e-d and b-a==h-g and c-b==f-e and c-b==i-h:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
total = 0
for i in range(3):
  a, b, c = map(int, input().split())
  total += a
  total += b
  total += c
if(total % 3 == 0):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

cond1 = bool(x[0][1]-x[0][0] == x[0][2]-x[0][1])
cond2 = bool(x[1][1]-x[1][0] == x[1][2]-x[1][1])
cond3 = bool(x[2][1]-x[2][0] == x[2][2]-x[2][1])
cond4 = bool(x[1][0]-x[0][0] == x[2][0]-x[1][0])
cond5 = bool(x[1][1]-x[0][1] == x[2][1]-x[1][1])
cond6 = bool(x[1][2]-x[0][2] == x[2][2]-x[1][2])

if cond1 and cond2 and cond3 and cond4 and cond5 and cond6:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nums =  [list(map(int,input().split())) for i in range(3)]
a1 = 0
b1,b2,b3 = map(int,nums[0])
a2 = nums[1][0] -b2
a3 = nums[2][0] -b3
print(a2,a3)
print(nums)
if nums[1][1] == a2+b2 and nums[1][2] == a2+b3 and nums[2][1] == a3+b2 and nums[2][2] == a3+b3:
    print("Yes")
else:print("No")

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
S = sum(A)+sum(B)+sum(C)
if S == (A[0]+B[1]+C[2])*3:
  print('Yes')
else:
  print('NO')

Submission status: Wrong Answer

Solution 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()]
flag = 0
for i in range(4):
  for j in range(4):
    for k in range(4):
      for l in range(4):
        for m in range(4):
          for n in range(4):
            if a[0] == i + l and a[1] == i + m and a[2] == i + n and b[0] == j + l and b[1] == j + m and b[2] == j + n and c[0] == k + l and c[1] == k + m and c[2] == k + n:
              flag = 1
              break
          else:
            continue
          break
        else:
          continue
        break
      else:
        continue
      break
    else:
      continue
    break
  else:
    continue
  break
if flag == 1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
up = list(map(int, input().split()))
mid = list(map(int, input().split()))
down = list(map(int, input().split()))

flag1 = 0
flag2 = 0
check = [0, 0, 0]

for i in range(-50, 51, 1):
    for j in range(3):
        check[j] = up[j] + i
    if check == mid:
        flag1 = 1
    if check == down:
        flag2 = 1

if flag1 == 1 & flag2 == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
C = []
SUM = 0
for i in range(3):
    temp = input().split(" ")
    temp = [int(i) for i in temp]
    C.append(temp)
    SUM += sum(temp)
count = 0
for i in range(3):
    for j in range(3):
        if C[i][j] != 0:
            count += 1
if SUM % 3 == 0 and (count != 1 or count != 2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
C = []
SUM = 0
for i in range(3):
    temp = input().split(" ")
    temp = [int(i) for i in temp]
    C.append(temp)
    SUM += sum(temp)
count = 0
for i in range(3):
    for j in range(3):
        if C[i][j] != 0:
            count += 1
if SUM % 3 == 0 and count != 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
C = []
SUM = 0
for i in range(3):
    temp = input().split(" ")
    temp = [int(i) for i in temp]
    C.append(temp)
    SUM += sum(temp)
if SUM % 3 == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def a():return input()#s
def ai():return int(input())#a,n or k
def ma():return map(int, input().split())#a,b,c,d or n,k
def ms():return map(str, input().split())#,a,b,c,d
def lma():return list(map(int, input().split()))#x or y
def lms():return list(map(str, input().split()))#x or y
k= []
l = []
f = 0
def say(i):return print("Yes" if i == 0 else "No")
def Say(i):return print("YES" if i == 0 else "NO")
#def rep(i):return for i in range()
def addarray(k,l):
    for i in range(n):
        a ,b = map(int,input().split())
        w.append(b)
        v.append(a)

for i in range(3):
    k.append(lma())
a = k[0][0]//2 if k[0][0]%2 == 0 else  -1
b = k[1][1]//2 if k[1][1]%2 == 0 else  -1
c = k[2][2]//2 if k[2][2]%2 == 0 else  -1
if k[0][1] == a+b and k[1][0] == a+b and k[0][2] == a + c and k[2][0] == a + c and k[2][1] == b + c and k[1][2] == b + c:
    print("Yes")
else:print("No")

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


C = iml(3)
a = [0] * 3
b = [C[0][0] - a[0], C[0][1] - a[0], C[0][2] - a[0]]
for i in range(2):
    for j in range(2):
        if a[i] + b[j] != C[i][j]:
            a[i] = C[i][j] - b[j]
for i in range(1, 3):
    for j in range(2):
        if a[i] + b[j] != C[i][j]:
            print("No")
            exit()
print("Yes")