Harryxun/stf_run huggingface dataset:
N = int(input())
M = int(input())

A = [list(input()) for _ in range(N)]
B = [list(input()) for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        flag = True
        for k in range(M):
            for l in range(M):
                if A[i+k][j+l] != B[k][l]:
                    flag = False
                    break
            if not flag:
                break
        
        if flag:
            print('Yes')
            exit()

print('No')

### FIXED CODE ###

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

A = [list(input()) for _ in range(N)]
B = [list(input()) for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        flag = True
        for k in range(M):
            for l in range(M):
                if A[i+k][j+l] != B[k][l]:
                    flag = False
                    break
            if not flag:
                break
        
        if flag:
            print('Yes')
            exit()

print('No')
x,k=map(int,input().split())
if x*500>=k:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

x,k=map(int,input().split())
if 500*x>=k:
  print('Yes')
else:
  print('No')
n=int(input())
a=[input() for _ in range(n)]
import numpy as np
mp=np.zeros((21,21),np.int32)
ary=[]
for i in range(n):
  b=list(a[i].split('.'))
  b.append('0')
  x=int(b[0])
  y=int((b[1]+'0'*9)[:9])
  x=x*pow(10,9)+y
  # x10^9
  cnt5=-9
  xx=x
  while xx>1:
    if xx%5==0:
      cnt5+=1
      xx//=5
    else:
      break
  cnt2=-9
  xx=x
  while xx>1:
    if xx%2==0:
      cnt2+=1
      xx//=2
    else:
      break
  mp[cnt5+10,cnt2+10]+=1
  ary.append([cnt5+10,cnt2+10])

ans=0
for x,y in ary:
  if x>=10 and y>=10:
        i=1
  else:
    i=0
  x-=10
  x*=-1
  x+=10
  y-=10
  y*=-1
  y+=10
  ans+=np.sum(mp[x:,y:])-i
print(ans//2)

#mp[10,10]+=10
#print(mp)


"""
5
0.2
2
5
10
0.5

5
2.4
7.5
0.16
6.15
10

"""


### FIXED CODE ###

def main(n,a):
  k=60
  mp=[[0]*k for _ in range(k)]
  o=k//2
  ary=[]
  for i in range(n):
    b=list(a[i].split('.'))
    b.append('0')
    x=int(b[0])
    y=int((b[1]+'0'*9)[:9])
    x=x*pow(10,9)+y
    # x10^9
    cnt5=-9
    xx=x
    while xx>1:
      if xx%5==0:
        cnt5+=1
        xx//=5
      else:
        break
    cnt2=-9
    xx=x
    while xx>1:
      if xx%2==0:
        cnt2+=1
        xx//=2
      else:
        break
    #if 0<=cnt5+o<23 and 0<=cnt2+o<23:
    mp[cnt5+o][cnt2+o]+=1
    ary.append([cnt5+o,cnt2+o])

  ans=0
  for i in range(k-1,0,-1):
    for j in range(k):
      mp[j][i-1]+=mp[j][i]
  for i in range(k-1,0,-1):
    for j in range(k):
      mp[i-1][j]+=mp[i][j]
  for x,y in ary:
    if x>=o and y>=o:
      i=1
    else:
      i=0
    x-=o
    x*=-1
    x+=o
    y-=o
    y*=-1
    y+=o
    ans+=mp[x][y]-i
  print(ans//2)
  #mp[o,o]+=10
  #print(mp)

n=int(input())
a=[input() for _ in range(n)]
main(n,a)
import math

K, N = map(int, input().split())
ans = []

if K % 2 == 0:
    for i in range(N):
        if i == 0:
            ans[i] = K // 2
        else:
            ans[i] = K
elif K == 1:
    n2 = math.ceil(N / 2)
    for i in range(n2):
        ans.append(1)
else:
    K2 = math.ceil(K / 2)
    n2 = math.floor(N / 2)
    ans = [K2] * N
    i = 0
    nx = 0
    last = True
    while n2 > 0:
        i += 1
        ans[N - i] = max(K2 - n2 % (K + 1) - nx, 0)
        if ans[N - i] == 0 and last:
            ans.pop()
        else:
            last = False
        n2 //= K + 1
        if K2 - n2 % (K + 1) - nx < 0:
            nx = 1
        else:
            nx = 0

print(' '.join(map(str, ans)))


### FIXED CODE ###

import math


def main(K, N):
    ans = []

    if K % 2 == 0:
        for i in range(N):
            if i == 0:
                ans.append(K // 2)
            else:
                ans.append(K)
    elif K == 1:
        n2 = math.ceil(N / 2)
        for i in range(n2):
            ans.append(1)
    else:
        K2 = math.ceil(K / 2)
        ans = [K2] * N
        n = N // 2
        for i in range(n):
            if ans[-1] == 1:
                ans.pop()
            else:
                ans[-1] -= 1
                while len(ans) < N:
                    ans.append(K)

    return ' '.join(map(str, ans))


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

t = [0] * M
c = 0
for a in A:
    c += a
    c %= M
    t[c] += 1

result = t[0]
c = 0
for a in A:
    c += a
    c %= M
    t[c] -= 1
    result += t[c]
print(result)

### FIXED CODE ###

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

t = {}
c = 0
for a in A:
    c += a
    c %= M
    if c in t:
        t[c] += 1
    else:
        t[c] = 1

result = 0
if 0 in t:
    result += t[0]
c = 0
for a in A:
    c += a
    c %= M
    t[c] -= 1
    result += t[c]
print(result)
N,M = map(int,input().split(" "))
ans = [-1 for _ in range(N)]
for i in range(M):
    s,c = map(int,input().split(" "))
    if ans[s-1] != -1 and ans[s-1] != c:
        print(-1)
        exit()
    else:
        ans[s-1] = c
if ans[0] == 0:
    print(-1)
    exit()  
for i in range(N):
    if ans[i] == -1:
        if i != 0:
            ans[i] = 0
        else:
            ans[i] = 1
    ans[i] = str(ans)
ans = ''.join(ans)
print(int(ans))

### FIXED CODE ###

N,M = map(int,input().split(" "))
ans = [-1 for _ in range(N)]
flag = 0
for i in range(M):
    s,c = map(int,input().split(" "))
    if ans[s-1] != -1 and ans[s-1] != c:
        flag = 1
    else:
        ans[s-1] = c
if N != 1 and ans[0] == 0:
    flag = 1
elif N == 1 and ans[0] == 0:
    print(0)
    exit()
if N == 1:
    if ans[0] == -1:
        print(0)
        exit()
for i in range(N):
    if ans[i] == -1:
        if i == 0:
            ans[i] = 1
        else:
            ans[i] = 0
    ans[i] = str(ans[i])
ans = ''.join(ans)
if flag == 1:
    print(-1)
    exit()
print(int(ans))
from itertools import product
def main():
    n, m, x = map(int, input().split())
    books = []
    for _ in range(n):
        books.append(tuple(map(int, input().split())))

    books_set_all = []
    books_pattern = product((0, 1), repeat=n)
    for each_pattern in books_pattern:
        books_set = [0] * (m + 1)
        for i in each_pattern:
            if i:
                for i2 in range(m + 1):
                    books_set[i2] += books[i][i2]
        books_set_all.append(books_set)
    price_all = []
    for ebs in books_set_all:
        price = ebs[0]
        ebs[0] = x
        if len([j for j in ebs if j >= x]) == m + 1:
            price_all.append(price)
    if len(price_all) > 0:
        print(min(price_all))
    else:
        print(-1)

if __name__ == '__main__':
    main()


### FIXED CODE ###


from itertools import combinations
from copy import deepcopy
def main():
    n, m, x = map(int, input().split())
    books = []
    for _ in range(n):
        books.append(list(map(int, input().split())))
    books_pattern = []
    books_num = [i for i in range(n)]
    for i1 in range(1, n + 1):
        books_pattern += list(combinations(books_num, i1))
    skill_set = []

    for ebp in books_pattern:
        skill_pattern = [0] * (m + 1)
        for ebpe in ebp:
            book_e = books[ebpe]
            for i2 in range(m + 1):
                skill_pattern[i2] += book_e[i2]
        skill_set.append(skill_pattern)

    skill_set_ok = []
    for ess in skill_set:
        tess = deepcopy(ess[1:])
        tessc = [i for i in tess if i >= x]
        if len(tessc) == m:
            skill_set_ok.append(ess[0])
    if len(skill_set_ok) > 0:
        print(min(skill_set_ok))
    else:
        print(-1)





if __name__ == '__main__':
    main()
raw = raw_input().split()                                                                              |a = int(raw[0])                                                                                       
a = int(raw[0])                                                                                        |b = int(raw[1])                                                                                       
b = int(raw[1])                                                                                        |c = int(raw[2])                                                                                       
c = int(raw[2])                                                                                        |k = int(raw[3])                                                                                       
d = int(raw[3])                                                                                        |                                                                                                      
e = int(raw[4])                                                                                        |m = 1000000000000000000                                                                               
k = int(raw[5])                                                                                        |                                                                                                      
                                                                                                       |# a -b                                                                                                
if b - a <= k or c - b <= k or d - c <= k or d - e <= k:                                               |# b+c - (a+c) = b - a                                                                                 
    print 'Yay!'                                                                                       |def recursion(a,b,c, k, i):                                                                           
else:                                                                                                  |    if i < k:                                                                                         
    print ':('

### FIXED CODE ###

raw = raw_input()
a = int(raw)
raw = raw_input()                                  
b = int(raw)
raw = raw_input()                                  
c = int(raw)
raw = raw_input()                                  
d = int(raw)
raw = raw_input()                                  
e = int(raw)
raw = raw_input()                                  
k = int(raw)
                                                                                                       
if e - a > k:
    print ':('
else:                                                                                                  
    print 'Yay!'
tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])

num = [0 for i in range(N-1)] 
for i in range(N-1):
    tmp = input().split(" ")
    a = int(tmp[0])
    b = int(tmp[1])
    num[a-1] = num[a-1] + b

tmp = 0
i = 0
while tmp <= K:
    tmp = tmp + num[i]
    if tmp >= K:
        print(i+1)
    i = i + 1

### FIXED CODE ###

tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])

num = [0 for i in range(10**5)]
for i in range(N):
    tmp = input().split(" ")
    a = int(tmp[0])
    b = int(tmp[1])
    num[a-1] = num[a-1] + b

tmp = 0
i = 0
while tmp < K:
    tmp = tmp + num[i]
    if tmp >= K:
        print(i+1)
    i = i + 1
n = int(input())
s = input()

cnt = 0
i = 0
while True:
    if s[i] == '.':
        break
    i += 1

if i == n:
    pass
else:
    for j in range(i, n):
        if s[j] == '#':
            cnt += 1

print(cnt)

### FIXED CODE ###

n = int(input())
s = str(input())
#n = len(s)

bl = s.count('#')
wh = s.count('.')
cnt = wh
mincnt = cnt
for i in range(n):
    if s[i] == '#':
        cnt += 1
    else:
        cnt -= 1
    mincnt = min(mincnt, cnt)

print(mincnt)
import math
N,K = map(int,input().split())
if K > 5000:
  raise IndexError
cnt = 0
for n in range(1,N+1):
    if K/n <= 1:
        x = 0
    elif math.log(K/n)%math.log(2)<=0.00001:
        x = (math.log(K)-math.log(n))//math.log(2)
    else:
        x = (math.log(K)-math.log(n))//math.log(2)+1
    cnt += (0.5)**x
 
print(cnt/N)

### FIXED CODE ###

import math
N,K = map(int,input().split())
cnt = 0
for n in range(1,N+1):
    x = 0
    while n*(2**x) < K:
        x += 1
    cnt += (0.5)**x

print(cnt/N)
import numpy as np

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

array = np.array(lst)
po_array = array[array>=0]
ne_array = abs(array[array<0])
ne_array.sort()

if len(po_array) >= len(ne_array):
    long_array = po_array
    short_array = ne_array
else:
    long_array = ne_array
    short_array = po_array

if len(short_array) > k:
    min_len = k
else:
    min_len = len(short_array)
        
if min_len == 0:
    print(long_array[k-1])
else:
    min_dist = 10**10
    for i in range(min_len):
        if i == k-1:
            dist = short_array[i]
        elif k-i-2 >= 0
            dist = short_array[i]*2 + long_array[k-i-2]
        if min_dist > dist:
            min_dist = dist
    if len(long_array) >= k:
        if min_dist > long_array[k-1]:
            min_dist = long_array[k-1]
    print(min_dist)

### FIXED CODE ###

import numpy as np

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

array = np.array(lst)
po_array = array[array>=0]
ne_array = abs(array[array<0])
ne_array.sort()

if len(po_array) >= len(ne_array):
    long_array = po_array
    short_array = ne_array
else:
    long_array = ne_array
    short_array = po_array

if len(short_array) > k:
    min_len = k
else:
    min_len = len(short_array)
        
if min_len == 0:
    print(long_array[k-1])
else:
    min_dist = 10**10
    for i in range(min_len):
        dist = 10**10
        if i == k-1:
            dist = short_array[i]
        elif k-i-1 <= len(long_array): 
            dist = min(short_array[i]*2 + long_array[k-i-2], short_array[i] + long_array[k-i-2]*2)
        if min_dist > dist:
            min_dist = dist
    if len(long_array) >= k:
        if min_dist > long_array[k-1]:
            min_dist = long_array[k-1]
    print(min_dist)
X, N = map(int, input().split(' '))
if N != 0:
    P_n = list(map(int, input().split(' ')))

    for i in range(X, 101):
        if i not in set(P_n):
            min_1 = i
            break
    for i in range(X, -100, -1):
        if i not in set(P_n):
            min_2 = i
            break
    if abs(min_1-X) == abs(min_2-X):
        print(min(min_1, min_2))
    elif abs(min_1-X) < abs(min_2-X):
        print(min_1)
    else:
        print(min_2)
else:
    print(X)

### FIXED CODE ###

X, N = map(int, input().split(' '))
if N != 0:
    P_n = list(map(int, input().split(' ')))

    for i in range(X, 150):
        if i not in set(P_n):
            min_1 = i
            break
    for i in range(X, -150, -1):
        if i not in set(P_n):
            min_2 = i
            break
    if abs(min_1-X) == abs(min_2-X):
        print(min(min_1, min_2))
    elif abs(min_1-X) < abs(min_2-X):
        print(min_1)
    else:
        print(min_2)
else:
    print(X)
import numpy as np


arr = np.zeros(9000, dtype=np.int32)

for s in range(3, 64+1):
    for x in range(1, s-2+1):
        for y in range(1, s-1+1):
            z = s - (x + y)
            if z <= 0:
                continue
            arr[s**2 - (x*y + y*z + z*x) - 1] += 1

num = int(input())
for i in range(0, num):
    print(arr[i])


### FIXED CODE ###

import numpy as np


arr = np.zeros(100000, dtype=np.int32)

for s in range(3, 128+1):
    for x in range(1, s-2+1):
        for y in range(1, s-1+1):
            z = s - (x + y)
            if z <= 0:
                continue
            arr[s**2 - (x*y + y*z + z*x) - 1] += 1

num = int(input())
for i in range(0, num):
    print(arr[i])
N=int(input())
A=list(map(int,input().split()))


low=0
high=10**9*2

#binary search the value of rain onto Mountain1
while low<=high:
    mid=(low+high)//2

    cur=mid
    for a in A:
        cur=a-cur
        if cur<0:#途中で足りなくなったら、midが大きすぎ
            break
       #break
    if cur>=mid:
        low=mid+1
    else:
        high=mid-1


ans=[]
cur=high
for a in A:
    ans.append(cur*2)
    cur=a-cur
assert cur==high
print(" ".join(map(str,ans)))






    



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

sum_odd = sum([v for v in A[1::2]])
x0 = sum(A)-2*sum_odd
ans = [x0]

x = x0
for a in A:
    nex = 2*a-x
    ans.append(nex)
    x = nex
print(*ans[:-1])
def div(a,b):
    return [a//b,a-(a//b)*b]

def func(n,twos): #f(1,n)
    small = twos[0]
    l = len(bin(n))-2
    n += 1
    num = [0 for i in range(l)]
    for i in range(l):
        if i == 0:
            if div(n,4)[1] == 0 or div(n,4)[1] == 1:
                
                num[i] = 0
            else:
                num[i] = 1
        else:
            if (div(n,twos[i])[1] - twos[i]//2) <= 0 or (div(n,twos[i])[1] - twos[i]//2)%2 == 0:
                num[i] = 0
            else:
                num[i] = 1
    num.reverse()
    return num

def decode(ans,twos):
    val = 0
    ans.reverse()
    twos.insert(0,1)
    for i in range(len(ans)):
        val += ans[i]*twos[i]
    twos.pop(0)
    return val

a,b = map(int,input().split())
twos = [2]
i = 0
while twos[i]*2 <= 1e12:
    twos.append(twos[i]*2)
    i += 1
ans1 = func(a-1,twos)
ans2 = func(b,twos)

for i in range(len(ans2)-len(ans1)):
    ans1.insert(0,0)

print(decode(ans2,twos) ^ decode(ans1,twos))

### FIXED CODE ###

def f(n):
    if n%2 == 0:
        return (n//2)%2 ^ n
    else:
        return ((n+1)//2)%2

a,b = map(int,input().split())
print(f(a-1)^f(b))
def sumTree(index, children, prev, pointTree=[]):
    sumPoint = point[index] + prev
    pointTree.append(sumPoint)

    for key in children:
        sumTree(key, tree[key], sumPoint, pointTree)    
    return pointTree

if __name__ == "__main__":
    tree = {}
    N, Q = map(int, input().split(' '))
    for i in [input() for i in range(N-1)]:
        A, B = map(int, i.split(' '))
        if A in tree:
            tree[A].append(B)
        else:
            tree[A] = [B]

        if B not in tree:
            tree[B] = []

    point = [0] * (int(list(tree.keys())[len(tree)-1]) + 1)
    for i in [input() for i in range(Q)]:
        A, B = map(int, i.split(' '))
        point[A] = point[A] + B

    firstKey = list(tree.keys())[0]
    pointTree = sumTree(firstKey, tree[firstKey], 0)
    print(*pointTree)


### FIXED CODE ###

from collections import deque
 
if __name__ == "__main__":
    N, q = map(int, input().split())
    links = [[] for _ in range(N)]
    
    for i in range(N - 1):
        a, b = map(int, input().split())
        links[a - 1].append(b - 1)
        links[b - 1].append(a - 1)
    
    ans = [0] * N
    for i in range(q):
        p, x = map(int, input().split())
        ans[p - 1] += x

    deq = deque([0])
    visited = [False] * N
    while deq:
        parent = deq.popleft()
        link = links[parent]
        for v in link:
            if not visited[v]:
                ans[v] += ans[parent]
                deq.append(v)
        visited[parent] = True
    
    print(*ans)
import sys
input = sys.stdin.readline
N = int(input())

List = []
for i in range(1,10**4):
    for j in range(1,10**4):
        if N == i*j:
            List.append(i+j)

print(min(List)-2)

### FIXED CODE ###

A, B = map(int, input().split())
print(A*B if A <= 9 and B <= 9 else -1)
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N, A, B = ri()
print(min(A * N, B))

### FIXED CODE ###

# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N, A, B = ri_()
print(min(A * N, B))
n = int(input())
if n%2 == 1:
    print(0)
else:
    cur_two, cur_ten = 2, 10
    num_two, num_ten = 0, 0
    while cur_two <= n:
        num_two += n//cur_two
        cur_two *= 2
    while cur_ten <= n:
        num_ten += n//cur_ten
        cur_ten *= 5
print(min(num_two, num_ten))

### FIXED CODE ###

import sys
n = int(input())
if n%2 == 1:
    print(0)
    sys.exit()
else:
    cur_two, cur_ten = 2, 10
    num_two, num_ten = 0, 0
    while cur_two <= n:
        num_two += n//cur_two
        cur_two *= 2
    while cur_ten <= n:
        num_ten += n//cur_ten
        cur_ten *= 5
    print(min(num_two, num_ten))
#118c
N = int(input())
A_list = list(input())

import fractions #math
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

print(gcd_list(A_list))

### FIXED CODE ###

#118c
#最小公倍数
N = int(input())
A_list = [int(e) for e in input().split()]

#######################################
#https://note.nkmk.me/python-gcd-lcm/
#import math
import fractions
from functools import reduce

def gcd(*numbers):
    #return reduce(math.gcd, numbers)
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    #return reduce(math.gcd, numbers)
    return reduce(fractions.gcd, numbers)
#######################################

print(gcd(*A_list))
import math

N,H = list(map(int,input().split()))

A=[]
B=[]
for n in range(N):
    a,b = list(map(int,input_[1+n].split()))
    A.append(a)
    B.append(b)
    
A.sort(reverse=True)
B.sort(reverse=True)
A,B

a_max=A[0]

B_=[]
for b in B:
    if b < a_max:
        break
    B_.append(b)
B=B_

B_sum = [0]
for b in B:
    B_sum.append(B_sum[-1]+b)

ans = 0
for b_sum_idx,b_sum in enumerate(B_sum):
    if b_sum >= H:
        ans = b_sum_idx
        break
        
    ans = b_sum_idx
H = max(0,H - b_sum)

ans += math.ceil(H/a_max)

print(ans)

### FIXED CODE ###

import math

N,H = list(map(int,input().split()))

A=[]
B=[]
for n in range(N):
    a,b = list(map(int,input().split()))
    A.append(a)
    B.append(b)
    
A.sort(reverse=True)
B.sort(reverse=True)
A,B

a_max=A[0]

B_=[]
for b in B:
    if b < a_max:
        break
    B_.append(b)
B=B_

B_sum = [0]
for b in B:
    B_sum.append(B_sum[-1]+b)

ans = 0
for b_sum_idx,b_sum in enumerate(B_sum):
    if b_sum >= H:
        ans = b_sum_idx
        break
        
    ans = b_sum_idx
H = max(0,H - b_sum)

ans += math.ceil(H/a_max)

print(ans)