AtCoder Beginner Contest 121 - Can you solve this?

There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}.
Additionally, you are given integers B_1, B_2, ..., B_M and C.
The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0.
Among the N codes, find the number of codes that correctly solve this problem.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N, M \leq 20
 - -100 \leq A_{ij} \leq 100
 - -100 \leq B_i \leq 100
 - -100 \leq C \leq 100

-----Input-----
Input is given from Standard Input in the following format:
N M C
B_1 B_2 ... B_M
A_{11} A_{12} ... A_{1M}
A_{21} A_{22} ... A_{2M}
\vdots
A_{N1} A_{N2} ... A_{NM}

-----Output-----
Print the number of codes among the given N codes that correctly solve this problem.

-----Sample Input-----
2 3 -10
1 2 3
3 2 1
1 2 2

-----Sample Output-----
1

Only the second code correctly solves this problem, as follows:
 - Since 3 \times 1 + 2 \times 2 + 1 \times 3 + (-10) = 0 \leq 0, the first code does not solve this problem.
 - 1 \times 1 + 2 \times 2 + 2 \times 3 + (-10) = 1 > 0, the second code solves this problem.

Source: atcoder | Difficulty: EASY


Solutions:
(n, m, c) = list(map(int, input().split()))
b = [int(i) for i in input().split()]
count = 0
for i in range(n):
	a = [int(i) for i in input().split()]
	sum = c
	for j in range(m):
		sum += a[j] * b[j]
	if sum > 0:
		count += 1
print(count)


from operator import mul
ans = 0
(N, M, C) = map(int, input().split())
X = [list(map(int, input().split())) for i in range(N + 1)]
for i in range(N):
	num = list(map(mul, X[0], X[i + 1]))
	add = sum(num) + C
	if add > 0:
		ans += 1
print(ans)


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
for _ in range(N):
	A = list(map(int, input().split()))
	temp = C
	for (a, b) in zip(A, B):
		temp += a * b
	if temp > 0:
		ans += 1
print(ans)


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
for i in range(N):
	A = list(map(int, input().split()))
	tmp = 0
	for j in range(M):
		tmp += A[j] * B[j]
	if tmp + C > 0:
		ans += 1
print(ans)


a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
ans = 0
e = 0
for i in range(a[0]):
	d = list(map(int, input().split()))
	c.append(d)
for i in c:
	for j in range(a[1]):
		e += b[j] * i[j]
	if e + a[2] > 0:
		ans += 1
	e = 0
print(ans)


f = lambda : list(map(int, input().split()))
(n, m, c) = f()
b = f()
print(sum((sum((i * j for (i, j) in zip(f(), b))) > -c for i in range(n))))


(N, M, C) = map(int, input().split())
B = input().split()
count = 0
for i in range(N):
	A = input().split()
	sum = C
	for k in range(M):
		sum += int(A[k]) * int(B[k])
	if sum > 0:
		count += 1
print(count)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for _ in range(n):
	a = list(map(int, input().split()))
	r = c + sum([a[i] * b[i] for i in range(m)])
	ans += 1 if r > 0 else 0
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
cnt = 0
for i in range(n):
	s = 0
	a = list(map(int, input().split()))
	for j in range(m):
		s = s + a[j] * b[j]
	if s + c > 0:
		cnt = cnt + 1
print(cnt)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
A = [0] * N
for i in range(N):
	A[i] = [int(j) for j in input().split()]
cnt = 0
for i in range(N):
	pm = C
	for j in range(M):
		pm += A[i][j] * B[j]
	if pm > 0:
		cnt += 1
print(cnt)


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
print(sum((sum((i * j for (i, j) in zip(list(map(int, input().split())), B))) > -C for k in range(N))))


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
count = 0
for n in range(N):
	An = list(map(int, input().split()))
	if sum([An[m] * B[m] for m in range(M)]) > -C:
		count += 1
print(count)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
r = 0
for _ in range(n):
	a = list(map(int, input().split()))
	d = 0
	for jj in range(m):
		d += a[jj] * b[jj]
	if d + c > 0:
		r += 1
print(r)


(N, M, C) = map(int, input().split())
BM = list(map(int, input().split()))
ANM = [list(map(int, input().split())) for _ in range(N)]

class Answer:

	def __init__(self, N, M, C, BM, ANM):
		self.N = N
		self.M = M
		self.C = C
		self.BM = BM
		self.ANM = ANM

	def result(self):
		ans = 0
		for i in range(N):
			cnt = C
			for j in range(M):
				cnt += BM[j] * ANM[i][j]
			if cnt > 0:
				ans += 1
		print(ans)
info = Answer(N, M, C, BM, ANM)
info.result()


(N, M, C) = map(int, input().split())
(*B,) = map(int, input().split())
ans = 0
for i in range(N):
	(*A,) = map(int, input().split())
	ans += sum((a * b for (a, b) in zip(A, B))) + C > 0
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
r = 0
for _ in range(n):
	a = list(map(int, input().split()))
	s = 0
	for i in range(m):
		s += a[i] * b[i]
	if s > -c:
		r += 1
print(r)


(n, m, c) = map(int, input().split())
bl = list(map(int, input().split()))
ans = 0
for i in range(n):
	al = list(map(int, input().split()))
	if sum([x * y for (x, y) in zip(al, bl)]) + c > 0:
		ans += 1
print(ans)


import numpy as np
(n, m, c) = list(map(int, input().split()))
b = list(map(int, input().split()))
b = np.array(b)
k = 0
for i in range(n):
	a = list(map(int, input().split()))
	a = np.array(a)
	ans = np.dot(a, b)
	if ans + c > 0:
		k += 1
print(k)


(n, m, c) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for _ in range(n):
	A = [int(i) * j for (i, j) in zip(input().split(), B)]
	if sum(A) + c > 0:
		ans += 1
print(ans)


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
for _ in range(N):
	A = list(map(int, input().split()))
	x = C
	for i in range(M):
		x += A[i] * B[i]
	if x > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for i in range(N):
	A = list(map(int, input().split()))
	ans += 1 if sum([A[k] * B[k] for k in range(M)]) + C > 0 else 0
print(ans)


(N, M, C) = map(int, input().split())
cnt = 0
B = [int(b) for b in input().split()]
for n in range(N):
	if sum((int(a) * B[i] for (i, a) in enumerate(input().split()))) + C > 0:
		cnt = cnt + 1
print(cnt)


(n, m, c) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for _ in range(n):
	A = list(map(int, input().split()))
	if sum([a * b for (a, b) in zip(A, B)]) + c > 0:
		ans += 1
print(ans)


(g, r, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for _ in range(g):
	f = c
	hj = list(map(int, input().split()))
	for (z, x) in zip(b, hj):
		f += z * x
	if f > 0:
		ans += 1
print(ans)


I = lambda : map(int, input().split())
(n, m, c) = I()
(*b,) = I()
print(sum((-c < sum((x * y for (x, y) in zip(I(), b))) for _ in [0] * n)))


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
A = []
for _ in range(N):
	A.append(list(map(int, input().split())))
ans = 0
for i in range(N):
	y = 0
	for j in range(M):
		y += A[i][j] * B[j]
	y += C
	if y > 0:
		ans += 1
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
e = 0
for i in range(n):
	a = list(map(int, input().split()))
	d = 0
	for i in range(len(b)):
		d = a[i] * b[i] + d
	if d + c > 0:
		e = e + 1
print(e)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
res = 0
for _ in range(n):
	a = list(map(int, input().split()))
	res += sum((a[i] * b[i] for i in range(m))) + c > 0
print(res)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
print(sum((sum((ai * bi for (ai, bi) in zip(map(int, input().split()), b))) + c > 0 for _ in range(n))))


(N, _, C) = map(int, input().split())
B = list(map(int, input().split()))
print(sum((sum((a * b for (a, b) in zip(list(map(int, input().split())), B))) + C > 0 for _ in range(N))))


(n, m, c) = map(int, input().split())
b = [int(x) for x in input().split()]
cnt = 0
for i in range(n):
	a = [int(x) for x in input().split()]
	ans = c
	for j in range(m):
		ans += a[j] * b[j]
	if ans > 0:
		cnt += 1
print(cnt)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
count = 0
for N in range(N):
	A = list(map(int, input().split()))
	culc = list()
	culc.append(C)
	for i in range(M):
		d = B[i] * A[i]
		culc.append(d)
	if sum(culc) > 0:
		count += 1
print(count)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for _ in range(n):
	a = map(int, input().split())
	if sum((i * j for (i, j) in zip(a, b))) + c > 0:
		ans += 1
print(ans)


(N, *L) = [list(map(int, s.split())) for s in open(0)]
A = L[:1][0]
B = L[1:]
cnt = 0
for b in B:
	c = 0
	for i in range(len(b)):
		c += A[i] * b[i]
	if c + N[2] > 0:
		cnt += 1
print(cnt)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for i in range(n):
	a = list(map(int, input().split()))
	k = 0
	for i in range(m):
		k += a[i] * b[i]
	ans += k + c > 0
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for i in range(N):
	A = list(map(int, input().split()))
	s = sum([x * y for (x, y) in zip(A, B)])
	if s + C > 0:
		ans += 1
print(ans)


(n, m, c) = map(int, input().split())
b = [i for i in map(int, input().split())]
r = 0
for i in range(n):
	t = 0
	for (i, j) in zip(map(int, input().split()), b):
		t += i * j
	r += t + c > 0
print(r)


def F():
	return map(int, input().split())
(n, m, c) = F()
b = list(F())
print(sum((sum((x * y for (x, y) in zip(F(), b))) > -c for _ in range(n))))


(n, m, c) = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt = 0
for _ in range(n):
	sum = c
	a = list(map(int, input().split()))
	for i in range(m):
		sum += a[i] * b[i]
	if sum > 0:
		cnt += 1
print(cnt)


(a, s, d) = map(int, input().split())
lis = list(map(int, input().split()))
c = 0
for i in range(a):
	l = list(map(int, input().split()))
	sum = d
	for k in range(s):
		sum += lis[k] * l[k]
	if sum > 0:
		c += 1
print(c)


(n, m, c) = map(int, input().split())
b = tuple(map(int, input().split()))
print(sum((sum((a * b for (b, a) in zip(b, list(map(int, input().split()))))) + c > 0 for _ in range(n))))


def main():
	(n, m, c) = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a = []
	cnt = 0
	for i in range(n):
		a.append(list(map(int, input().split())))
	for i in range(n):
		ans = 0
		for k in range(m):
			ans += a[i][k] * b[k]
		if ans + c > 0:
			cnt += 1
	print(cnt)

def __starting_point():
	main()
__starting_point()


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
count = 0
for i in range(n):
	s = 0
	a = list(map(int, input().split()))
	for x in range(m):
		s += a[x] * b[x]
	s += c
	if s > 0:
		count += 1
print(count)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
count = 0
for i in range(N):
	A = list(map(int, input().split()))
	p = C
	for j in range(M):
		p += A[j] * B[j]
	if p > 0:
		count += 1
print(count)


(a, b, c) = map(int, input().split())
x = list(map(int, input().split()))
ans = 0
for _ in range(a):
	y = list(map(int, input().split()))
	t = [x[i] * y[i] for i in range(b)]
	if sum(t) + c > 0:
		ans += 1
print(ans)


(n, m, c, *a) = map(int, open(0).read().split())
b = a[:m]
print(sum((-c < sum((x * y for (x, y) in zip(b, a[i * m:-~i * m]))) for i in range(1, n + 1))))


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
a = [map(int, input().split()) for _ in range(n)]
ans = 0
for x in a:
	ans += 1 if sum(map(lambda y, z: y * z, x, b)) > -c else 0
print(ans)


(n, m, c) = map(int, input().split())
b = [int(x) for x in input().split()]
ans = 0
for _ in range(n):
	if sum([b[i] * int(x) for (i, x) in enumerate(input().split())]) + c > 0:
		ans += 1
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(n)]
ans = []
val = 0
for arr in a:
	for s in range(m):
		val += arr[s] * b[s]
		if s == m - 1:
			ans.append(val)
			val = 0
ans = list(map(lambda x: x + c, ans))
print(sum((l > 0 for l in ans)))


(N, B, C) = map(int, input().split())
M = list(map(int, input().split()))
ans = 0
for _ in range(N):
	L = list(map(int, input().split()))
	a = 0
	for i in range(B):
		a += M[i] * L[i]
	if a + C > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
A = [tuple(map(int, input().split())) for _ in range(N)]
cnt = 0
for a in range(N):
	math_list = []
	for b in range(M):
		math_list.append(A[a][b] * B[b])
	if sum(math_list) + C > 0:
		cnt += 1
print(cnt)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for i in range(N):
	if sum(map(lambda x, y: int(x) * y, input().split(), B)) + C > 0:
		ans += 1
print(ans)


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(N)]
S = 0
for i in range(N):
	AB = 0
	for j in range(len(B)):
		AB += B[j] * A[i][j]
	if AB + C > 0:
		S += 1
print(S)


(n, m, c) = map(int, input().split())
b = [int(i) for i in input().split()]
ans = 0
for i in range(n):
	a = [int(i) for i in input().split()]
	sum = c
	for i in range(m):
		sum += b[i] * a[i]
	ans += sum > 0
print(ans)


(N, M, C) = map(int, input().split())
B = [int(x) for x in input().split()]
ans = 0
for i in range(N):
	A = [int(x) for x in input().split()]
	s = 0
	for j in range(M):
		s += A[j] * B[j]
	if s + C > 0:
		ans += 1
print(ans)


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
ans = 0
ANS = []
ct = 0
for i in range(N):
	for j in range(M):
		ans += A[i][j] * B[j]
		if j == M - 1:
			ANS.append(ans)
			ans = 0
for x in ANS:
	if x + C > 0:
		ct += 1
print(ct)


import numpy as np
(n, m, c) = map(int, input().split())
b = np.array(list(map(int, input().split())))
cnt = 0
for _ in range(n):
	a = np.array(list(map(int, input().split())))
	if sum(a * b) + c > 0:
		cnt += 1
print(cnt)


f = lambda : [*map(int, input().split())]
(n, m, c) = f()
l = f()
print(sum((sum((a * b for (a, b) in zip(f(), l))) > -c for _ in range(n))))


(n, m, c) = map(int, input().split())
co = 0
b = list(map(int, input().split()))
for i in range(n):
	a = list(map(int, input().split()))
	s = 0
	for i in range(len(a)):
		s += a[i] * b[i]
	res = s + c
	if res > 0:
		co += 1
print(co)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
answer = 0
memo = 0
for i in range(n):
	a = list(map(int, input().split()))
	for j in range(m):
		memo += a[j] * b[j]
	memo += c
	if memo > 0:
		answer += 1
	memo = 0
print(answer)


(n, m, c) = map(int, input().split())
b = [int(i) for i in input().split()]
a = [[int(i) for i in input().split()] for j in range(n)]
answer = 0
for i in range(n):
	x = 0
	for j in range(len(a[i])):
		x += a[i][j] * b[j]
	x += c
	if x > 0:
		answer += 1
print(answer)


((n, _, c), b, *a) = [list(map(int, t.split())) for t in open(0)]
n = [1] * n
for (h, i) in enumerate(a):
	n[h] *= sum((j * k for (j, k) in zip(b, i))) + c > 0
print(sum(n))


(n, m, c) = map(int, input().split())
B = list(map(int, input().split()))
count = 0
for i in range(n):
	p = c
	A = list(map(int, input().split()))
	for j in range(m):
		p += A[j] * B[j]
	if p > 0:
		count += 1
print(count)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for i in range(n):
	ai = list(map(int, input().split()))
	ans += sum((ai[j] * b[j] for j in range(m))) + c > 0
print(ans)


from typing import List

def judge(c: int, m: int, b: List[int], a: List[int]) -> bool:
	result = c
	for i in range(m):
		result += a[i] * b[i]
	return 0 < result

def answer(n: int, m: int, c: int, b: List[int], a: List[List[int]]) -> int:
	count = 0
	for i in range(n):
		if judge(c, m, b, a[i]):
			count += 1
	return count

def main():
	(n, m, c) = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a = [list(map(int, input().split())) for _ in range(n)]
	print(answer(n, m, c, b, a))

def __starting_point():
	main()
__starting_point()


(n, m, c, *a) = map(int, open(0).read().split())
print(sum((sum((a[:m][t] * a[s + t] for t in range(m))) + c > 0 for s in range(m, (n + 1) * m, m))))


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
a = [[int(i) for i in input().split()] for l in range(n)]
d = 0
for x in a:
	l = [p * q for (p, q) in zip(x, b)]
	if sum(l) + c > 0:
		d += 1
print(d)


f = lambda : map(int, input().split())
(n, m, c) = f()
l = list(f())
ans = 0
for i in range(n):
	ans += sum((a * b for (a, b) in zip(f(), l))) + c > 0
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for i in range(n):
	d = 0
	a = list(map(int, input().split()))
	for j in range(m):
		d += a[j] * b[j]
	if d + c > 0:
		ans += 1
print(ans)


(n, m, c) = map(int, input().split())
b = input().split()
a = [input().split() for _ in range(n)]
s = ans = 0
for i in range(n):
	for j in range(m):
		s += int(b[j]) * int(a[i][j])
	s += c
	if s > 0:
		ans += 1
	s = 0
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for i in range(n):
	a = list(map(int, input().split()))
	if sum([x * y for (x, y) in zip(a, b)]) + c > 0:
		ans += 1
print(ans)


(n, m, c) = (int(i) for i in input().split())
list_b = [int(i) for i in input().split()]
list_a = [[int(i) for i in input().split()] for j in range(0, n)]
count = 0
tmp = 0
for i in range(0, n):
	for j in range(0, m):
		tmp += list_b[j] * list_a[i][j]
	tmp += c
	if tmp > 0:
		count += 1
	tmp = 0
print(count)


import sys
input = sys.stdin.readline

def main():
	(n, m, c) = map(int, input().split())
	base_data = []
	source_codes = []
	base_data = list(map(int, input().split()))
	source_codes = [list(map(int, input().split())) for _ in range(n)]
	ans = 0
	cnt = 0
	for i in range(n):
		for j in range(m):
			ans += source_codes[i][j] * base_data[j]
		ans = ans + c
		if ans > 0:
			ans = 0
			cnt += 1
		else:
			ans = 0
			continue
	print(cnt)

def __starting_point():
	main()
__starting_point()


(n, m, c) = map(int, input().split())
(*B,) = map(int, input().split())
cnt = 0
for i in range(n):
	(*A,) = map(int, input().split())
	if sum([A[j] * B[j] for j in range(m)]) + c > 0:
		cnt += 1
print(cnt)


f = lambda : [*map(int, input().split())]
(n, m, c) = f()
l = f()
a = 0
for _ in range(n):
	t = sum((a * b for (a, b) in zip(f(), l)))
	if t + c > 0:
		a += 1
print(a)


(N, M, C) = map(int, input().split())
Bl = list(map(int, input().split()))
ans = 0
for _ in range(N):
	Al = list(map(int, input().split()))
	if sum((a * b for (a, b) in zip(Al, Bl))) + C > 0:
		ans += 1
print(ans)


(code_number, characteristic_code, integer3) = map(int, input().split())
integer2 = list(map(int, input().split()))
integer1 = [list(map(int, input().split())) for i in range(code_number)]
solution = 0
for i in range(code_number):
	multiplication = integer3
	for j in range(characteristic_code):
		multiplication += integer2[j] * integer1[i][j]
	if multiplication > 0:
		solution += 1
print(solution)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for _ in range(N):
	A = list(map(int, input().split()))
	if sum([a * b for (a, b) in zip(A, B)]) + C > 0:
		cnt += 1
print(cnt)


(n, m, c) = map(int, input().split())
list01 = list(map(int, input().split()))
a = 0
b = 0
for i in range(n):
	list02 = list(map(int, input().split()))
	for j in range(m):
		a += list02[j] * list01[j]
	if a + c > 0:
		b += 1
		a = 0
	else:
		a = 0
print(b)


(n, _, c) = map(int, input().split())
bs = tuple(map(int, input().split()))
count = 0
for _ in range(n):
	if sum((x * y for (x, y) in zip(map(int, input().split()), bs))) + c > 0:
		count += 1
print(count)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for i in range(N):
	A_i = list(map(int, input().split()))
	if sum([x * y for (x, y) in zip(A_i, B)]) + C > 0:
		cnt += 1
print(cnt)


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
cnt = 0
for n in range(N):
	value = 0
	for m in range(M):
		value += A[n][m] * B[m]
	value += C
	if value > 0:
		cnt += 1
print(cnt)


(n, m, c) = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(n)]
ans = 0
for a in A:
	s = c
	for i in range(m):
		s += a[i] * B[i]
	if s > 0:
		ans += 1
print(ans)


(n, m, c) = list(map(int, input().split()))
arr = list(map(int, input().split()))
count2 = 0
for _ in range(n):
	count = 0
	arr2 = list(map(int, input().split()))
	for (k, kk) in zip(arr2, arr):
		count += k * kk
	if count + c > 0:
		count2 += 1
print(count2)


(n, m, c) = map(int, input().split())
a = []
for i in range(n + 1):
	a.append(list(map(int, input().split())))
y = 0
for i in range(n):
	x = 0
	for j in range(m):
		x += a[i + 1][j] * a[0][j]
	if x + c > 0:
		y += 1
print(y)


(N, M, C) = list(map(int, input().split()))
B = input()
A = [input() for i in range(N)]

def ans121(N: int, M: int, C: int, B: str, A: list):
	B = list(map(int, B.split()))
	judge_count = 0
	for i in range(N):
		A_list = list(map(int, A[i].split()))
		math_count = 0
		for j in range(M):
			math_count += B[j] * A_list[j]
		if math_count + C > 0:
			judge_count += 1
	return judge_count
print(ans121(N, M, C, B, A))


(N, M, C) = map(int, input().split())
(*B,) = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
ans = 0
for pa in A:
	x = sum((a * b for (a, b) in zip(pa, B))) + C
	ans += x > 0
print(ans)


(n, m, c) = list(map(int, input().split()))
base_list = list(map(int, input().split()))
double_lists = []
calc_sum = 0
ans = 0
for _ in range(n):
	a = list(map(int, input().split()))
	double_lists.append(a)
for i in double_lists:
	for (index, j) in enumerate(i):
		calc_sum += j * base_list[index]
	if calc_sum + c > 0:
		ans += 1
	calc_sum = 0
print(ans)


mi = lambda : map(int, input().split())
(n, m, c) = mi()
b = list(mi())
a = [list(mi()) for _ in range(n)]
print(sum([sum((aij * bj for (aij, bj) in zip(ai, b))) + c > 0 for ai in a]))


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
li = [list(map(int, input().split())) for i in range(n)]
cnt = 0
su = 0
for i in range(n):
	for j in range(m):
		su += li[i][j] * b[j]
	if su + c > 0:
		cnt += 1
	su = 0
print(cnt)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
count = 0
for _ in range(n):
	result = c
	a = list(map(int, input().split()))
	for (i, j) in zip(a, b):
		result += i * j
	if result > 0:
		count += 1
print(count)


(n, m, c) = map(int, input().split())
bs = list(map(int, input().split()))
ans = 0
for i in range(n):
	as_ = list(map(int, input().split()))
	if sum([a * b for (a, b) in zip(as_, bs)]) + c > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
As = [list(map(int, input().split())) for _ in range(N)]
print(sum((sum((a * b for (a, b) in zip(A, B))) > -C for A in As)))


(n, m, c) = list(map(int, input().split()))
b = list(map(int, input().split()))
a = []
d = 0
for i in range(n):
	a.append(list(map(int, input().split())))
	combined1 = [x * y for (x, y) in zip(a[i], b)]
	if sum(combined1) + c > 0:
		d += 1
print(d)


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(n, m, c) = Input()
	b = Input()
	a = [Input() for _ in range(n)]
	ans = 0
	for row in a:
		tmp = c
		for (x, y) in zip(row, b):
			tmp += x * y
		if tmp > 0:
			ans += 1
	print(ans)
main()


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
for n in range(N):
	A = list(map(int, input().split()))
	c = 0
	for m in range(M):
		c += A[m] * B[m]
	c += C
	if c > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
base_list = list(map(int, input().split()))
multi = 0
ans = 0
for i in range(N):
	second_list = list(map(int, input().split()))
	for j in range(M):
		multi += base_list[j] * second_list[j]
	if multi + C > 0:
		ans += 1
		multi = 0
	else:
		multi = 0
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
ct = 0
for i in range(N):
	if sum([j * k for (j, k) in zip(list(map(int, input().split())), B)]) + C > 0:
		ct += 1
print(ct)


((n, m, c), bb, *aaa) = [list(map(int, l.split())) for l in open(0)]
ans = 0
print(sum((sum((b * a for (b, a) in zip(bb, aa))) + c > 0 for aa in aaa)))


import sys
import numpy as np
input = sys.stdin.readline
(N, M, C) = list(map(int, input().split()))
B = np.array(list(map(int, input().split())))

def main():
	count = 0
	for i in range(N):
		A = np.array(list(map(int, input().split())))
		if sum(A * B) + C > 0:
			count += 1
	return count

def __starting_point():
	print(main())
__starting_point()


(n, m, c) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for i in range(n):
	A = list(map(int, input().split()))
	tmp = 0
	for j in range(m):
		tmp += A[j] * B[j]
	if tmp + c > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
list_b = list(map(int, input().split()))
ans = 0
for i in range(N):
	temp = 0
	list_a = list(map(int, input().split()))
	for j in range(M):
		temp += list_a[j] * list_b[j]
	if temp + C > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
right_answer = 0
for i in range(N):
	A = list(map(int, input().split()))
	if sum((a * b for (a, b) in zip(A, B))) + C > 0:
		right_answer += 1
print(right_answer)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
code_count = 0
answer = 0
while N > code_count:
	A = list(map(int, input().split()))
	sum = C
	for i in range(M):
		sum += A[i] * B[i]
	if sum > 0:
		answer += 1
	code_count += 1
print(answer)


(n, _, c) = map(int, input().split())
b = list(map(int, input().split()))
print(sum((sum((i * j for (i, j) in zip(map(int, input().split()), b))) + c > 0 for _ in range(n))))


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for i in range(N):
	A = list(map(int, input().split()))
	d = 0
	for (j, k) in zip(A, B):
		d += j * k
	if d > -C:
		ans += 1
print(ans)


(n, m, c) = list(map(int, input().split(' ')))
b_arr = list(map(int, input().split(' ')))
ans = 0
a_arr = []
for _ in range(n):
	a_arr = list(map(int, input().split(' ')))
	sum_num = c
	for i in range(m):
		sum_num += a_arr[i] * b_arr[i]
	if sum_num > 0:
		ans += 1
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
num = 0
for _ in range(n):
	a = list(map(int, input().split()))
	hoge = 0
	for i in range(m):
		hoge += a[i] * b[i]
	if hoge + c > 0:
		num += 1
print(num)


(N, M, C) = map(int, input().split())
(*B,) = map(int, input().split())
count = 0
for _ in range(N):
	count += 0 < sum((x * y for (x, y) in zip(tuple(map(int, input().split())), B))) + C
print(count)


(N, M, C) = map(int, input().split())
(*b,) = map(int, input().split())
ans = 0
for _ in range(N):
	(*a,) = map(int, input().split())
	if sum((i * j for (i, j) in zip(a, b))) + C > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for n in range(N):
	A = list(map(int, input().split()))
	s = sum([A[i] * B[i] for i in range(M)]) + C
	if s > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = input().split()
res = 0
for i in range(N):
	sum = C
	A = input().split()
	for j in range(M):
		sum += int(B[j]) * int(A[j])
	if sum > 0:
		res += 1
print(res)


(n, m, c) = map(int, input().split())
l = list(map(int, input().split()))
h = 0
for i in range(n):
	d = list(map(int, input().split()))
	s = c
	for i in range(m):
		s += l[i] * d[i]
	if s > 0:
		h += 1
print(h)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
x = 0
for _ in range(n):
	s = list(map(int, input().split()))
	z = c
	for i in range(m):
		z += s[i] * b[i]
	if z > 0:
		x += 1
print(x)


(N, M, C) = map(int, input().split())
lists_B = list(map(int, input().split()))
lists_A = []
for _ in range(1, N + 1):
	lists_A.append(input().split())
SUM = 0
result = 0
for i in range(0, N):
	for j in range(0, M):
		SUM += int(lists_A[i][j]) * lists_B[j]
	if SUM + C > 0:
		result += 1
	SUM = 0
print(result)


(n, m, c) = map(int, input().split())
bl = [int(i) for i in input().split()]
ans = 0
for i in range(n):
	al = [int(j) for j in input().split()]
	ans += sum([bl[j] * al[j] for j in range(m)]) + c > 0
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for _ in range(N):
	A = list(map(int, input().split()))
	cnt += int(sum([A[i] * B[i] for i in range(M)], C) > 0)
print(cnt)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
print(len([i for i in range(N) if sum([A[i][j] * B[j] for j in range(M)]) + C > 0]))


ans = 0
(n, m, c) = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
	a = list(map(int, input().split()))
	tmp = sum([a_ * b_ for (a_, b_) in zip(a, b)]) + c
	if tmp > 0:
		ans += 1
print(ans)


def MAP():
	return list(map(int, input().split()))
(n, m, c) = MAP()
b = MAP()
ans = 0
for i in range(n):
	sm = 0
	a = MAP()
	for j in range(m):
		sm += a[j] * b[j]
	if sm + c > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
t = 0
for i in range(N):
	A = list(map(int, input().split()))
	k = C
	for j in range(M):
		k += A[j] * B[j]
	if k > 0:
		t += 1
print(t)


(N, M, C) = list(map(int, input().split()))
B = list(map(int, input().split()))
ac = 0
for i in range(N):
	A = list(map(int, input().split()))
	D = 0
	for j in range(M):
		D += A[j] * B[j]
	D += C
	if D > 0:
		ac += 1
print(ac)


(n, m, c) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for i in range(n):
	temp = 0
	A = list(map(int, input().split()))
	for (a, b) in zip(A, B):
		temp += a * b
	if temp + c > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = [int(x) for x in input().split()]
cnt = 0
for i in range(N):
	S = sum([int(x) * B[i] for (i, x) in enumerate(input().split())]) + C
	cnt += 1 if S > 0 else 0
print(cnt)


a = [int(c) for c in input().split()]
N = a[0]
M = a[1]
C = a[2]
B = [int(c) for c in input().split()]
A = [list(map(int, input().split())) for c in range(N)]
result = []
for i in range(N):
	cnt = C
	for j in range(M):
		cnt += A[i][j] * B[j]
	if cnt > 0:
		result.append(1)
	else:
		result.append(0)
print(sum(result))


I = lambda : map(int, input().split())
(n, m, c) = I()
B = list(I())
e = 0
for t in range(n):
	d = 0
	for (a, b) in zip(list(I()), B):
		d += a * b
	e += d + c > 0
print(e)


f = lambda : list(map(int, input().split()))
(n, m, c) = f()
b = f()
t = 0
for i in range(n):
	a = f()
	if sum((i * j for (i, j) in zip(a, b))) > -c:
		t += 1
print(t)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
n = 0
for i in range(N):
	A = list(map(int, input().split()))
	s = 0 + C
	for (a, b) in zip(A, B):
		c = a * b
		s = s + c
	if s > 0:
		n = n + 1
print(n)


(N, M, C) = map(int, input().split())
b = [int(i) for i in input().split()]
A = [list(map(int, input().split())) for _ in range(N)]
print(len([a for a in A if sum([x * y for (x, y) in zip(a, b)]) + C > 0]))


(n, m, c) = map(int, input().split())
l = list(map(int, input().split()))
cnt = 0
for i in range(n):
	l2 = list(map(int, input().split()))
	s = 0
	for i in range(m):
		s += l[i] * l2[i]
	s += c
	if s > 0:
		cnt += 1
print(cnt)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
z = 0
for _ in range(n):
	a = list(map(int, input().split()))
	s = 0
	for j in range(m):
		s += b[j] * a[j]
	if s + c > 0:
		z += 1
print(z)


(n, m, c) = map(int, input().split())
B = list(map(int, input().split()))
g = 0
t = 0
for i in range(n):
	A = list(map(int, input().split()))
	for i in range(m):
		t += A[i] * B[i]
	if t + c > 0:
		g += 1
	t = 0
print(g)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for loop in range(n):
	a = list(map(int, input().split()))
	re = c
	for i in range(m):
		re += a[i] * b[i]
	if re > 0:
		ans += 1
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ac = 0
for _ in range(n):
	ans = c
	a = list(map(int, input().split()))
	for i in range(m):
		ans += a[i] * b[i]
	if ans > 0:
		ac += 1
print(ac)


(n, m, c) = map(int, input().split())
bl = list(map(int, input().split()))
res = 0
for i in range(n):
	al = list(map(int, input().split()))
	temp = c
	for j in range(m):
		temp += al[j] * bl[j]
	if temp > 0:
		res += 1
print(res)


from operator import mul

def p():
	return map(int, input().split())
(n, _, c) = p()
b = list(p())
u = 0
for _ in range(n):
	v = sum(map(mul, b, list(p()))) + c
	if v > 0:
		u += 1
print(u)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for n in range(N):
	A = list(map(int, input().split()))
	total = C
	for (i, j) in zip(B, A):
		total += i * j
	if total > 0:
		cnt += 1
print(cnt)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
sum_tmp = 0
for i in range(n):
	for j in range(m):
		sum_tmp += a[i][j] * b[j]
	else:
		if sum_tmp + c > 0:
			ans += 1
		sum_tmp = 0
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
P = 0
for i in range(N):
	X = 0
	A = list(map(int, input().split()))
	for i in range(M):
		X = X + A[i] * B[i]
	if X + C > 0:
		P = P + 1
print(P)


I = lambda : map(int, input().split())
(N, _, C) = I()
(*B,) = I()
print(sum((sum((a * b for (a, b) in zip(I(), B))) > -C for _ in range(N))))


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
ans = len([a for a in A if sum((x * y for (x, y) in zip(a, B))) + C > 0])
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for i in range(N):
	L = list(map(int, input().split()))
	s = [l * b for (l, b) in zip(L, B)]
	if sum(s) > -C:
		ans += 1
print(ans)


import numpy as np
(N, M, C) = map(int, input().split())
B = np.array(list(map(int, input().split())))
ans = 0
for _ in range(N):
	A = np.array(list(map(int, input().split())))
	if np.sum(A * B) + C > 0:
		ans += 1
print(ans)


I = lambda : map(int, input().split())
(n, m, c) = I()
b = list(I())
A = [list(I()) for _ in [0] * n]
e = 0
for a in A:
	d = 0
	for (i, j) in zip(b, a):
		d += i * j
	e += d + c > 0
print(e)


def input2():
	return map(int, input().split())

def input_array():
	return list(map(int, input().split()))
(n, m, c) = input2()
B = input_array()
A = [input_array() for _ in range(n)]
count = 0
for a in A:
	tmp = c
	for i in range(m):
		tmp += a[i] * B[i]
	if tmp > 0:
		count += 1
print(count)


(n, m, c) = map(int, input().split())
b = [int(x) for x in input().split()]
ans = 0
for i in range(n):
	a = [int(x) for x in input().split()]
	cnt = c
	for (aa, bb) in zip(a, b):
		cnt += aa * bb
	if cnt > 0:
		ans += 1
print(ans)


(n, m, c) = map(int, input().split())
lb = list(map(int, input().split()))
ans = 0
for i in range(n):
	la = list(map(int, input().split()))
	ans += sum((a * b for (a, b) in zip(la, lb))) + c > 0
print(ans)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
d = 0
for i in range(n):
	a = list(map(int, input().split()))
	e = []
	for j in range(m):
		e.append(a[j] * b[j])
	e.append(c)
	if sum(e) > 0:
		d += 1
print(d)


import numpy as np

def lcm(a, b):
	return a * b // math.gcd(a, b)
MOD = 10 ** 9 + 7
(n, m, c) = list(map(int, input().split()))
B = np.zeros(m)
A = np.zeros((n, m))
B = np.array(list(map(int, input().split())))
for i in range(n):
	A[i] = list(map(int, input().split()))
cnt = 0
for i in range(n):
	if np.dot(A[i], B) + c > 0:
		cnt += 1
print(cnt)


(n, m, c) = map(int, input().split())
B = list(map(int, input().split()))
x = 0
for i in range(n):
	A = list(map(int, input().split()))
	if sum((a * b for (a, b) in zip(A, B))) + c > 0:
		x += 1
print(x)


(n, m, c) = map(int, input().split())
d = 0
b = list(map(int, input().split()))
for _ in [0] * n:
	a = list(map(int, input().split()))
	d += 1 * (sum((x * y for (x, y) in zip(a, b))) + c > 0)
print(d)


(n, m, c) = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for i in range(n):
	a = list(map(int, input().split()))
	xx = 0
	for i in range(len(a)):
		xx += a[i] * b[i]
	xx += c
	if xx > 0:
		ans += 1
print(ans)


(N, M, C) = map(int, input().split())
B = list(map(int, input().split()))
c = 0
for i in range(N):
	A = list(map(int, input().split()))
	S = [A[j] * B[j] for j in range(M)]
	if sum(S) + C > 0:
		c += 1
print(c)


(N, M, C) = map(int, input().split())
B = [int(i) for i in input().split()]
ans = 0
for _ in range(N):
	A = [B[i] * int(j) for (i, j) in enumerate(input().split())]
	ans += 1 if sum(A) + C > 0 else 0
print(ans)