今まで学んだことを活かせてほっ。
ちなみに答えの方は、maxを使わない方法だった。
N = int(input())
M = list(map(int,input().split()))
A = []
for i in range(N):
A.append(list(map(int,input().split())))
B = []
sum = 0
for i in range(len(A)):
for j in range(len(A[i])):
sum += (A[i][j] * M[j])
B.append(sum)
sum = 0
print(max(B))