Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split())
print(n,m)
pos = []
che = []
for i in range(n):
    a,b=map(int,input().split())
    pos.append([a,b])
for i in range(m):
    a,b=map(int,input().split())
    che.append([a,b])

for i in range(n):
    dis = []
    for j in range(m):
        dis.append(abs(pos[i][0]-che[i][0])+abs(pos[i][1]-che[i][1]))
    print(dis.index(min(dis))+1)

### FIXED CODE ###

n, m = map(int, input().split())
pos = []
che = []
for i in range(n):
    a, b = map(int,input().split())
    pos.append([a,b])
for i in range(m):
    a, b = map(int,input().split())
    che.append([a,b])
 
for i in range(n):
    dis = []
    for j in range(m):
        dis.append(abs(pos[i][0]-che[j][0])+abs(pos[i][1]-che[j][1]))
    print(dis.index(min(dis))+1)
def main():
    import sys
    import math
    input = sys.stdin.readline
 
    l, r = [int(i) for i in input().split()]
    
    minmod = math.inf

    for i in range(l, r):
        for j in range(i+1, r+1):
            temp = (i*j)%2019
            if(temp < minmod):
                minmod = temp
 
            #print("i = {}, j = {}, temp = {}, minmod = {}".format(i, j, temp, minmod))
 
    print(minmod)
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline
 
    l, r = [int(i) for i in input().split()]
 
    if(r - l) >= 2019:
        print(0)
        exit()
    
    minmod = float('inf')
 
    for i in range(l, r):
        for j in range(i+1, r+1):
            temp = (i*j)%2019
            if(temp < minmod):
                minmod = temp
 
            #print("i = {}, j = {}, temp = {}, minmod = {}".format(i, j, temp, minmod))
 
    print(minmod)
 
if __name__ == '__main__':
    main()
import copy

N,M = map(int, input().split())
jisho = [[] for i in range(N)]
for i in range(M):
    val = input().split()
    for j in val[1:]:
        jisho[int(j)-1].append(i)

p = list(map(int, input().split()))

sw = []
def create_ki(data):
    if len(data) == N:
        sw.append(data)
        return
    tmp = copy.copy(data)
    tmp.append(0)
    create_ki(tmp)
    tmp2 = copy.copy(data)
    tmp2.append(1)
    create_ki(tmp2)

create_ki([])

ans = 0
for val in sw:
    num = 0
    sw2 = [0]*M
    for i in val:
        if i == 0:
            num += 1
            continue
        data = jisho[num]
        for j in data:
            sw2[j] += 1
        num += 1
    cn = 0
    for j in sw2:
        if j % 2 == p[cn]:
            break
        cn += 1
    if cn == M:
        ans += 1

print(ans)
mac:128 ry

### FIXED CODE ###

import copy

N,M = map(int, input().split())
jisho = [[] for i in range(N)]
for i in range(M):
    val = input().split()
    for j in val[1:]:
        jisho[int(j)-1].append(i)

p = list(map(int, input().split()))

sw = []
def create_ki(data):
    if len(data) == N:
        sw.append(data)
        return
    tmp = copy.copy(data)
    tmp.append(0)
    create_ki(tmp)
    tmp2 = copy.copy(data)
    tmp2.append(1)
    create_ki(tmp2)

create_ki([])

ans = 0
for val in sw:
    num = 0
    sw2 = [0]*M
    for i in val:
        if i == 0:
            num += 1
            continue
        data = jisho[num]
        for j in data:
            sw2[j] += 1
        num += 1
    cn = 0
    for j in sw2:
        if j % 2 != p[cn]:
            break
        cn += 1
    if cn == M:
        ans += 1

print(ans)
import math

def nCr(n,r):
    f = math.factorial
    return int(f(n) / f(r) / f(n-r))

def nHk(n, k):
    f = math.factorial
    return int(f(n + k - 1) // f(k) // f(n - 1))

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
    if i > N - K + 1:
        ans = 0
    else:
        ans = nCr(K - 1, i - 1) * nCr(N - K + 1, i) % MOD
    print(ans)


### FIXED CODE ###

from operator import mul
from functools import reduce

def nCr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
    if i > N - K + 1:
        ans = 0
    else:
        ans = nCr(K - 1, i - 1) * nCr(N - K + 1, i) % MOD
    print(ans)
n,m = map(int,input().split())
a_b = {}
for i in range(n):
    x,y = map(int,input().split())
    if x in a_b.keys():
        a_b[x] += y
        continue
    a_b[x] = y
a_b = sorted(a_b.items(), key=lambda x:x[0])

#print(a_b)
c = 0
ans = 0
t = 0
for i in range(n):
    c += a_b[i][1]
    if c > m:
        ans += a_b[i][0] * (m - t)
        break
    else:
        ans += a_b[i][0] * a_b[i][1]
        t += a_b[i][1]

print(ans)


### FIXED CODE ###

n,m = map(int,input().split())
a_b = {}
for i in range(n):
    x,y = map(int,input().split())
    if x in a_b.keys():
        a_b[x] += y
        continue
    a_b[x] = y
a_b = sorted(a_b.items(), key=lambda x:x[0])

#print(a_b)
c = 0
ans = 0
t = 0
for i in range(int(len(a_b))):
    c += a_b[i][1]
    if c > m:
        ans += a_b[i][0] * (m - t)
        break
    else:
        ans += a_b[i][0] * a_b[i][1]
        t += a_b[i][1]

print(ans)
for _ in[0]*int(input()):
 a,b,c,d,e,f=map(float,input().split())
 s,t,u=a*a+b*b,c*c+d*d,e*e+f*f
 x=(s*(d-f)+t*(f-b)+u*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d))
 y=(s*(c-e)+t*(e-a)+u*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c))
 print(f'{x:.3f} {y:.3f} {((x-a)**2+(y-b)**2)**.5.3f}')


### FIXED CODE ###

for _ in[0]*int(input()):
 a,b,c,d,e,f=map(float,input().split())
 s,t,u=a*a+b*b,c*c+d*d,e*e+f*f
 x=(s*(d-f)+t*(f-b)+u*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d))
 y=(s*(c-e)+t*(e-a)+u*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c))
 print(f'{x:.3f} {y:.3f} {((x-a)**2+(y-b)**2)**.5:.3f}')
N, M = map(int, input().split())

A = []
for i in range(N):
    tmp = input()
    A.append([0 if s=="." else 1 for s in tmp])
B = []
for i in range(M):
    tmp = input()
    B.append([0 if s=="." else 1 for s in tmp])
    
A = np.array(A)
B = np.array(B)

def is_match(a, b):
    return (a==b).all()
flag = False
for i in range(N):
    for j in range(N):
        x_left = i
        x_right = i + M
        y_up = j
        y_under = j + M
        if x_right >= N or y_under >= N:
            continue
        if is_match(B, A[x_left:x_right, y_up:y_under]):
            flag = True
if flag:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import numpy as np
N, M = map(int, input().split())

A = []
for i in range(N):
    tmp = input()
    A.append([0 if s=="." else 1 for s in tmp])
B = []
for i in range(M):
    tmp = input()
    B.append([0 if s=="." else 1 for s in tmp])
    
A = np.array(A)
B = np.array(B)

def is_match(a, b):
    return (a==b).all()
flag = False
for i in range(N):
    for j in range(N):
        x_left = i
        x_right = i + M
        y_up = j
        y_under = j + M
        if x_right > N or y_under > N:
            continue
        if is_match(B, A[x_left:x_right, y_up:y_under]):
            flag = True
if flag:
    print("Yes")
else:
    print("No")
def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor, gcd
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**9+10

    N=II()
    S=input()
    p = 0
    num_right_p = 0
    ans = ''
    r = 0
    for s in S:
        if s == '(':
            p += 1
        else:
            if p > 0:
                p -= 1
            else:
                r += 1

    
        ans = '(' * r + S + ')' * p
    print(ans)
            
    

    
main()

### FIXED CODE ###

def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**9+10

    N=II()
    S=input()
    p = 0
    num_right_p = 0
    ans = ''
    r = 0
    for s in S:
        if s == '(':
            p += 1
        else:
            if p > 0:
                p -= 1
            else:
                r += 1

    
        ans = '(' * r + S + ')' * p
    print(ans)
            
    

    
main()
n,k=map(int,input().split())
a=list(map(int, input().split()))
f=list(map(int, input().split()))
a.sort()
f.sort(reverse=True)

maxaf=a[0]*f[0]
for i in range(n):
	if a[i]*f[i]>maxaf:
		maxaf=a[i]*f[i]

def solve(x):
	total=0
	for i in range(n):
		total+=max(0,a[i]-x//f[i]) //負になりうる懸念ができていなかった、とほほ
	return total<=k

#xの範囲 ngは実現が難しい方
ok=maxaf
ng=-1

while ok-ng>1:
	mid=(ok+ng)//2
	if solve(mid):
		ok=mid
	else:
		ng=mid
print(ok)

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int, input().split()))
f=list(map(int, input().split()))
a.sort()
f.sort(reverse=True)

maxaf=a[0]*f[0]
for i in range(n):
	if a[i]*f[i]>maxaf:
		maxaf=a[i]*f[i]

def solve(x):
	total=0
	for i in range(n):
		total+=max(0,a[i]-x//f[i]) #負になりうる懸念ができていなかった、とほほ
	return total<=k

#xの範囲 ngは実現が難しい方
ok=maxaf
ng=-1

while ok-ng>1:
	mid=(ok+ng)//2
	if solve(mid):
		ok=mid
	else:
		ng=mid
print(ok)
def dfs_v(u):
  color[u] = 1
  d[u] = ++t
  for v in range(n):
    if M[u][v] == 0 and color[v] == 0:
      dfs_v(v)
  color[u] = 2
  f[u] = ++t

def dfs():
  color[0 for i in range(n)]
  t = 0
  for u in range(n):
    dfs_v(u)
  for u in range(n):
    print "%d %d %d" %(u+1, d[u], f[u])

n = input()

M[0 for i in range(n)]0 for j in range(n)]

for i in range(n):
  u, k = map(int, raw_input().split())
  for j in range(k):
   v = input()
   M[u-1][v-1] = 1

dfs()
    

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
from collections import Counter as co
D=co(A)

cnt=0
for i in range(N):
  if D[A[-1-i]]>0:
    D[A[-1-i]]-=1
    for j in range(1,16):
      d=2**j
      if A[-1-i]<d:
        e=d-A[-1-i]
        break
    if e in D:
      if D[e]>0:
        cnt+=1
        D[e]-=1
print(cnt)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
from collections import Counter as co
D=co(A)

cnt=0
for i in range(N):
  if D[A[-1-i]]>0:
    D[A[-1-i]]-=1
    d=A[-1-i]
    f=len(bin(d))-2
    e=2**f-d
    if D[e]>0:
      cnt+=1
      D[e]-=1
print(cnt)
s = list(map(input().split()))
a = list(map(int,input().split()))
u = input()


if s[0] == u:
  a[0] -= 1
else:
  a[1] -= 1

print(str(a[0]) + " " + str(a[1]))

### FIXED CODE ###

s = input().split()
a = list(map(int,input().split()))
u = input()


if s[0] == u:
  a[0] -= 1
else:
  a[1] -= 1

print(str(a[0]) + " " + str(a[1]))
S=input()
T=input()
import re

def x():
    for i in range(len(T),0,-1): # 文字列の長さ
        for j in range(len(T)-i): # T検索の開始位置=その前にある文字数
            t=T[j:i+j]
            for m in re.finditer(t, S):
                p=m.start()
                if p!=-1:
                    if j<=p and len(T)-j-1 <=len(S)-p-1:
                        return i
    return 0
print(len(T)-t)

### FIXED CODE ###

S=input()
T=input()
ls=len(S)
lt=len(T)

ans=float('inf')
for i in range(0,ls-lt+1):
    ans=min(ans, sum([l!=m for l,m in zip(S[i:i+lt], T)]))
print(ans)
#################################
##ワーシャルフロイド法 n~3
#################################
def warshall_floyd(n,d):
    #d[i][j]: iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d
##############################
from scipy.sparse.csgraph import csgraph_from_dense,dijkstra,floyd_warshall
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')
ans = int(0)
N,M,L =LI()
s = []
t = []
dp = [[inf] * (N) for _ in range(N)]
for i in range(M):
    a, b, c = map(int, input().split())
    dp[a-1][b-1] = c
    dp[b-1][a-1] = c
Q = I()
for i in range(Q):
    a,b = LI()
    s.append(a-1)
    t.append(b-1)

for i in range(N):
    dp[i][i] = 0

#print(warshall_floyd(N,dp))
#d1 = [[0] * (N) for _ in range(N)]
#d1 = warshall_floyd(N,dp)
G = csgraph_from_dense(dp, null_value=10**9)
d1 = floyd_warshall(G)

newdp = [[inf] * (N) for _ in range(N)]
for i in range(N):
    for j in range(i+1,N):
        if d1[i][j]<=L:
            newdp[i][j] = 1
            newdp[j][i] = 1

for i in range(N):
    newdp[i][i] = 0
#print(newdp)
#print(warshall_floyd(N,newdp))
#d2 = [[0] * (N) for _ in range(N)]
#d2 = warshall_floyd(N,newdp)
G = csgraph_from_dense(newdp, null_value=10**9)
d2 = floyd_warshall(G)

for i in range(Q):
    ans = d2[s[i]][t[i]]-1
    if ans!= inf:
        print(int(ans))
    else:
        print("-1")

### FIXED CODE ###

import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')
A,B = LI()
ans = int(0)

ans = max(A-2*B,0)


print(ans)
def resolve():
    N, M, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    def dfs(n, i, j, k):
        if k >= K or (i == N and j == M):
            return n
        if i < N and A[i] < B[j] and k + A[i] <= K:
            k += A[i]
            l = dfs(n + 1, i + 1, j, k)
        elif j < M and k + B[j] <= K:
            k += B[j]
            l = dfs(n + 1, i, j + 1, k)
        else:
            return n

        return l

    print(dfs(0, 0, 0, 0))

resolve()

### FIXED CODE ###

def resolve():
    import numpy as np

    N, M, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    A = np.insert(np.cumsum(A), 0, 0)
    B = np.insert(np.cumsum(B), 0, 0)

    ans = 0
    j = M
    for i in range(N + 1):
        if A[i] > K:
            break
        while A[i] + B[j] > K:
            j -= 1

        ans = max(ans, i + j)

    print(ans)

resolve()
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[s-1]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')


### FIXED CODE ###

import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[-1]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')
s=input()
if s=="1":
    print("Hello World")
else:
    a,b=map(int,input().split())
    print(a+b)


### FIXED CODE ###

s=input()
if s=="1":
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
import math
import collections

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

gcd = math.gcd(a, b)


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


c = collections.Counter(prime_factorize(gcd))
print(len(c.keys()) + 1 )






### FIXED CODE ###

from fractions import gcd
import collections

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

gcd = gcd(a, b)


def prime_factorize(n):
    a = list()
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


c = collections.Counter(prime_factorize(gcd))
print(len(c.keys()) + 1)
# -*- coding: utf-8 -*-

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

if (a % 2 == 0) | (b % 2 == 0) :
    print("Even)
else:
    print("Odd")

### FIXED CODE ###

# -*- coding: utf-8 -*-

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

if (a % 2 == 0) | (b % 2 == 0) :
    print("Even")
else:
    print("Odd")
r,g,b = input().split()
if int((g*10+b)%4==0):
    print('YES')
else:
    print('No')
    


### FIXED CODE ###

r,g,b=map(int,input().split())
X = r * 100 + g * 10 + b
if X % 4 == 0:
    print('YES')
else:
    print('NO')
import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def C(a,b): return a>b or abs(a-b)<1e-6
def f(e1):
  tx,ty,sx,sy=e1
  x=[]
  for e2 in WP:
    wx,wy,r=e2
    wt=[tx-wx,ty-wy]; rwt=R(wt)
    sw=[wx-sx,wy-sy]; rsw=R(sw)
    st=[tx-sx,ty-sy]; rst=R(st)
    F=[rwt<r,rsw<r]
    if rst==0: c=1
    elif F==[1,1]: c=1 # 両方壁の中
    elif F==[1,0] or F==[0,1]: c=0 # 片方が壁の中
    elif F==[0,0]: #両方壁の外
      a=M.pi/2-M.acos(r/rsw)
      tmp=(sw[0]*st[0]+sw[1]*st[1])/rsw/rst
      if abs(abs(tmp)-1)<1e-6: tmp=1
      b=0#M.acos(tmp/2)
      if C(a,b) and C(rst**2,rsw**2-r**2): c=0
      else: c=1
    x.append(c)
  return all(x)

while 1:
  n=input()
  if n==0: break
  WP=I(n)
  P=I(input())
  for e in P: print ["Safe","Danger"][f(e)]

### FIXED CODE ###

import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def C(a,b): return a>b or abs(a-b)<1e-6
def f(e1):
  tx,ty,sx,sy=e1
  x=[]
  st=[tx-sx,ty-sy]; rst=R(st)
  for e2 in WP:
    wx,wy,r=e2
    wt=[tx-wx,ty-wy]; rwt=R(wt)
    sw=[wx-sx,wy-sy]; rsw=R(sw)
    F=[rwt<r,rsw<r]
    if F==[1,0] or F==[0,1]: return 0
    elif F==[0,0]:
      a=M.pi/2-M.acos(r/rsw)
      b=M.acos(round((sw[0]*st[0]+sw[1]*st[1])/rsw/rst,4))
      if C(a,b) and C(rst**2,rsw**2-r**2): return 0
  return 1

while 1:
  n=input()
  if n==0: break
  WP=I(n)
  P=I(input())
  for e in P: print ["Safe","Danger"][f(e)]
from collections import deque
import sys
sys.setrecursionlimit(1000000)
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
cnt = [[float('inf')]*w for _ in range(h)]
moves = ((0, 1), (0, -1), (1, 0), (-1, 0))

for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      cnt[i][j] = 0 

def bfs(sy, sx):
  q = deque([[sy, sx]])
  while q:
    y, x = q.popleft()
    for dy, dx in moves:
      ny = y + dy
      nx = x + dx 
      if 0 <= ny < h and 0 <= nx < w and a[ny][nx] == '.' and used[ny][nx] == 0:
        used[ny][nx] = 1
        cnt[ny][nx] = min(cnt[ny][nx], cnt[y][x]+1)
        q.append([ny, nx])

import numpy as np
for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      used = [[0]*w for _ in range(h)]
      bfs(i, j)

print(np.max(np.array(cnt)))

### FIXED CODE ###

from collections import deque
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
moves = ((1, 0), (-1, 0), (0, 1), (0, -1))
cnt = [[float('inf') for _ in range(w)] for _ in range(h)]
ans = 0
searched = [[0 for _ in range(w)] for _ in range(h)]
q = deque([])

def bfs():
  while q:
    y, x = q.popleft()
    for dy, dx in moves:
      next_y = y + dy
      next_x = x + dx 
      if 0 <= next_y < h and 0 <= next_x < w and searched[next_y][next_x] == 0 and a[next_y][next_x] == '.' and cnt[next_y][next_x] > cnt[y][x]+1:
        searched[next_y][next_x] = 1
        q.append([next_y, next_x])
        cnt[next_y][next_x] = cnt[y][x]+1

for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      cnt[i][j] = 0
      searched[i][j] = 1
      q.append([i, j])

bfs()
for i in range(h):
  for j in range(w):
    ans = max(ans, cnt[i][j])

print(ans)
N,M,C = map(int, input().split())
B = map(int, input().split())
A = []

for i in range(N):
	A[i] = map(int, input().split())

ans = 0

for i in range(N):
	tmp = 0
	for n in range(M):
		tmp += A[i][n]*B[n]
	if(tmp+C>0):
		ans += 1

print(ans)


### FIXED CODE ###

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

for i in range(N):
	A.append(list(map(int, input().split())))

ans = 0

for i in range(N):
	tmp = 0
	for j in range(M):
		tmp = tmp + A[i][j]*B[j]
	if(tmp+C>0):
		ans += 1

print(ans)
import numpy as np

n, p = map(int, input().split())
s = np.array([int(i) % p for i in input()])
mod = np.zeros((n, p), dtype=np.int)
for i in range(n):
  mod[i, s[i]] = 1
count = mod[0, 0]
for i in range(1, n):
  idx = s[i]
  for j in range(p):
    mod[i, idx] += mod[i-1, j]
    idx = (idx + 10) % p
print(mod[:, 0].sum())

### FIXED CODE ###

n, p = map(int, input().split())
s = input()
count = 0
if p == 2 or p == 5:
  for i in range(n):
    if int(s[i]) % p == 0:
      count += i + 1
  print(count)
else:
  mod = [0] * p
  mod[0] = 1
  tmp = 0
  ten = 1
  for i in s[::-1]:
    ten = ten * 10 % p
    tmp = (tmp + int(i) * ten) % p
    mod[tmp] += 1
  for m in mod:
    count += m * (m - 1) // 2
  print(count)
a, b =map(int, input())
l=[
  a+b,
  a-b,
  a*b
]
print(max(l))

### FIXED CODE ###

a, b =map(int, input().split())
l=[
  a+b,
  a-b,
  a*b
]
print(max(l))
n=int(input())
a=list(map(lambda x:int(x)//400,input().split()))
cat=[0]*12
"""
cat=[0]*9
for ai in a:
    if ai < 8:
        cat[ai]=1
    else:
        cat[8]+=1
print(str(max(sum(cat[:8]),1))+' '+str(min(sum(cat),8)))
"""
for ai in a:
    cat[ai]+=1
print(str(max(sum([x > 0 for x in cat[:8]]),1))+' '+str(min(sum([x > 0 for x in cat[:8]])+sum(cat[8:]),8)))


### FIXED CODE ###

n=int(input())
a=list(map(lambda x:min(int(x)//400,8),input().split()))
cat=[0]*8
f=0
for ai in a:
    if ai < 8:
        cat[ai]=1
    if ai == 8:
        f+=1
print(str(max(sum(cat),1))+' '+str(sum(cat)+f))
S = str(input())
T = str(input())
fg = 0
mini = []
for i in range(len(S) - len(T)):
    count = 0
    for j in range(len(T)):
        if T[j] == S[j+i]:        
            count+=1
    mini.append(len(T) - count)
print(min(mini))

### FIXED CODE ###

S = str(input())
T = str(input())
mini = []

if len(S) != len(T):
    for i in range(len(S) - len(T)):
        count = 0
        for j in range(len(T)):
            if T[j] == S[j+i]:        
                count+=1
        mini.append(len(T) - count)
    print(min(mini))
else:
    count = 0
    for i in range(len(S)):
       if T[i] == S[i]:
           count+=1
    print(len(T) - count)
M, K = map(int, input().split())

tmp = 0
X = list(range(K)) + list(range(K+1, 2**M))

if M == 1:
    if K == 0:
        print("0 0 1 1")
    else:
        print(-1)
elif 2**M > K:
    ans = X + [K] + X[::-1] + [K]
    print(*ans)
else:
    print(-1)


### FIXED CODE ###

M, K = map(int, input().split())

if M == 1:
    if K == 0:
        print("1 1 0 0")
    else:
        print(-1)
elif 2**M > K:
    X = list(range(K)) + list(range(K+1, 2**M))
    ans = " ".join(map(str, X + [K] + X[::-1] + [K]))
    print(ans)
else:
    print(-1)
a,b=map(str, input().split())
c=a+b
d=int(c)
k=o
for i in range(1,100):
  if d==i**2:
    k=k+1
  else:
    k=k
if k>=1:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b=map(str, input().split())
c=a+b
d=int(c)
k=0
for i in range(1,1001):
  if d==i**2:
    k=k+1
  else:
    k=k
if k>=1:
  print('Yes')
else:
  print('No')
a,p = map(int,input().split())
print(int((3＊a+p)/2)

### FIXED CODE ###

a,p = map(int,input().split())
print((3*a+p)//2)