Harryxun/stf_run huggingface dataset:
c = int(input())
w = []
for i in range(c):
  w.append(input())
if len(set(w)) != len(w):
  print("No")
  return
for i in range(len(w) - 1):
  if w[i][-1] != w[i+1][0]:
    print("No")
    return
print("Yes")

### FIXED CODE ###

falsify = "Yes"
c = int(input())
w = []
for i in range(c):
  w.append(input())
if len(set(w)) != len(w):
  falsify = "No"
for i in range(len(w) - 1):
  if w[i][-1] != w[i+1][0]:
    falsify = "No"
print(falsify)
n=int(input())
sring=input()
cnt=0
for color in string:
  if color == "R":
    cnt += 1
  else:
    cnt += -1

if cnt > 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=int(input())
string=input()
cnt=0
for color in string:
  if color == "R":
    cnt += 1
  else:
    cnt += -1

if cnt > 0:
  print("Yes")
else:
  print("No")
n = int(input())
s, t = input().split()

merge = ''
for i in range(n):
  metge += s[i] + t[i]
  
print(merge)

### FIXED CODE ###

n = int(input())
s, t = input().split()

merge = ''
for i in range(n):
  merge += s[i] + t[i]
  
print(merge)
n,a,b=map(int,input().split())
z=n//(a+b)
x=n//z+(n%z)-(a+b)
print(a*z+x)


### FIXED CODE ###

n,a,b=map(int,input().split())
z=n//(a+b)
x=n-z*(a+b)
if x>=a:
    c=a
else:
    c=x
print(a*z+c)
if 1<= N < 1000:
    print('ABC')


elif 1000 <= N <= 1998:
    print('ABD')

### FIXED CODE ###

N=input()

if int(N) >= 1000:
    print('ABD')


else:
    print('ABC')
n,m=map(int,input().split())
hl=int(input().split())n,m=map(int,input().split())
hl=input().split()
shl=[int(x) for x in hl]
vl=set()
for y in range(n):
    vl.add(y)
print(vl)
for i in range(m):
    try:
        a,b=map(int,input().split())
        if shl[a-1]>shl[b-1]:
            vl.remove(b-1)
        elif shl[a-1]<shl[b-1]:
            vl.remove(a-1)
        else:
            vl.remove(a-1)
            vl.remove(b-1)
    except:
        continue
lshl=len(shl)
lvl=len(vl)
ans=lshl-lvl
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
hl=input().split()
shl=[int(x) for x in hl]
vl=set()
for i in range(m):
    a,b=map(int,input().split())
    if shl[a-1]>shl[b-1]:
        vl.add(b-1)
    elif shl[a-1]<shl[b-1]:
        vl.add(a-1)
    else:
        vl.add(a-1)
        vl.add(b-1)
lshl=len(shl)
lvl=len(vl)
ans=lshl-lvl
print(ans)
A = map(int, input())
if sum(A)<=21:
  print('win')
else:
  print('bust')

### FIXED CODE ###

A = map(int, input().split())
if sum(A)<=21:
  print('win')
else:
  print('bust')
print(x**3)

### FIXED CODE ###

import sys

d = int(sys.stdin.readline().rstrip())
print(d**3)
import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input)
for i in range(n):
  b = int(input())
  a[a = b] = 0

if np.sum(a[1,:]) = 0:
  print("Yes")
elif  np.sum(a[2,:]) = 0:
  print("Yes")
elif  np.sum(a[3,:]) = 0:
  print("Yes")
elif  np.sum(a[:,1]) = 0:
  print("Yes")
elif  np.sum(a[:,2]) = 0:
  print("Yes")
elif  np.sum(a[:,3]) = 0:
  print("Yes")
elif a[1,1] + a[2,2] + a[3,3] = 0:
  print("Yes")
elif a[3,1] + a[2,2] + a[1,3] = 0:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input())
for i in range(n):
  b = int(input())
  a = np.where(a == b, 0, a)

if a[0,0] + a[0,1] + a[0,2] == 0:
  print("Yes")
elif a[1,0] + a[1,1] + a[1,2] == 0:
  print("Yes")
elif a[2,0] + a[2,1] + a[2,2] == 0:
  print("Yes")
elif a[0,0] + a[1,0] + a[2,0] == 0:
  print("Yes")
elif a[0,1] + a[1,1] + a[2,1] == 0:
  print("Yes")
elif a[0,2] + a[1,2] + a[2,2] == 0:
  print("Yes")
elif a[0,0] + a[1,1] + a[2,2] == 0:
  print("Yes")
elif a[2,0] + a[1,1] + a[0,2] == 0:
  print("Yes")
else:
  print("No")
n,k=map(int,input().split())

X=list(map(int,input().split()))
V=[]
for i in range(n-k):
    Y=X[i+k-1]-X[i]   
    if X[i+k-1]<0:
        V.append(Y-X[i+k-1])
    elif X[i+k-1]>=0 and X[i]<0:
        V.append(Y+min(abs(X[i]),abs(X[i+k-1])))
    else:
        V.append(Y+X[i])
if X==[0]:
    print(0)
else:
    print(min(V))

### FIXED CODE ###

n,k=map(int,input().split())

X=list(map(int,input().split()))
V=[]
for i in range(n-k+1):
    Y=X[i+k-1]-X[i]   
    V.append(Y+min(abs(X[i]),abs(X[i+k-1])))

print(min(V))
def solve(n, k, p):
    E = [(1.0 + p_i)/2 for p_i in p]
    # pprint(E)
    
    ans = 0
    for i in range(n - k + 1):
        # print(i+3)
        ans = max(ans, sum([E[i+j] for j in range(k)]))
        # print(i, sum([E[i+j] for j in range(k)]))
    print(ans)

if __name__ == '__main__':
    n, k = map(int, sys.stdin.readline().strip().split(" "))
    p = list(map(int, sys.stdin.readline().strip().split(" ")))
    solve(n, k, p)

### FIXED CODE ###

import sys
from pprint import pprint

def solve(n, k, p):
    acum_E = [0]
    sum_E = 0
    for i, p_i in enumerate(p):
        sum_E += (1.0 + p_i)/2 
        acum_E.append(sum_E)
    # pprint(acum_E)
    
    ans = 0
    for i in range(n - k + 1):
        # print(i+k, i)
        ans = max(ans, acum_E[i + k] - acum_E[i])
    print(ans)

if __name__ == '__main__':
    n, k = map(int, sys.stdin.readline().strip().split(" "))
    p = list(map(int, sys.stdin.readline().strip().split(" ")))
    solve(n, k, p)
def solve(N, M, PYs):
    Ys = {i + 1: 1 for i in range(M)}
    ret = {}
    for p, y in sorted(PYs, key=lambda x: x[1]):
        ret[(p, y)] = "{:06d}{:06d}".format(p, Ys[p])
        Ys[p] += 1
    return [ret[(p, y)] for (p, y) in PYs]

if __name__ == "__main__":
    N, M = tuple(map(int, input().split(" ")))
    PYs = [tuple(map(int, input().split(" "))) for _ in range(M)]
    print("\n".join(solve(N, M, PYs)))


### FIXED CODE ###

def solve(N, M, PYs):
    Ys = {i + 1: 1 for i in range(N)}
    ret = {}
    for p, y in sorted(PYs, key=lambda x: x[1]):
        ret[(p, y)] = "{:06d}{:06d}".format(p, Ys[p])
        Ys[p] += 1
    return [ret[(p, y)] for (p, y) in PYs]

if __name__ == "__main__":
    N, M = tuple(map(int, input().split(" ")))
    PYs = [tuple(map(int, input().split(" "))) for _ in range(M)]
    print("\n".join(solve(N, M, PYs)))
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
l=[]
for i in range(n):
  x,y,h=nii()
  l.append([x,y,h])
  if h!=0:
    ini_x=x
    ini_y=y
    ini_h=h

ans_x=[]
ans_y=[]
ans_h=[]

for tx in range(101):
  for ty in range(101):
    n_h=abs(tx-ini_x)+abs(ty-ini_y)+ini_h
    for x,y,h in l:
      t_h=max(abs(tx-x)+abs(ty-y)+h,0)
      if n_h!=t_h:
        break
    else:
      ans_x.append(tx)
      ans_y.append(ty)
      if [tx,ty,0] in l:
        ans_h.append(0)
      else:
        ans_h.append(t_h)

inx=ans_h.index(max(ans_h))
print(ans_x[inx],ans_y[inx],ans_h[inx])

### FIXED CODE ###

from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
l=[]
for i in range(n):
  x,y,h=nii()
  l.append([x,y,h])
  if h!=0:
    ini_x=x
    ini_y=y
    ini_h=h

for tx in range(101):
  for ty in range(101):
    n_h=abs(tx-ini_x)+abs(ty-ini_y)+ini_h
    for x,y,h in l:
      t_h=max(n_h-(abs(tx-x)+abs(ty-y)),0)
      if h!=t_h:
        break
    else:
      print(tx,ty,n_h)
      exit()
MOD = 10**9 + 7

n, k = map(int, input().split())
e = [[] for i  in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    e[a].append(b)
    e[b].append(a)

visited = [False for i in range(n)]
def dfs(v, npv, nppv):
    global visited
    ans = max(k - npv - nppv, 0)
    visited[v] = True
    i = 0
    for nv in e[v]:
        if visited[nv]:
            continue

        ans *= dfs(nv, 1, npv+i)
        ans = ans % MOD
        i += 1

    return ans

for i in range(n):
    if len(e[i]) == 1:
        # print(i)
        s = i
        break

print(dfs(s, 0, 0))

# print(e)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7 + 10)

MOD = 10**9 + 7

n, k = map(int, input().split())
e = [[] for i  in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    e[a].append(b)
    e[b].append(a)

if n == 1:
    print(k)
else:
    visited = [False for i in range(n)]
    def dfs(v, npv, nppv):
        global visited
        ans = max(k - npv - nppv, 0)
        visited[v] = True
        i = 0
        for nv in e[v]:
            if visited[nv]:
                continue

            ans *= dfs(nv, 1, npv+i)
            ans = ans % MOD
            i += 1

        return ans

    for i in range(n):
        if len(e[i]) == 1:
            # print(i)
            s = i
            break

    print(dfs(s, 0, 0))

    # print(e)
import numpy as np

n = input()

for i in range(n):
    a = int(np.sqrt(n - i))
    b = n - i
    if a**2 == b:
        print(b)
        break
    else:
        pass


### FIXED CODE ###

import numpy

n = int(input())

for i in range(n):
    a = int(numpy.sqrt(n - i))
    b = n - i
    if a**2 == b:
        print(b)
        break
    else:
        pass
n,a,b,k=map(int,input().split())
p=998244353
def getinv(n):
  inv=[0]*(n+1)
  inv[1]=1
  for i in range(2,n+1):
    inv[i]=(-(p//i)*inv[p%i])%p
  return inv
def getnCr(n):
  inv=getinv(n)
  nCr=[0]*(n+1)
  nCr[0]=1
  for i in range(1,n+1):
    nCr[i]=(nCr[i-1]*(n-i+1)*inv[i])%p
  return nCr
def solve(n,a,b,k):
  ans=0
  nCr=getnCr(n)
  for i in range(n+1):
    if (k-a*i)<0 or (k-a*i)%b!=0:
      continue
    j=(k-a*i)//b
    if a*i+b*j==k:
      ans+= nCr[i]*nCr[j]
      ans%=p
  return ans
print(solve(n,a,b,k))

### FIXED CODE ###

n,a,b,k=map(int,input().split())
p=998244353
def getinv(n):
  inv=[0]*(n+1)
  inv[1]=1
  for i in range(2,n+1):
    inv[i]=(-(p//i)*inv[p%i])%p
  return inv
def getnCr(n):
  inv=getinv(n)
  nCr=[0]*(n+1)
  nCr[0]=1
  for i in range(1,n+1):
    nCr[i]=(nCr[i-1]*(n-i+1)*inv[i])%p
  return nCr
def solve(n,a,b,k):
  ans=0
  nCr=getnCr(n)
  for i in range(n+1):
    if (k-a*i)<0 or (k-a*i)%b!=0:
      continue
    j=(k-a*i)//b
    if a*i+b*j==k and 0<=j<=n:
      ans+= nCr[i]*nCr[j]
      ans%=p
  return ans
print(solve(n,a,b,k))
N, M, Q = map(int, input().split())
max_n = 0


A_list = []
N=2
for i in range(10**(N-1),10**N):
    #A = [int(x) for x in list(str(i))]
    #A_replace = [int(str(a).replace('0', '10')) for a in A]
    #if A_replace == sorted(A_replace):
    A_list.append(sorted(i))
abcd_list = []
for q in range(Q):
    abcd_list.append(list(map(int, input().split())))

for A in A_list:
    tokuten = 0
    for q in range(Q):
        if (A[abcd_list[q][1]-1] - A[abcd_list[q][0]-1] == abcd_list[q][2]):
            tokuten += abcd_list[q][3]

    if tokuten > max_n:
        max_n = tokuten

print(max_n)

### FIXED CODE ###

import itertools
N, M, Q = map(int, input().split())
vec = [list(map(int, input().split())) for i in range(Q)]
A = itertools.combinations_with_replacement(range(1,M+1), N)
ans = 0

for a in A:
    tmp = 0
    for v in vec:
        if (a[v[1]-1] - a[v[0]-1]) == v[2]:
            tmp += v[3]
    if ans < tmp:
        ans = tmp
        
print(ans)
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = a%10
B = b%10
C = c%10
D = d%10
E = e%10
list =[a,b,c,d,e]
ans = 0
for i in range(5):
  if l[i] % 10 != 0:
    mini = min(9,l[i])
print(a+b+c+d+e+A+B+C+D+E-mini)

### FIXED CODE ###

A = 0
B = []
B.append(0)
for i in range(5):
  I = int(input())
  A += I
  T = I % 10
  if T != 0:
    B.append(10 - T)
print(A + sum(B) - max(B))
def gcd(X,Y):
  if X < Y:
    tmp = X
    X = Y
    Y = tmp
  if Y == 0:
    return 0
  while X % Y != 0:
    r = X % Y
    X = Y
    Y = r
  return Y
T = int(raw_input())
Q = [map(int, raw_input().split()) for _ in range(T)]
for q in Q:
  A,B,C,D = q
  if B > A:
    print 'No'
  elif B > D:
    print 'No'
  elif B <= C:
    print 'Yes'
  else:
    A = A%B
    D = D%B
    g = gcd(B,D)
    maximum = B-g+A%g
    if maximum > C:
      print 'No'
    else:
      print 'Yes'
     


### FIXED CODE ###

def gcd(X,Y):
  if X < Y:
    tmp = X
    X = Y
    Y = tmp
  if Y == 0:
    return 0
  while X % Y != 0:
    r = X % Y
    X = Y
    Y = r
  return Y
T = int(raw_input())
Q = [map(int, raw_input().split()) for _ in range(T)]
for q in Q:
  A,B,C,D = q
  if B > A:
    print 'No'
  elif B > D:
    print 'No'
  elif B <= C:
    print 'Yes'
  else:
    A = A%B
    D = D%B
    g = gcd(B,D)
    maximum = A if g == 0 else B-g+A%g
    if maximum > C:
      print 'No'
    else:
      print 'Yes'
w = int(input())
n = int(input())
nums = [1, 2, 3, 4, 5]
ab = []
for i in range(n):
    a, b = map(int, input().split(','))
    nums[a-1], nums[b-1] = nums[b-1], nums[a-1]
for i in nums:
    print(i)


### FIXED CODE ###

w = int(input())
n = int(input())
nums = [i for i in range(1, w+1)]
ab = []
for i in range(n):
    a, b = map(int, input().split(','))
    nums[a-1], nums[b-1] = nums[b-1], nums[a-1]
for i in nums:
    print(i)
n = int(input())
h = [int(n) for n in input().split()]

a = 0
b = 1
ans = 1

for i in range(n.length-2):
    if n[a]<n[b]:
        ans += 1
    a += 1
    b += 1
print(ans)

### FIXED CODE ###

n = int(input())
h = [int(n) for n in input().split()]

max = h[0]
ans = 0

for i in h:
    if max<=i:
        ans += 1
        max = i
print(ans)
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append((a-1,b-1))
if n==2:
    print(0)
    exit()


def f(x,y,c):
    c += 1
    for e in edge[x]:
        if e == y:
            continue
        if c > d:
            used[e] = 1
        f(e,x,c)



if k % 2 == 0:
    print(0)
    exit()
    d = k//2
    res = []
    for i in range(n):
        used = [0]*n
        f(i,-1,0)
        res.append(sum(used))
    print(min(res))
else:
    d = (k-1)//2
    res = []
    for e1 in alledge:
        used = [0]*n
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        res.append(sum(used))
    print(min(res))


### FIXED CODE ###

import sys
#input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append((a-1,b-1))

def f(x,y,c):
    global tmp
    c += 1
    for e in edge[x]:
        if e == y:
            continue
        if c > d:
            tmp +=1
        f(e,x,c)

sys.setrecursionlimit(4100000)

if k % 2 == 0:
    d = k//2
    ass = 2001
    for i in range(n):
        tmp = 0
        f(i,-1,0)
        ass = min(ass,tmp)
    print(ass)
else:
    d = (k-1)//2
    ass = 2001
    for e1 in alledge:
        tmp = 0
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        ass = min(ass,tmp)
    print(ass)
X,Y,Z,K = map(int, input().split())
a_list = [int(i) for i in input().split()]
b_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]
a_list.sort(reverse = True)
b_list.sort(reverse = True)
c_list.sort(reverse = True)
total_list = [0 for _ in range(min(106307,X*Y*Z))]
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if (i+1)*(j+1)*(k+1) <= K:
                total_list[i*(Z*Y)+j*Z+k] = (a_list[i] + b_list[j] + c_list[k])
            else:
                break
total_list =  sorted(total_list, reverse = True)
for i in range(K):
    print(total_list[i])

### FIXED CODE ###

N,A,B,C,D,E = [int(input()) for _ in range(6)]
times = [A,B,C,D,E]
for i in range(4):
    if times[i] < times[i+1]:
        times[i+1] = times[i]
A,B,C,D,E = times
l = -(-N//A)
m = -(-(N - (l-1)*B)//B)
n = -(-(N - (l+m-2)*C)//C)
p = -(-(N - (l+m+n-3)*D)//D)
q = -(-(N - (l+m+n+p-4)*E)//E)
print(l+m+n+p+q)
N = int(input())
d = {}
if N % 2 == 0:
    for i in range(N//2):
        d[2*i+1] = 0
else:
    for i in range(N//2+1):
        d[2*i] = 0
A = list(map(int,input().split()))
x = 1
for i in range(N):
    if d[A[i]] >= 2:
        x = 0
        break
    else:
        d[A[i]] += 1
y = 1
if N % 2 == 1:
    if d[0] != 1:
        y = 0
ans = (2**(N//2))*x*y
print(ans)

### FIXED CODE ###

N = int(input())
d = {}
if N % 2 == 0:
    for i in range(N//2):
        d[2*i+1] = 0
else:
    for i in range(N//2+1):
        d[2*i] = 0
A = list(map(int,input().split()))
x = 1
for i in range(N):
    if A[i] in d:
        if d[A[i]] >= 2:
            x = 0
            break
        else:
            d[A[i]] += 1
    else:
        x = 0
        break
y = 1
if N % 2 == 1:
    if d[0] != 1:
        y = 0
e = 10**9 + 7
ans = (2**(N//2))*x*y%e
print(ans)
import sys
n = int(input())
a = list(map(int,input().split()))

seta = set(a)
ans = 0
if 1 not in seta:
  print(-1)
  sys.exit()
for i in range(1,n+1):
  if i in seta:
    idx = a.index(i)
  else:
    ans += len(a) 
    break 
  ans += idx
  a = a[idx+1:]
  
print(ans)


### FIXED CODE ###

import sys
n = int(input())
a = list(map(int,input().split()))

ans = 0
if 1 not in a:
  print(-1)
  sys.exit()
  
index = 1
for i in a:
  if i != index:
    ans+=1
  else:
    index+=1
    
print(ans)
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    a = kwargs["a"]
    b = kwargs["b"]
    n = kwargs["n"]

    R = [0 for i in range(b)]

    for i in range(min(b, n) + 1):
        R[i] = a * i // b - a * (i // b)

    res = max(R)
    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    #kwargs["n"] = cin[0]
    #kwargs["n"], kwargs["k"] = cin
    #kwargs["n"] = [int(i) for i in cin][0]
    kwargs["a"], kwargs["b"], kwargs["n"] = [int(i) for i in cin]

    cout = main(kwargs)
    print(cout)

### FIXED CODE ###

import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    a = kwargs["a"]
    b = kwargs["b"]
    n = kwargs["n"]

    for i in range(min(b, n), -1, -1):
        res = a * i // b - a * (i // b)

        if res > 0:
            break

    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    #kwargs["n"] = cin[0]
    #kwargs["n"], kwargs["k"] = cin
    #kwargs["n"] = [int(i) for i in cin][0]
    kwargs["a"], kwargs["b"], kwargs["n"] = [int(i) for i in cin]

    cout = main(kwargs)
    print(cout)
A, B, C, X, Y = map(int, input().split())
if A + B < 2 * C:
    ans = A * X + B * Y
elif A + B >= 2 * C:
    nokori = abs(X - Y)
    if X >= Y and A >= 2 * C:
        ans = C * 2 * X
    if Y >= X and B >= 2 * C:
        ans = C * 2 * Y
    if X > Y and A < 2 * C:
        ans = C * 2 * Y + nokori * A
    if Y > X and B < 2 * C:
        ans = C * 2 * X + nokori * B
print(ans)


### FIXED CODE ###

A, B, C, X, Y = map(int, input().split())
    

if X >= Y:
    ans = min(A*X + B*Y, 2*C*Y + A*(X-Y), 2*C*X)
else:
    ans = min(A*X + B*Y, 2*C*X + B*(Y-X), 2*C*Y)

print(ans)
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
for i in range(n):
    total = c
    for j in range(m):
        total += a[i][j] * b[j]
    if total > 0:
        ans += 1
print(ans)

### FIXED CODE ###

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
for i in range(n):
    total = c
    for j in range(m):
        total += A[i][j] * B[j]
    if total > 0:
        ans += 1
print(ans)
s = input()
if s == 'AAA':
	print('Yes')
if s == 'BBB'
	print('Yes')
else:
	print('No')
    


### FIXED CODE ###

s = input()

if s == 'AAA':
	print('No')
elif s == 'BBB':
	print('No')
else:
	print('Yes')
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
if max(a) < k:
    print("IMPOSSIBLE")
    exit()
m = 10**9
for i in range(n-1):
    m = min(m, abs(a[i+1]-a[0]))
for i in range(n):
    if abs((a[i]-k)) % m == 0:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")


### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))

a = sorted(list(set(a)))

if a[-1] < k:
    print("IMPOSSIBLE")
    exit()

n = len(a)

if n > 1:
    m = 10**9
    for i in range(n-1):
        if a[i] != a[i+1]:
            m = min(m, abs(a[i+1]-a[i]))
    for i in range(n):
        if abs(a[i]-k) % m == 0:
            print("POSSIBLE")
            exit()
else:
    if a[0] == k:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")
# -*- coding: utf-8 -*-
X=0
y=0
z=0
a=0

if 'o' == 'S'[:1] :
   x = 1
    
if 'o' == 'S'[1:2] :
   y = 1
 
if 'o' == 'S'[2:] :
   z = 1
 
a = (7+x+y+z)*100 
 
print(a)

### FIXED CODE ###

# -*- coding: utf-8 -*-
s = input()
a = s.count('o')
y = 700 + 100 * a
print(y)
import numpy as np

N = int(input())
V = input().split()
V = np.array(V).astype(int)
V = np.sort(V)

U = np.array([])

for _ in range(2):
    U = np.append(U, 0.5**(N-1))
    
for i in range(2, N):
    U = np.append(U, 0.5**(N-i))

print(V @ U)


### FIXED CODE ###

import numpy as np

N = int(input())
V = input().split()
V = np.array(V).astype(int)
V = np.sort(V)

U = np.array([])

for _ in range(2):
    U = np.append(U, 0.5**(N-1))
    
for i in range(2, N):
    U = np.append(U, 0.5**(N-i))

print(np.dot(U, V))
from collections import deque
a=int(input())
list=deque([])

for i in range(a):
    order=input().split()
    if order[0]=="insert":
        list.appendleft(order[1])
    elif order[0]=="delete":
        if order[1] in list:
            list.remove(order[1])
    elif order[0]=="deleteFirst":
        list.popleft()
    elif order[0]=="deleteLast":
        list.pop()

print(*list)


### FIXED CODE ###

from collections import deque
a=int(input())
list=deque([])

for i in range(a):
    order=input().split()
    if order[0]=="insert":
        list.appendleft(order[1])
    elif order[0]=="delete":
        if order[1] in list:
            list.remove(order[1])
    elif order[0]=="deleteFirst":
        list.popleft()
    elif order[0]=="deleteLast":
        list.pop()

print(*list)
factorial = [0] * 2000
factorial[0] = 1
factorial[1] = 1
for i in range(2, 2000):
    factorial[i] = i * factorial[i - 1]


def combination(n, r):
    return factorial[n] / (factorial[r] * factorial[n - r])


n, k = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(k):
    x = int(combination(n - k + 1, n - k - i) % MOD)
    y = int(combination(k - 1, i) % MOD)
    print(x * y % MOD)

### FIXED CODE ###

n, k = map(int, input().split())
MOD = 10 ** 9 + 7

inv = [0] * 2000
inv[1] = 1
for i in range(2, 2000):
    inv[i] = (MOD - (MOD // i) * inv[MOD % i] % MOD) % MOD

fact = [0] * 2000
finv = [0] * 2000
fact[0] = 1
finv[0] = 1
for i in range(1, 2000):
    fact[i] = (i * fact[i - 1]) % MOD
    finv[i] = (inv[i] * finv[i - 1]) % MOD


def modcomb(n, r):
    if n < r or r < 0:
        return 0
    return fact[n] * finv[r] % MOD * finv[n - r] % MOD


for i in range(k):
    x = modcomb(n - k + 1, i + 1)
    y = modcomb(k - 1, i)
    print(x * y % MOD)
number = int(input())
return number**2

### FIXED CODE ###

def calc_r(r):
  return r*r

r = int(input())
result = calc_r(r)
print(result)
n=int(input())

a=[]
for i in range(n):
    a.append(int(input()))

cnt=0
ans=-1
x=1

for i in range(n):
    x=a[x-1]
    cnt+=1
    if x==2:
        ans=cnt
        break

print(ans)

### FIXED CODE ###

x,a,b=map(int,input().split())

if x+1<=(b-a):
    print("dangerous")

elif a>=b:
    print("delicious")

elif (b-a)<=x:
    print("safe")
x1, y1, x2, y2 = map(int, input().split())
print((pow(x1 - x2, 2) + pow(y1 - y2, 2)) ** 0.5)

### FIXED CODE ###

x1, y1, x2, y2 = map(float, input().split())
print(((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5)
K, N = map(int, input().split())
L = list(map(int, input().split()))
sa = [L[i+1]-L[i] for i in range(N-1)]
sa += K-L[N-1]+L[0]
ans = K-max(sa)
print(ans)

### FIXED CODE ###

K, N = list(map(int, input().split()))
L = list(map(int, input().split()))
sa = [L[i+1]-L[i] for i in range(N-1)]
sa += [K-L[N-1]+L[0]]
ans = K-max(sa)
print(ans)
r = map(int,input())
print(3*r**2)

### FIXED CODE ###

r = int(input())
print(3*(r**2))