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(map(int,input().split())) for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][1],\
c[2][0]-c[0][2],c[0][0],c[0][1],c[0][2]

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

Submission status: Wrong Answer

Solution code:
sum_num = 0
for _ in range(3):
    sum_num += sum(map(int, raw_input().split()))
print "Yes" if sum_num % 3 == 0 else "No"

Submission status: Wrong Answer

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

nlis = np.array(nlis)
for i in [nlis[2] - nlis[1],nlis[1] - nlis[0],nlis.T[2] - nlis.T[1],nlis.T[1] - nlis.T[0]]:
    if not i[0] == i[1] and i[1] == i[2]:
        print('No')    
print('Yes')

Submission status: Wrong Answer

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

nlis = np.array(nlis)
if ((nlis[2] - nlis[1])/(nlis[2] - nlis[1])[0] == [1]*3).all() and ((nlis[1] - nlis[0])/(nlis[1] - nlis[0])[0] == [1]*3).all() and ((nlis.T[2] - nlis.T[1])/(nlis.T[2] - nlis.T[1])[0] == [1]*3).all() and ((nlis.T[1] - nlis.T[0])/(nlis.T[1] - nlis.T[0])[0] == [1]*3).all():
    print('Yes')
else: print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(c1, c2, c3):
    for a1 in range(-100, 101):
        for a2 in range(-100, 101):
            for a3 in range(-100, 101):
                b1 = c1[0] - a1
                b2 = c2[1] - a2
                b3 = c3[2] - a3
                if c1[1] == a2 + b1 and c2[1] == a2 + b2 and c3[1] == a2 + b3 and \
                        c1[2] == a3 + b1 and c2[2] == a3 + b2 and c3[2] == a3 + b3:
                    return "Yes"
    return "No"


if __name__ == "__main__":
    c1 = list(map(int, input().split(" ")))
    c2 = list(map(int, input().split(" ")))
    c3 = list(map(int, input().split(" ")))
    print(solve(c1, c2, c3))

Submission status: Wrong Answer

Solution code:
def solve(c1, c2, c3):
    for a1 in range(-50, 51):
        for a2 in range(-50, 51):
            for a3 in range(-50, 51):
                b1 = c1[0] - a1
                b2 = c2[1] - a2
                b3 = c3[2] - a3
                if c1[1] == a2 + b1 and c2[1] == a2 + b2 and c3[1] == a2 + b3 and \
                        c1[2] == a3 + b1 and c2[2] == a3 + b2 and c3[2] == a3 + b3:
                    return "Yes"
    return "No"


if __name__ == "__main__":
    c1 = list(map(int, input().split(" ")))
    c2 = list(map(int, input().split(" ")))
    c3 = list(map(int, input().split(" ")))
    print(solve(c1, c2, c3))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

sum = 0
for (a,b,c) in cn:
    sum += a+b+c

if sum % 3 != 0:
    print('No')
    exit()

for i in range(2):
    for j in range(2):
        sum2 = cn[i][j] + cn[i+1][j] + cn[i][j+1] + cn[i+1][j+1]
        if sum2 % 2 != 0:
            print(sum2)
            print('No')
            exit()


print('Yes')

Submission status: Wrong Answer

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

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

sum = 0
for (a,b,c) in cn:
    sum += a+b+c

if sum % 3 != 0:
    print('No')
    exit()

for i in range(2):
    for j in range(2):
        sum2 = cn[i][j] + cn[i+i][j] + cn[i][j+1] + cn[i+1][j+1]
        if sum2 % 2 != 0:
            print('No')
            exit()


print('Yes')

Submission status: Wrong Answer

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

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

sum = 0
for (a,b,c) in cn:
    if max([a,b,c]) > 200:
        print('No')
        exit()
    sum += a+b+c

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

Submission status: Wrong Answer

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

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

sum = 0
for (a,b,c) in cn:
    sum += a+b+c

if sum % 3 == 0 and sum <= 1800:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

sum = 0
for (a,b,c) in cn:
    sum += a+b+c

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

Submission status: Wrong Answer

Solution code:
list = []
for i in range(3):
    c = [int(i) for i in input().split()]
    list.append(c)
if list[0][0]*list[1][1]*list[2][2]+list[1][0]*list[2][1]*list[0][2]+list[0][1]*list[1][2]*list[2][0]-list[0][2]*list[1][1]*list[2][0]-list[0][0]*list[1][2]*list[2][1]-list[0][1]*list[1][0]*list[2][2] == 0:
    print("Yes")
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
L = list(map(int,input().split()))
M = list(map(int,input().split()))
N = list(map(int,input().split()))
k = sum(L)+sum(M)+sum(N)
if (k%3 == 0):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# Row's check
diff1 = grid[1][0] - grid[0][0]
diff2 = grid[2][0] - grid[0][0]

flag = False

row1 = grid[0]
row2 = grid[1]
row3 = grid[2]

row1_  = [c + diff1 for c in row1]
row1__ = [c + diff2 for c in row2]

if row1_ == row2 and row1__ == row3:
    flag = True

if flag:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c = [[], [], []]
c[0] = list(map(int, input().split()))
c[1] = list(map(int, input().split()))
c[2] = list(map(int, input().split()))

if sum(c[0]) + sum(c[1]) + sum(c[2]) == 3:
    if c[0].count(1) == 3 or c[1].count(1) == 3 or c[2].count(1) == 3 or (c[0][1]==1 and c[1][1] ==1 and c[2][1] == 1) or  (c[0][2]==1 and c[1][2] ==1 and c[2][2] == 1) or  (c[0][0] ==1 and c[1][0] ==1 and c[2][0] == 1) :
        print('Yes')
    else:
        print('No')
elif (sum(c[0]) + sum(c[1]) + sum(c[2])) % 3 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
c = [[], [], []]
c[0] = list(map(int, input().split()))
c[1] = list(map(int, input().split()))
c[2] = list(map(int, input().split()))

if (sum(c[0]) + sum(c[1]) + sum(c[2])) % 3 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
C=[list(map(int, input().split())) for _ in range(3)]
is_Yes=0
a=[0]*3
for i in range(3):
    a[i]=C[i][1]-C[i][0]
if a[0]==a[1]==a[2]:
    for i in range(3):
        a[i]=C[i][1]-C[i][2]
        if a[0]==a[1]==a[2]:
            for i in range(3):
                a[i]=C[1][i]-C[0][i]
            if a[0]==a[1]==a[2]:
                for i in range(3):
                    a[i]=C[i][2]-C[i][1]
                if a[0]==a[1]==a[2]:
                    print("Yes")
                    is_Yes=1
if is_Yes==0:
    print("No")

Submission status: Wrong Answer

Solution code:
arr = []

for i in range(3):
	arr.append(map(int,raw_input().split()))

a,b,c = sum(arr[0]),sum(arr[1]),sum(arr[2])

for i in range(-1000000,1000000):
	if (a-i)%3 == 0 and (b-i)%3 == 0 and (c-i)%3 ==0:
		print 'Yes'
		quit()

print 'No'

Submission status: Wrong Answer

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

bi_list = []
for b1 in range(-500000, 500000):
    b2 = b1 - (cij[0][0] - cij[0][1])
    b3 = b1 - (cij[0][0] - cij[0][2])

    a1 = cij[0][0]+cij[0][1]+cij[0][2] -b1-b2-b3
    a2 = cij[1][0]+cij[1][1]+cij[1][2] -b1-b2-b3
    a3 = cij[2][0]+cij[2][1]+cij[2][2] -b1-b2-b3
    if (a1) % 3 == 0 and (a2) % 3 == 0 and (a3) % 3 == 0:
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:
arr = []

for i in range(3):
	arr.append(map(int,raw_input().split()))

a,b,c = sum(arr[0]),sum(arr[1]),sum(arr[2])

for i in range(-10000,10000):
	if (a-i)%3 == 0 and (b-i)%3 == 0 and (c-i)%3 ==0:
		print 'Yes'
		quit()

print 'No'

Submission status: Wrong Answer

Solution code:
arr = []

for i in range(3):
	arr.append(map(int,raw_input().split()))

a,b,c = sum(arr[0]),sum(arr[1]),sum(arr[2])

for i in range(-100,1000):
	if (a-i)%3 == 0 and (b-i)%3 == 0 and (c-i)%3 ==0:
		print 'Yes'
		quit()

print 'No'

Submission status: Wrong Answer

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

bi_list = []
for b1 in range(100):
    b2 = b1 - (cij[0][0] - cij[0][1])
    b3 = b1 - (cij[0][0] - cij[0][2])
    if b2 < 0 or b3 < 0 or b2 > cij[0][1] or b3 > cij[0][2] :
        continue
    bi_list.append([b1, b2, b3])

for bi in bi_list:
    a1 = cij[0][0]+cij[0][1]+cij[0][2] -bi[0]-bi[1]-bi[2] 
    a2 = cij[1][0]+cij[1][1]+cij[1][2] -bi[0]-bi[1]-bi[2] 
    a3 = cij[2][0]+cij[2][1]+cij[2][2] -bi[0]-bi[1]-bi[2] 
    if (a1) % 3 == 0 and (a2) % 3 == 0 and (a3) % 3 == 0 and a1 >=0 and a2 >= 0 and a3 >= 0:
        print("Yes")
        exit()

print("No")

Submission status: Wrong Answer

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

bi_list = []
for b1 in range(101):
    b2 = b1 - (cij[0][0] - cij[0][1])
    b3 = b1 - (cij[0][0] - cij[0][2])
    if b2 < 0 or b3 < 0 or b2 > cij[0][1] or b3 > cij[0][2] :
        continue
    bi_list.append([b1, b2, b3])

for bi in bi_list:
    if (cij[0][0]+cij[0][1]+cij[0][2] -bi[0]-bi[1]-bi[2] ) % 3 == 0 and (cij[1][0]+cij[1][1]+cij[1][2] -bi[0]-bi[1]-bi[2] ) % 3 == 0 and (cij[2][0]+cij[2][1]+cij[2][2] -bi[0]-bi[1]-bi[2] ) % 3 == 0:
        print("Yes")
        exit()

print("No")

Submission status: Wrong Answer

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

bi_list = []
for b1 in range(100):
    b2 = b1 - (cij[0][0] - cij[0][1])
    b3 = b1 - (cij[0][0] - cij[0][2])
    if b2 < 0 or b3 < 0 or b2 > cij[0][1] or b3 > cij[0][2] :
        continue
    bi_list.append([b1, b2, b3])

for bi in bi_list:
    if (cij[0][0]+cij[0][1]+cij[0][2] -bi[0]-bi[1]-bi[2] ) % 3 == 0 and (cij[1][0]+cij[1][1]+cij[1][2] -bi[0]-bi[1]-bi[2] ) % 3 == 0 and (cij[2][0]+cij[2][1]+cij[2][2] -bi[0]-bi[1]-bi[2] ) % 3 == 0:
        print("Yes")
        exit()

print("No")

Submission status: Wrong Answer

Solution code:
c = []
for i in range(3):
    c.append(list(map(int,input().split())))
flg = False
for a1 in range(100):
    for b1 in range(100):
        if c[0][0] != a1 + b1:
            continue
        for a2 in range(100):
            if c[1][0] != a2 + b1:
                continue
            for b2 in range(100):
                if c[0][1] != a1 + b2:
                    continue
                if c[1][1] != a2 + b2:
                    continue
                for a3 in range(100):
                    if c[2][0] != a3 + b1:
                        continue
                    if c[2][1] != a3 + b2:
                        continue
                    for b3 in range(100):
                        if c[0][2] != a1 +b3:
                            continue
                        if c[1][2] != a2 + b3:
                            continue
                        if c[2][2] != a3 + b3:
                            continue
                        flg = True

if flg == True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
C = [list(map(int,input().split(" "))) for i in range(3)]
r = max(max(C))+1
flag = False
for a1 in range(r):
    for a2 in range(r):
        for a3 in range(r):
                        if sum(C[0])-(a1*3) == sum(C[1])-(a2*3) and sum(C[1])-(a2*3)  == sum(C[2])-(a3*3):
                            flag = True
                            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
C = [list(map(int,input().split(" "))) for i in range(3)]
r = max(max(C))
flag = False
for a1 in range(r):
    for b1 in range(r):
        for a2 in range(r):
            for b2 in range(r):
                for a3 in range(r):
                    for b3 in range(r):
                        if (a1+b1)+(a1+b2)+(a1+b3) == sum(C[0]) and (a2+b1)+(a2+b2)+(a2+b3) == sum(C[1]) and (a3+b1)+(a3+b2)+(a3+b3) == sum(C[2]):
                            flag = True
                            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

def main():
    total_sum = 0
    for i in range(3):
        lists = list(map(int, input().split()))
        total_sum += sum(lists)
    if total_sum % 3 == 0:
        print('Yes')
    else:
        print('No') 

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if a[0][0]+a[1][1]+a[2][2] == a[0][2]+a[1][1]+a[2][0] == a[0][1]+a[1][0]+a[2][2] == a[0][1]+a[1][2]+a[2][0]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if a[0][0]+a[1][1]+a[2][2] == a[0][2]+a[1][1]+a[2][0] == a[0][1]+a[1][0]+a[2][2] == a[0][1]+a[1][2]+a[0][2]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def line_input(f, type):
    return f(map(type, input().split(" ")))

c = []
for _ in range(3):
    c.append(line_input(list, int))

def check(in_c):
    for bdx in range(3):
        if (in_c[bdx][0] - a1) == (in_c[bdx][1] - a2) == (in_c[bdx][2] - a3):
            pass
        else:
            return False

    return True


for a1 in range(50 + 1):
    for a2 in range(50 + 1):
        for a3 in range(50 + 1):
            if check(c):
                print("Yes")
                exit(0)
print("No")

Submission status: Wrong Answer

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

a1=0
b1=gridNumber[0][0] - a1
b2=gridNumber[0][1] - a1
b3=gridNumber[0][2] - a1

a2=gridNumber[0][1] - b1
a3=gridNumber[0][2] - b1

numbers.append([a1+b1, a1+b2, a1+b3])
numbers.append([a2+b1, a2+b2, a2+b3])
numbers.append([a3+b1, a3+b2, a3+b3])

for i in range(3):
    for j in range(3):
        if not(numbers[i][j] == gridNumber[i][j]):
            print("No")
            quit()
        else:
            pass

print("Yes")

Submission status: Wrong Answer

Solution code:
c1, c2, c3 = map(int, input().split())
c4, c5, c6 = map(int, input().split())
c7, c8, c9 = map(int, input().split())
if c4-c1==c5-c2 and c5-c2 == c6-c3 and c7-c4 ==c8-c5 and c8-c5 == c9-c6:
    if c2-c1 == c5-c4 and c5-c4 == c8-c7 and c3-c2 == c6-c5 and c6-c5 == c9-c8:
      print('Yes')
    print('No')
else:
  print('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()))

result = 'Yes'
if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

if (C1[0] + C2[0] + C3[0])%3 != 0:
    result = 'No'

if (C1[1] + C2[1] + C3[1])%3 != 0:
    result = 'No'

if (C1[2] + C2[2] + C3[2])%3 != 0:
    result = 'No'

print(result)

Submission status: Wrong Answer

Solution code:
C1 = list(map(int, input().split()))
C2 = list(map(int, input().split()))
C3 = list(map(int, input().split()))

result = 'Yes'
if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

if (C1[0] + C2[0] + C3[0] %3 != 0):
    result = 'No'

if (C1[1] + C2[1] + C3[1] %3 != 0):
    result = 'No'

if (C1[2] + C2[2] + C3[2] %3 != 0):
    result = 'No'

print(result)

Submission status: Wrong Answer

Solution code:
C1 = list(map(int, input().split()))
C2 = list(map(int, input().split()))
C3 = list(map(int, input().split()))

result = 'Yes'
if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

if (sum(C1) - sum(C2))%3 != 0:
    result = 'No'

print(result)

Submission status: Wrong Answer

Solution code:
build = []
number = []

prefic = []

for j in range(3):
    test = input().split(" ")
    build.append(test)

test = int(build[0][0]) + int(build[0][1])
test2 = int(build[2][0]) + int(build[2][1])

if test == int(build[1][1]) and test2== int(build[1][1]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

C = [0 for _ in range(3)]
for i in range(3):
    C[i] = list(map(int, input().split()))
C = np.array(C)

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

Submission status: Wrong Answer

Solution code:
import numpy as np

C = [0 for _ in range(3)]
for i in range(3):
    C[i] = list(map(int, input().split()))
C = np.array(C)

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu May 10 16:54:15 2018

@author: Narita
"""

n = 3
c = []
flatten_c = []
for i in range(n):
    tmp = [int(num) for num in input().split()]
    c.append(tmp)
    flatten_c.extend(tmp)

a = []
b = []

for i in range(n):
    a.append(min(c[i]))
    b.append(min(c[0][i], c[1][i], c[2][i]))

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = 0
for i in range(3):
    a += sum([int(i) for i in input().split()])
if a % 3 == 0:
    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()))

true=0
while true==0:
    if b[0]-a[0]==b[1]-a[1]==b[2]-a[2]:
        true+=0
    else:
        true+=1
        break
    if c[0]-b[0]==c[1]-b[1]==c[2]-b[2]:
        true+=0
    else:
        true+=1
        break
    if a[1]-a[0]==b[1]-b[0]==c[1]-c[0]:
        true+=0
    else:
        true+=1
        break
    if a[2]-a[1]==b[2]-b[1]==c[2]-c[1]:
        true+=0
        break
    else:
        true+=1
        break        
if true==0:
    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()))

true=0
while true==0:
    if b[0]-a[0]==b[1]-a[1]==b[2]-a[2]:
        true+=0
    else:
        true+=1
    if c[0]-b[0]==c[1]-b[1]==c[2]-b[2]:
        true+=0
        break
    else:
        true+=1
        break
        
if true==0:
    print('yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
c = [[int(i) for i in input().split()] for i in range(3)]
a, b = [], []
possible = True 

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 not c[i][j] == a[i]+b[j]:
            possible = False
print('Yes' if possible else 'No')

Submission status: Wrong Answer

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

T1=[]
T2=[]
T3=[]

for i in range(3):
    T1.append(abs(S[1][i]-S[0][i]))
for i in range(3):
    T2.append(abs(S[2][i]-S[1][i]))


if T1[0]==T1[1]==T1[2]==T2[0]==T2[1]==T2[2]: 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 (a+b+c+d+e+f+g+h+i)%3 == 0:
    if (a+b+c+d+e+f+g+h+i)<900:
        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 (a+b+c+d+e+f+g+h+i)%3 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
table=[]
a=[9999,9999,9999]
b=[9999,9999,9999]
for i in range(3):
    table.append(list(map(int,input().split())))
    a[i]=min(table[-1])
    for j in range(3):
        b[j]=min(b[j],table[-1][j])
for q in range(a[0]+1):
    for w in range(a[1]+1):
        for e in range(a[2]+1):
            for r in range(b[0]+1-q+1):
                for t in range(b[1]+1-w+1):
                    for y in range(b[2]+1-e+1):
                        #print(q,w,e,r,t,y)
                        if q+r==table[0][0] and \
                        q+t==table[0][1] and \
                        q+y==table[0][2] and \
                        w+r==table[1][0] and \
                        w+t==table[1][1] and \
                        w+y==table[1][2] and \
                        e+r==table[2][0] and \
                        e+t==table[2][1] and \
                        e+y==table[2][2]:
                            print('Yes')
                            exit()
print('No')

Submission status: Wrong Answer

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

print('Yes' if abs(np.sum(s))%3==0 else 'No')

Submission status: Wrong Answer

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

print('Yes' if np.sum(s)%3==0 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()))
s = [c1,c2,c3]

s1 = s[0][0] - s[0][1] - s[1][0] + s[1][1]
s2 = s[1][1] - s[1][2] - s[2][1] + s[2][2]
if s1== 0 and s2==0:
    print('Yes')
else:
    print('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()))
s = [c1,c2,c3]
print(s)
s1 = s[0][0] - s[0][1] - s[1][0] + s[1][1]
s2 = s[1][1] - s[1][2] - s[2][1] + s[2][2]
if  s1== 0 and s2==0:
    if s[0][0] + s[2][2] == s[0][2] + s[2][0]:
        print('Yes')
    else:
        print('No')
else:
    print('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()))
s = [c1,c2,c3]
print(s)
s1 = s[0][0] - s[0][1] - s[1][0] + s[1][1]
s2 = s[1][1] - s[1][2] - s[2][1] + s[2][2]
if  s1== 0 and s2==0:
    if s[0][0] + s[2][2] == s[0][2] + s[2][2]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
c = np.array([[int(i) for i in input().split()] for _ in range(3)])
b = np.sum(c) % 3 == 0
b &= np.sum(c[0] - c[1]) % 3 == 0
b &= np.sum(c[0] - c[2]) % 3 == 0
b &= np.sum(c[1] - c[2]) % 3 == 0
print('Yes' if b else 'No')

Submission status: Wrong Answer

Solution code:
import numpy as np
c = np.array([[int(i) for i in input().split()] for _ in range(3)])
print('Yes' if np.sum(c) % 3 == 0 else 'No')

Submission status: Wrong Answer

Solution code:
import numpy as np
c1 = [int(i) for i in input().split()]
c2 = [int(i) for i in input().split()]
c3 = [int(i) for i in input().split()]
s = np.sum(c1) + np.sum(c2) + np.sum(c3)
print('Yes' if s % 3 == 0 else 'No')

Submission status: Wrong Answer

Solution code:

c1 = [int(i) for i in input().split()]
c2 = [int(i) for i in input().split()]
c3 = [int(i) for i in input().split()]
s = sum(c1) + sum(c2) + sum(c3)
print('Yes' if s % 3 == 0 else 'No')

Submission status: Wrong Answer

Solution code:
import numpy as np
c = np.array([[int(i) for i in input().split()] for _ in range(3)])
print(np.sum(c) % 3 == 0)