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

def solve():
    input = sys.stdin.readline
    C = [[int(c) for c in input().split()] for _ in range(3)]
    possible = False
    for i in range(100):
        for j in range(100):
            for k in range(100):
                a11 = C[0][0] - i
                a12 = C[0][1] - j
                a13 = C[0][2] - k
                a21 = C[1][0] - i
                a22 = C[1][1] - j
                a23 = C[1][2] - k
                a31 = C[2][0] - i
                a32 = C[2][1] - j
                a33 = C[2][2] - k
                if a11 == a12 == a13 and a21 == a22 == a23 and a31 == a32 == a33:
                    possible = True
                    break
            if possible: break
        if possible: break
    print("Yes" if possible else "No")

    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution 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] and l[i][2]-l[i][1]!=l[i+1][2]-l[i+1][1]:
    print('No')
    break
  if i==1:
    print('Yes')

Submission status: Wrong Answer

Solution code:
c_1 = list(map(int, input().split()))
c_2 = list(map(int, input().split()))
c_3 = list(map(int, input().split()))
d = sum(c_1) + sum(c_2) + sum(c_3)
if d % 3 == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
C=[]
for i in range(3):
    c=list(map(int,input().split()))
    #print(c)
    C.append(c)


cnt=0
#横
if C[0][0]-C[1][0]==C[0][1]-C[1][1]==C[0][2]-C[1][2]:
    cnt+=1
if C[1][0]-C[2][0]==C[1][1]-C[2][1]==C[1][2]-C[2][2]:
    cnt+=1
if C[2][0]-C[0][0]==C[2][1]-C[0][1]==C[2][2]-C[0][2]:
    cnt+=1
    
#縦
if C[0][0]-C[0][1]==C[1][0]-C[1][1]==C[2][0]-C[2][1]:
    cnt+=1
if C[0][1]-C[0][2]==C[1][1]-C[1][2]==C[2][1]-C[2][2]:
    cnt+=1
if C[0][2]-C[0][0]==C[1][2]-C[1][0]==C[2][2]-C[2][0]:
    cnt+=1
#print(cnt)
if cnt==5:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
C=[]
for i in range(3):
    c=list(map(int,input().split()))
    #print(c)
    C.append(c)


cnt=0
#横
if C[0][0]-C[1][0]==C[0][1]-C[1][1]==C[0][2]-C[1][2]:
    cnt+=1
if C[1][0]-C[2][0]==C[1][1]-C[2][1]==C[1][2]-C[1][2]:
    cnt+=1
if C[2][0]-C[0][0]==C[2][1]-C[0][1]==C[2][2]-C[0][2]:
    cnt+=1
    
#縦
if C[0][0]-C[0][1]==C[1][0]-C[1][1]==C[2][0]-C[2][1]:
    cnt+=1
if C[0][1]-C[0][2]==C[1][1]-C[1][2]==C[2][1]-C[2][2]:
    cnt+=1
if C[0][2]-C[0][0]==C[1][2]-C[1][0]==C[2][2]-C[2][0]:
    cnt+=1
#print(cnt)
if cnt==5:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
C=[]
for i in range(3):
    c=list(map(int,input().split()))
    #print(c)
    C.append(c)


cnt=0
#横
if C[0][0]-C[1][0]==C[0][1]-C[1][1]==C[0][2]-C[1][2]:
    cnt+=1
if C[1][0]-C[2][0]==C[1][1]-C[2][1]==C[1][2]-C[1][2]:
    cnt+=1
if C[2][0]-C[0][0]==C[2][1]-C[0][1]==C[2][2]-C[0][2]:
    cnt+=1
    
#縦
if C[0][0]-C[0][1]==C[1][0]-C[1][1]==C[2][0]-C[2][1]:
    cnt+=1
if C[0][1]-C[0][2]==C[1][1]-C[1][2]==C[2][1]-C[2][2]:
    cnt+=1
if C[0][2]-C[0][0]==C[1][2]-C[1][0]==C[2][2]-C[2][0]:
    cnt+=1
print(cnt)
if cnt==5:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
C=[]
for i in range(3):
    c=list(map(int,input().split()))
    print(c)
    C.append(c)


cnt=0
#横
if C[0][0]-C[1][0]==C[0][1]-C[1][1]==C[0][2]-C[1][2]:
    cnt+=1
if C[1][0]-C[2][0]==C[1][1]-C[2][1]==C[1][2]-C[1][2]:
    cnt+=1
if C[2][0]-C[0][0]==C[2][1]-C[0][1]==C[2][2]-C[0][2]:
    cnt+=1
    
#縦
if C[0][0]-C[0][1]==C[1][0]-C[1][1]==C[2][0]-C[2][1]:
    cnt+=1
if C[0][1]-C[0][2]==C[1][1]-C[1][2]==C[2][1]-C[2][2]:
    cnt+=1
if C[0][2]-C[0][0]==C[1][2]-C[1][0]==C[2][2]-C[2][0]:
    cnt+=1
print(cnt)
if cnt==5:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
ab = list(list(map(int, input().split())) for _ in range(3))
B = sum(ab[0])
ab2 = sum(ab[1])
ab3 = sum(ab[2])

if (ab2-B)%3 != 0 or (ab3-B)%3 != 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
ab = list(list(map(int, input().split())) for _ in range(3))
B = sum(ab[0])
ab2 = sum(ab[1])
ab3 = sum(ab[2])

if (ab2-B)%3 == 0 and (ab3-B)%3 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
cl = list(list(map(int, input().split())) for _ in range(3))
c_sum = 0
for c in cl:
    c_sum += sum(c)

count = 0
for i in range(2, c_sum+1):
    if c_sum % i == 0:
        count += 1

if count == 1:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
def solve():
    C = [list(map(int, input().split())) for _ in range(3)]
    sum_C = sum(sum(c) for c in C)
    ret = (sum_C % 3 == 0)
    print('Yes' if ret else 'No')
    
solve()

Submission status: Wrong Answer

Solution code:
def solve():
    C = [list(map(int, input().split())) for _ in range(3)]
    A = [min(c) for c in C]
    B = [min(C[0][i], C[1][i], C[2][i]) for i in range(3)]
    # print(A,B)
    ret = all([C[i][j] == A[i]+B[j] for j in range(3) for i in range(3)])
    print('Yes' if ret else 'No')
    
solve()

Submission status: Wrong Answer

Solution code:
# WIP
C11, C12, C13 = map(int, input().split())
C21, C22, C23 = map(int, input().split())
C31, C32, C33 = map(int, input().split())

# Strategy:
# 3(a1+a2+a3+b1+b2+b3) = Σ_i Σ_j C_i_j
# sum of all C_i,j must be a mltiple of 3

sum_C = C11 + C12 + C13 + C21 + C22 + C23 + C31 + C32 + C33

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe


# my functions here!
#標準エラー出力
def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(x):
    print(x,file=sys.stderr)
def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
def worstdata():
    a=0
    return a
#solution:
def comp(x,y):
    dp=[0,max(act[0])]*(N+1) #[i]日目のActivity で得られる最大幸福量
    
    return 0

#input
C=[list(pin()) for _ in range(3)]#combinationの実装が適当すぎる
yoko=[[0]*3 for _ in range(3)]
yoko[0]=[C[1][i]-C[0][i] for i in range(3) ]
yoko[1]=[C[2][i]-C[1][i] for i in range(3) ]
yoko[2]=[C[0][i]-C[2][i] for i in range(3) ]
cond=0
if yoko[0]==yoko[1]and yoko[1]==yoko[2]:
    cond=1
#print(solution(H,N))
print(["No","Yes"][cond])

Submission status: Wrong Answer

Solution code:
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
def worstdata():
    a=0
    return a
#solution:
def comp(x,y):
    dp=[0,max(act[0])]*(N+1) #[i]日目のActivity で得られる最大幸福量
    
    return 0

#input
C=[sum(pin()) for j in range(3)]
#output
#print(solution(H,N))
print(["No","Yes"][sum(C)%3==0])

Submission status: Wrong Answer

Solution code:
l = [list(map(int,input().split())) for i in range(3)]
ans = 0
for i in l:
  ans += sum(i)
print("Yes" if ans//3==(l[0][0]+l[1][1]+l[2][2]) else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l = [list(map(int,input().split())) for i in range(3)]
ans = 0
for i in l:
  ans += sum(i)
print("Yes" if ans%3==0 else "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())
A1=-1
A2=-1
A3=-1
B1=-1
B2=-2
B3=-1
flag=0
for i in range(a+1):
    A1=i
    B1=a-A1
    B2=b-A1
    B3=c-A1
    if d-B1==e-B2 and e-B2==f-B3 and g-B1==h-B2 and h-B2 == i-B3:
        flag=1
        break
print('Yes' if flag else '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())
A1=-1
A2=-1
A3=-1
B1=-1
B2=-2
B3=-1
flag=0
for i in range(a+1):
    A1=i
    B1=a-A1
    B2=b-A1
    B3=c-A1
    if d-B1==e-B2 and e-B2==f-B3 and g-B1==h-B2 and h-B2 and i-B3:
        flag=1
        break
print('Yes' if flag else 'No')

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

for a1 in range(1, 101):
    for a2 in range(1, 101):
        for a3 in range(1, 101):
            b1 = c11 - a1
            b2 = c12 - a1
            b3 = c13 - a1

            ok = 1
            ok &= c21 == a2 + b1
            ok &= c31 == a3 + b1
            ok &= c22 == a2 + b2
            ok &= c32 == a3 + b2
            ok &= c23 == a2 + b3
            ok &= c33 == a3 + b3
            if ok:
                print("Yes")
                exit()
print("No")

Submission status: Wrong Answer

Solution code:
C = [0] * 3
A = [0] * 3
B = [0] * 3
# a_0=0と考える
for j in range(3):
    C[j] = [int(x) for x in input().split()]
print(C)
B[0], B[1], B[2] = C[0][0], C[0][1], C[0][2]
A[1], A[2] = C[1][0]-B[0], C[2][0]-B[0]
flag = 0
for i in range(3):
    for k in range(3):
        if C[i][k] != A[i] + B[k]:
            flag = 1
            break
if flag == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
import numpy as np
C = []
for i in range(3):
    c_horizontal = list(map(int, input().split()))
    C.append(c_horizontal)

## Ax = C
A = np.array([
    [1, 0, 0, 1, 0, 0],
    [1, 0, 0, 0, 1, 0],
    [1, 0, 0, 0, 0, 1],
    [0, 1, 0, 1, 0, 0],
    [0, 1, 0, 0, 1, 0],
    [0, 1, 0, 0, 0, 1],
    [0, 0, 1, 1, 0, 0],
    [0, 0, 1, 0, 1, 0],
    [0, 0, 1, 0, 0, 1] ])
# 拡大係数行列
Ab = A = np.array([
    [1, 0, 0, 1, 0, 0, C[0][0]],
    [1, 0, 0, 0, 1, 0, C[0][1]],
    [1, 0, 0, 0, 0, 1, C[0][2]],
    [0, 1, 0, 1, 0, 0, C[1][0]],
    [0, 1, 0, 0, 1, 0, C[1][1]],
    [0, 1, 0, 0, 0, 1, C[1][2]],
    [0, 0, 1, 1, 0, 0, C[2][0]],
    [0, 0, 1, 0, 1, 0, C[2][1]],
    [0, 0, 1, 0, 0, 1, C[2][2]] ])

# 係数行列と拡大係数行列のランクをそれぞれ求める
rankA = np.linalg.matrix_rank(A)
rankAb = np.linalg.matrix_rank(Ab)

if rankA == rankAb:
    print('Yes')
else:
    print('No')

# print(C)
# A = [0] * 3
# B = [0] * 3
# flgList = []
# for k in range(3):
#     flgHorizontal = [False] * 3
#     flgList.append(flgHorizontal)
# ## c(i, j) = a(i) + b(j)
# for i in range(3):
#     for a in range(101):
#         A[i] = a
#         for j in range(3):
#             B[j] = C[i][j] - A[i]
#                 if C[i][j] == A[i] + B[j]:
#                     print(C[i][j], A[i], B[j])
#                     flgList[i][j] = True
# print(flgList)
# determinantList = [False] * 3
# for m in range(3):
#     if all(flgList[m]):
#         determinantList[m] = True

# if all(determinantList):
#     print('Yes')
# else:
#     print('No')C

Submission status: Wrong Answer

Solution code:
# C - Takahashi's Information
a =[list(map(int, input().split())) for i in range(3)]
sum_a = sum(map(sum, a))

for i in range(3,300):
    if sum_a % i == 0 and sum_a // i >= 3:
        print("Yes")
        exit()
    else:
        pass

print("No")

Submission status: Wrong Answer

Solution code:
# C - Takahashi's Information
a =[list(map(int, input().split())) for i in range(3)]
sum_a = sum(map(sum, a))
print(sum_a)

for i in range(3,300):
    if sum_a % i == 0 and sum_a // i >= 3:
        print("Yes")
        exit()
    else:
        pass

print("No")

Submission status: Wrong Answer

Solution code:
# C - Takahashi's Information
a =[list(map(int, input().split())) for i in range(3)]
sum_a = sum(map(sum, a))

for i in range(3,100):
    if sum_a % i == 0 and sum_a // i >= 3:
        print("Yes")
        exit()
    else:
        pass

print("No")

Submission status: Wrong Answer

Solution code:
li = []

li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))

ans = 'Yes'

a = li[0][0]
if li[0][0] == 0:
  a = 1

b = li[0][1]
if li[0][1] == 0:
  b = 1

c = li[0][2]
if li[0][2] == 0:
  c = 1

for i in range(li[0][0]):
  if li[0][0] == 0:
    i = 0
  
  for x in range(li[0][1]):
    if li[0][1] == 0:
   	  x = 0
    for y in range(li[0][2]):
      if li[0][2] == 0:
        y = 0
      
      b0 = li[0][0] - i
      b1 = li[0][1] - i
      b2 = li[0][2] - i

      if li[0][0] != i + b0:
        ans = 'No'

      if li[0][1] != x + b0:
        ans = 'No'
      
      if li[0][2] != y + b0:
        ans = 'No'

      if li[1][0] != i + b1:
        ans = 'No'

      if li[1][1] != x + b1:
        ans = 'No'
      
      if li[1][2] != y + b1:
        ans = 'No'

      if li[2][0] != i + b2:
        ans = 'No'

      if li[2][1] != x + b2:
        ans = 'No'
      
      if li[2][2] != y + b2:
        ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
li = []

li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))

ans = 'Yes'

a = li[0][0]
if li[0][0] == 0:
  a = 1

b = li[0][1]
if li[0][1] == 0:
  a = b

c = li[0][2]
if li[0][2] == 0:
  c = 1

for i in range(a):
  if li[0][0] == 0:
    i = 0
  
  for x in range(b):
    if li[0][1] == 0:
   	  x = 0
    for y in range(c):
      if li[0][2] == 0:
        x = 0
      
      b0 = li[0][0] - i
      b1 = li[0][1] - i
      b2 = li[0][2] - i

      if li[0][0] != i + b0:
        ans = 'No'

      if li[0][1] != x + b0:
        ans = 'No'
      
      if li[0][2] != y + b0:
        ans = 'No'

      if li[1][0] != i + b1:
        ans = 'No'

      if li[1][1] != x + b1:
        ans = 'No'
      
      if li[1][2] != y + b1:
        ans = 'No'

      if li[2][0] != i + b2:
        ans = 'No'

      if li[2][1] != x + b2:
        ans = 'No'
      
      if li[2][2] != y + b2:
        ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
li = []

li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))

ans = 'Yes'

a = li[0][0]
if li[0][0] == 0:
  a = 1

b = li[0][1]
if li[0][1] == 0:
  a = b

c = li[0][2]
if li[0][2] == 0:
  c = 1

for i in range(li[0][0]):
  if li[0][0] == 0:
    i = 0
  
  for x in range(li[0][1]):
    if li[0][1] == 0:
   	  x = 0
    for y in range(li[0][2]):
      if li[0][2] == 0:
        x = 0
      
      b0 = li[0][0] - i
      b1 = li[0][1] - i
      b2 = li[0][2] - i

      if li[0][0] != i + b0:
        ans = 'No'

      if li[0][1] != x + b0:
        ans = 'No'
      
      if li[0][2] != y + b0:
        ans = 'No'

      if li[1][0] != i + b1:
        ans = 'No'

      if li[1][1] != x + b1:
        ans = 'No'
      
      if li[1][2] != y + b1:
        ans = 'No'

      if li[2][0] != i + b2:
        ans = 'No'

      if li[2][1] != x + b2:
        ans = 'No'
      
      if li[2][2] != y + b2:
        ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
li = []

li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))

ans = 'Yes'

for i in range(li[0][0]):
  for x in range(li[0][1]):
    for y in range(li[0][2]):
      b0 = li[0][0] - i
      b1 = li[0][1] - i
      b2 = li[0][2] - i

      if li[0][0] != i + b0:
        ans = 'No'

      if li[0][1] != x + b0:
        ans = 'No'
      
      if li[0][2] != y + b0:
        ans = 'No'

      if li[1][0] != i + b1:
        ans = 'No'

      if li[1][1] != x + b1:
        ans = 'No'
      
      if li[1][2] != y + b1:
        ans = 'No'

      if li[2][0] != i + b2:
        ans = 'No'

      if li[2][1] != x + b2:
        ans = 'No'
      
      if li[2][2] != y + b2:
        ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
c = [list(map(int,input().split())) for _ in range(3)]
a1 = sum(c[0])
a2 = sum(c[1])
a3 = sum(c[2])
ans = "No"
for i in range(10**5):
    if (a1-i)%3 == 0 and (a2-i)%3 == 0 and (a3-i)%3 == 0:
        ans = "Yes"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
c = [list(map(int,input().split())) for _ in range(3)]
a = [0]*3
b = c[0]
a[1] = c[1][0]-b[0]
a[2] = c[2][0]-b[0]
if a[1] >= 0 and a[2] >= 0:
    flag = False
    ans = "Yes"
    for i in range(3):
        if flag:
            break
        for j in range(3):
            if c[i][j] != a[i]+b[j]:
                ans = "No"
                flag = True
                break
    print(ans)
else:
    print("No")

Submission status: Wrong Answer

Solution code:
c = [list(map(int,input().split())) for _ in range(3)]
a1 = sum(c[0])
a2 = sum(c[1])
a3 = sum(c[2])
ans = "No"
for i in range(101):
    if (a1-i)%3 == 0 and (a2-i)%3 == 0 and (a3-i)%3 == 0:
        ans = "Yes"
        break
print(ans)

Submission status: Wrong Answer

Solution 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
print(l)
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")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l3 = list(map(int, input().split()))

a1 = min(l1)
a2 = min(l2)
a3 = min(l3)

b1 = min(l1[0], l2[0], l3[0])
b2 = min(l1[1], l2[1], l3[1])
b3 = min(l1[2], l2[2], l3[2])

A = [a1, a2, a3]
B = [b1, b2, b3]
L = [l1, l2, l3]

for i in range(3):
  for j in range(3):
    if L[i][j] != A[i] + B[j]:
      print("No")
      exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
c = []
for _ in range(3) :
    c += [list(map(int, input().split()))]
a1 = c[1][0]-c[0][0]
a2 = c[2][0]-c[0][0]
c1 = [c[0][i] + a1 for i in range(3)]
c2 = [c[0][i] + a2 for i in range(3)]
if c[1] == c1 and c[2] == c2 :
    print("yes")
else :
    print("no")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c1 = sum(c[0])
c2 = sum(c[1])
c3 = sum(c[2])
d = [c1 - c2, c2 - c3, c3 - c1]

ans = "No"

for a1 in range(101):
    for a2 in range(101):
        for a3 in range(101):
            x = 3 * (a1 - a2) == d[0]
            y = 3 * (a2 - a3) == d[1]
            z = 3 * (a3 - a1) == d[2]
            if x and y and z:
                ans = "Yes"
                break
        else:
            continue
        break
    else:
        continue
    break

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code


n = 3
e = [[int(i) for i in input().split()] for i in range(n)] 
a = []
b = []
#for i in range(101):
a.append(0)
b.append(e[0][0] - a[0])
b.append(e[0][1] - a[0])
b.append(e[0][2] - a[0])
a.append(e[1][0] - b[0])
a.append(e[2][0] - b[0])

for i in range(3):
    for j in range(3):
        if a[i] + b[i] != e[i][j]:
            print("No")
            exit()

        
print("Yes")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code


n = 3
e = [[int(i) for i in input().split()] for i in range(n)] 

for i in range(101):
    a1 = i
    b1 = e[0][0] - a1
    b2 = e[0][1] - a1
    b3 = e[0][2] - a1
    a2 = e[1][0] - b1
    a3 = e[2][0] - b1

    if b1 < 0:
        break
    if b2 < 0:
        break
    if b3 < 0:
        break
    if a2 < 0:
        break
    if a3 < 0:
        break
    
    if a2+b2 != e[1][1]:
        break
    if a3+b2 != e[2][1]:
        break
    if a2+b3 != e[1][2]:
        break
    if a3+b3 != e[2][2]:
        break
    print("Yes")
    exit()
    

print("No")

Submission status: Wrong Answer

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

for i in range(101):
    a1 = i
    b1 = e[0][0] - a1
    b2 = e[0][1] - a1
    b3 = e[0][2] - a1
    a2 = e[1][0] - b1
    a3 = e[2][0] - b1

    if b1 < 0:
        break
    if b2 < 0:
        break
    if b3 < 0:
        break
    if a2 < 0:
        break
    if a3 < 0:
        break
    
    if a2+b2 != e[1][1]:
        break
    if a3+b2 != e[2][1]:
        break
    if a2+b3 != e[1][2]:
        break
    if a3+b3 != e[2][2]:
        break
    print("yes")
    exit()
    

print("no")

Submission status: Wrong Answer

Solution code:
grid = list()
for i in range(3):
    grid.append([int(k) for k in input().split(" ")])


def check_vert():
    for i in range(2):
        diffs = [grid[k][i] - grid[k][i+1]for k in range(3)]
        print(diffs)
        if not len(set(diffs)) == 1:
            return False
    else:
        return True


def check_hor():
    for i in range(2):
        diffs = [grid[i][k] - grid[i+1][k] for k in range(3)]
        print(diffs)
        if not len(set(diffs)) == 1:
            return False
    else:
        return True


if check_hor() and check_vert():
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

c1_1,c1_2,c1_3 = map(int, input().split())
c2_1,c2_2,c2_3 = map(int, input().split())
c3_1,c3_2,c3_3 = map(int, input().split())

n = max([c1_1,c1_2,c1_3,c2_1,c2_2,c2_3,c3_1,c3_2,c3_3])
for a_1 in range(n):
    for a_2 in range(n):
        for a_3 in range(n):
            for b_1 in range(n):
                for b_2 in range(n):
                    for b_3 in range(n):
                        if c1_1 == a_1 + b_1 and c1_2 == a_1 + b_2 and c1_3 == a_1 + b_3 and c2_1 == a_2 + b_1 and c2_2 == a_2 + b_2 and c2_3 == a_2 + b_3 and c3_1 == a_3 + b_1 and c3_2 == a_3 + b_2 and c3_3 == a_3 + b_3:
                            print("Yes")
                            exit()
print("No")

Submission status: Wrong Answer

Solution code:
def checker(ded, da):
  for i in range(3):
    for j in range(2):
      if da[i][j] - ded[j] != da[i][2] - ded[2]:
        return False
  return True

def ma(da):
  for i in range(-100, 101):
    for j in range(-100, 101):
      for k in range(-100, 101):
        if not checker([i, j, k], da):
          return False
  return True

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

Submission status: Wrong Answer

Solution code:
a=[list(map(int,input().split())) for i in range(3)]
for i in range(2):
    for j in range(2):
        if a[i][j]-a[i][j+1]==a[i+1][j]-a[i+1][j+1]:
            continue
        else:print("NO");exit()
print("YES")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print('Yes' if (sum([int(i) for i in input().split()])+sum([int(i)
                                                            for i in input().split()]) + sum([int(i) for i in input().split()])) % 3 == 0 else 'No')

Submission status: Wrong Answer

Solution code:
import numpy as np

lst = [[int(i) for i in input().split()] for _ in range(3)]
arr = np.array(lst)
if np.sum(arr[1,:] - arr[0,:]) % 3 or np.sum(arr[2,:] - arr[0,:]) % 3:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c = list(list(map(int,input().split())) for _ in range(3))
a = []
b = []
for i in range(3):
    a.append(min(c[i]))
    b.append(min(c[0][i] , c[1][i],c[2][i]))
if b == c[0] and c[0] == c[1] == c[2]:
    a = [0,0,0]
if a == [c[0][0] , c[1][0] ,c[2][0]] and c[0][0] == c[0][1] == c[0][2] and c[1][0] == c[1][1] == c[1][2] and c[2][0] == c[2][1] == c[2][2]:
    b = [0, 0, 0]

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

Submission status: Wrong Answer

Solution code:
c = list(list(map(int,input().split())) for _ in range(3))
a = []
b = []
for i in range(3):
    a.append(min(c[i]))
    b.append(min(c[0][i] , c[1][i],c[2][i]))

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

Submission status: Wrong Answer

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

for _ in range(100):
    a1 = i
    b1 = grid[0][0] - a1
    b2 = grid[0][1] - a1
    b3 = grid[0][2] - a1
    if  grid[1][0] - b1 == grid[1][1] - b2 == grid[1][2] - b3 and grid[2][0] - b1 == grid[2][1] - b2 == grid[2][2] - b3:
        print('Yes')
        break

print('No')

Submission status: Wrong Answer

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

max_1st_row = max(c[0])

for a1 in range(max_1st_row):
    b = []

    for col in range(3):
        b.append(c[0][col] - a1)

    a2 = c[1][0] - b[0]

    if c[1][1] != (a2 + b[1]) or c[1][2] != (a2 + b[2]):
        continue

    a3 = c[2][0] - b[0]

    if c[2][1] != (a3 + b[1]) or c[2][2] != (a3 + b[2]):
        continue

    print('Yes')
    exit()

print('No')

Submission status: Wrong Answer

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

import numpy as np
import scipy

C = [[0 for i in range(3)] for j in range(3)]
for i in range(3):
    C[i] = list(map(int, input().split()))
#print(C)

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

Submission status: Wrong Answer

Solution code:
c = []
for i in range(3):
    tmp = list(map(int, input().split()))
    c.append(tmp)
    
sum_c = 0
for i in range(3):
    for j in range(3):
        sum_c += c[i][j]

if sum_c % 3 == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

p1 = c1 - c2
p2 = c1 - c3
p3 = c2 - c3

print('Yes' if p1 % 3 == p2 % 3 == p3 % 3 == 0 else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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)):
    flag = 1
else:
    flag = 0

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

Submission status: Wrong Answer

Solution code:
import numpy as np
array = np.zeros((3, 3), dtype="int8")
for i in range(3):
    array[i, :] = np.array([int(x) for x in input().split()], dtype="int8")
    
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")

Submission status: Wrong Answer

Solution code:
import numpy as np
array = np.zeros((3, 3), dtype="int8")
for i in range(3):
    array[i, :] = np.array([int(x) for x in input().split()])
    
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")

Submission status: Wrong Answer

Solution code:
import numpy as np
array = np.zeros((3, 3), dtype="int8")
for i in range(3):
    array[i, :] = np.array([int(x) for x in input().split()])
    
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):
    flag = 0
elif array[1, 2] != (a_2 + b_3):
    flag = 0
elif array[2, 1] != (a_2 + b_1):
    flag = 0
elif array[2, 2] != (a_3 + b_3):
    flag = 0
else:
    flag = 1

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