Harryxun/stf_run huggingface dataset:
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

#リスト l の最大公約数
def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

#a*x+b*y=gcd(a,b)の一つの解
def extgcd_2(a,b):    
    g = gcd(a,b)
    a = a//g
    b = b//g
    return extgcd(a,b)

#a,bの最小公倍数
def lcm(a, b):
	return a * b // gcd (a, b)

#nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

#n以下の素数列挙(O(n log(n))
def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = True
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

    return is_prime


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

g = gcd(a,b)
d = divisor(g)
d.sort()

res = 0

isp = primes(g)

for e in d:
    if isp[e]:
        res += 1
print(res)



### FIXED CODE ###

import random
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)


#nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

#n以下の素数列挙(O(n log(n))
def primes(n):
    is_prime = [True] * (n + 100)
    is_prime[0] = False
    is_prime[1] = True
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

    return is_prime

def is_prime(n):
    if n == 1:
        return True
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


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

g = gcd(a,b)
d = divisor(g)
d.sort()

res = 0

#isp = primes(g)
#print(isp)

for e in d:
    if is_prime(e):
        res += 1

print(res)
import math
n,d=map(int,input().split())
l==[list(map(int,input().split())) for _ in range(n)]
c=0
for i in range(n):
    x=l[i][0]
    y=l[i][1]
    k=math.sqrt(x**2+y**2)
    if k<=d:c+=1
print(c)

### FIXED CODE ###

import math
n,d=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(n)]
c=0
for i in range(n):
    x=l[i][0]
    y=l[i][1]
    k=math.sqrt(x**2+y**2)
    if k<=d:c+=1
print(c)
X,N = map(int, input().split())
if N ==0:
  print(X)
  exit() 
if N ==0:
  print(X)
  exit() 
if p.count(X) == 0:
  print(X)
  exit()
for a in range(1000):
  if p.count(X-a) ==0:
    print(X-a)
    exit()
  elif p.count(X+a) ==0:
    print(X+a)
    exit()


### FIXED CODE ###

X,N = map(int, input().split())
if N ==0:
  print(X)
  exit() 
if N !=0:
  p = list(map(int, input().split()))
if p.count(X) == 0:
  print(X)
  exit()
for a in range(1000):
  if p.count(X-a) ==0:
    print(X-a)
    exit()
  elif p.count(X+a) ==0:
    print(X+a)
    exit()
import sys
import re
import heapq

n, m = map(int, input().rstrip().split())

for i in range(n):
    for j in range(n):
        if (i==j):
            dist[i][j]=0
        else:
            dist[i][j]=float('inf')
        

a = []
b = []
c = []

for i in range(m):
    x, y, z = map(int, input().rstrip().split())
    dist[x][y] =  min(dist[x][y], z)
    dist[y][x] =  min(dist[x][y], z)
    a.append(x)
    b.append(y)
    c.append(z)
    
for i in range(n):
    for j in range(n):
        for k in range(n):
            dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j])

result = m

for i in range(m):
    for j in range(m):
        if dist[j][a[i]] + c[i] == dist[j][b[i]]:
            result -= 1

print(result)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000001)

n, m = map(int, input().rstrip().split())
dist = [[500000 for i in range(n)]for j in range(n)]

for i in range(n):
    for j in range(n):
        if (i==j):
            dist[i][j]=0

a = []
b = []
c = []

for i in range(m):
    x, y, z = map(int, input().rstrip().split())
    dist[x-1][y-1] =  min(dist[x-1][y-1], z)
    dist[y-1][x-1] =  min(dist[x-1][y-1], z)
    a.append(x-1)
    b.append(y-1)
    c.append(z)
    
for k in range(n):
    for i in range(n):
        for j in range(n):
            dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j])
#print(dist)
result = m

for i in range(m):
    for j in range(n):
        if dist[j][a[i]] + c[i] == dist[j][b[i]]:
            result -= 1
            break

print(result)
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,W=map(int,input().split())
    weight,value=[],[]
    for i in range(N):
        w,v=map(int,input().split())
        weight.append(w)
        value.append(v)
    # この前段階で、荷物の数N、ウェイトの上限W、
    # weightの表weightとvalueの表valueは用意しておく。
    def knapsack(N, W, weight, value):
        dp = [[0] * (W + 1) for _ in range(N + 1)]

        for i in range(N):
            for w in range(W + 1):
                if w >= weight[i]:  # 荷物が加わる可能性がある
                    # max関数の第一引数だと、既存の荷物の方がましな場合。
                    # 第二引数だと、新入りを加えた方が良い場合。
                    dp[i + 1][w] = max(dp[i][w], dp[i][w - weight[i]] + value[i])
                else:  # 加わる可能性はない
                    dp[i + 1][w] = dp[i][w]

        return dp[N][W]

    print(knapsack(N,W,weight,value))

resolve()

### FIXED CODE ###

N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
	w[i], v[i] = map(int, input().split())

V = sum(v)
# dp[i][j]:i番目までの品物から価値がj以上になるよう選んだときの重さの総和の最小値
dp = [[float("inf")] * (V + 1) for _ in range(N + 1)]
dp[0][0] = 0
for i in range(N):
	for j in range(V + 1):
		# i+1番目を選ぶ場合
		if j - v[i] >= 0:
			dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - v[i]] + w[i])
		# i+1番目を選ばない場合
		dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])

# dp[N][j]がW以下であるようなjの最大値が答えになる
ans = 0
for j in range(V + 1):
	if dp[N][j] <= W:
		ans = j

print(ans)
from collections import deque
h,w=map(int,input().split())
field=["#" for i in range(w+2)]+[["#"]+list(input())+["#"] for i in range(h)]+["#" for i in range(w+2)]
queue=deque([[1,1]])
cost=[[50000 for i in range(w)]for j in range(h)]
cost[0][0]=0
while queue:
  now=queue.popleft()
  for i in [(-1,-1),(-1,1),(1,1),(1,-1)]:
    if field[now[0]+i[0]][now[1]+i[1]]=="#":continue
    if cost[now[0]+i[0]-1][now[1]+i[1]-1]!=50000
    if cost[now[0]+i[0]-1][now[1]+i[1]-1]>cost[now[0]-1][now[1]-1]+1:
      cost[now[0]+i[0]-1][now[1]+i[1]-1]=cost[now[0]-1][now[1]-1]+1
cnt=0
for i in range(h+2):
  for j in range(w+2):
    if field[i][j]=="#":cnt+=1
cnt-=(h+w)*2+4
blackable=h*w-cnt
if cost[-1][-1]==50000:print(-1)
else:
  print(blackable-cost[-1][-1])

### FIXED CODE ###

from collections import deque
h,w=map(int,input().split())
field=[["#" for i in range(w+2)]]+[["#"]+list(input())+["#"] for i in range(h)]+[["#" for i in range(w+2)]]
queue=deque([[1,1]])
cost=[[50000 for i in range(w)]for j in range(h)]
cost[0][0]=0
while queue:
  now=queue.popleft()
  for i in [(-1,0),(1,0),(0,1),(0,-1)]:
    if field[now[0]+i[0]][now[1]+i[1]]=="#":continue
    if cost[now[0]+i[0]-1][now[1]+i[1]-1]!=50000:continue
    queue.append((now[0]+i[0],now[1]+i[1]))
    cost[now[0]+i[0]-1][now[1]+i[1]-1]=cost[now[0]-1][now[1]-1]+1
cnt=0
for i in range(h+2):
  for j in range(w+2):
    if field[i][j]=="#":cnt+=1
cnt-=(h+w)*2+4
blackable=h*w-cnt
if cost[-1][-1]==50000:print(-1)
else:
  print(blackable-cost[-1][-1]-1)
## C
n, m = map(int,input().split())
a = [0] * n
b = [0] * n
for i in range(0,n):
    a[i], b[i] = map(int,input().split())

dict = {}
for i in range(0,n):
    dict[a[i]] = b[i]

l = sorted(a)

for j in range(0,n-1):
    if l[j] == l[j-1]:
        dic[l[j]] = dic[l[j]]+dic[l[j-1]]
        dic[l[j-1]] = 0
        l[j-1] = -j

#print(l)
#print(dict)

ex = 0
num = 0

for i in range(0,n):
    #print(l[i])
    if num + dict[l[i]] <= m:
        ex = ex + l[i] * dict[l[i]]
        num = num + dict[l[i]]
    else:
        ex = ex + l[i] * (m - num)
        num = m
    #print([ex,num])
    if num == m:
        break

print(ex)






### FIXED CODE ###

##### C 再チャレンジ

##以下、二次元配列を、各リストの最初の要素でソートするアルゴリズム

def two_dim_merge_sort(arr):#＃arrは二次元配列
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    # ここで分割を行う
    left = arr[:mid]
    right = arr[mid:]

    # 再帰的に分割を行う
    left = two_dim_merge_sort(left)
    right = two_dim_merge_sort(right)

    # returnが返ってきたら、結合を行い、結合したものを次に渡す
    return two_dim_merge(left, right)


def two_dim_merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    # ソート済み配列をマージするため、それぞれ左から見ていくだけで良い
    while l_i < len(left) and r_i < len(right):
        # ここで=をつけることで安定性を保っている
        if left[l_i][0] <= right[r_i][0]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    # 上のwhile文のどちらかがFalseになった場合終了するため、あまりをextendする
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged

##ここまで

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

l = [0]*n

for i in range(0,n):
    l[i] = list(map(int,input().split()))

s = two_dim_merge_sort(l)

num = 0
ex = 0

for i in range(0,n):
    if num + s[i][1] <= m:
        ex = ex + s[i][0] * s[i][1]
        num = num + s[i][1]
    else:
        ex = ex + s[i][0] * (m-num)
        num = m
    if num == m:
        break
        
print(ex)
h, w = map(int, input().split())
s = [list(input()) for j in range(h)]
ans = 'Yes'
for j in range(w):
  for i in range(h):
    ok = False
    if s[j][i] == '#':
      if j-1>=0:
        if s[j-1][i] == '#': ok = True
      if i-1>=0:
        if s[j][i-1] == '#': ok = True
      if j+1<h:
        if s[j+1][i] == '#': ok = True
      if i+1<w:
        if s[j][i+1] == '#': ok = True
      if ok == False:
        print('No')
        exit()
print(ans)

### FIXED CODE ###

h, w = map(int, input().split())
s = [list(input()) for j in range(h)]
ans = 'Yes'
for j in range(h):
  for i in range(w):
    ok = False
    if s[j][i] == '#':
      if j-1>=0:
        if s[j-1][i] == '#': ok = True
      if i-1>=0:
        if s[j][i-1] == '#': ok = True
      if j+1<h:
        if s[j+1][i] == '#': ok = True
      if i+1<w:
        if s[j][i+1] == '#': ok = True
      if ok == False:
        print('No')
        exit()
print(ans)
A,B,C=map(int,input().split())
if A+B=>C:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

A,B,C=map(int,input().split())
if A+B>=C:
    print('Yes')
else:
    print('No')
N, X, Y = list(map(int, input().split()))

# N = 2000
# X = 100
# Y = 1900
# X -= 1
# Y -= 1


# @profile
def main(N, X, Y):
    ans = [0]*N
    for sv in range(N):
        # dist[v] = dist from sv to v
        dist = [float("inf")]*N
        last_visited = []
        dist[sv] = 0
        last_visited.append(sv)
        while last_visited:
            next_last_visited = []
            for v in last_visited:
                d = dist[v]
                if v+1 < N and dist[v+1] == float("inf"):
                    dist[v+1] = d+1
                    next_last_visited.append(v+1)
                if v-1 >= 0 and dist[v-1] == float("inf"):
                    dist[v-1] = d+1
                    next_last_visited.append(v-1)
                if v == X and dist[Y] == float("inf"):
                    dist[Y] = d+1
                    next_last_visited.append(Y)
                if v == Y and dist[X] == float("inf"):
                    dist[X] = d+1
                    next_last_visited.append(X)
            # print(last_visited, next_last_visited)
            last_visited = next_last_visited
        # print(dist)
        for d in dist:
            ans[d] += 1

    for a in ans[1:]:
        print(a//2)


main(N, X, Y)


### FIXED CODE ###


N, X, Y = list(map(int, input().split()))

# N = 2000
# X = 100
# Y = 1900


X -= 1
Y -= 1

# @profile


def main(N, X, Y):
    ans = [0]*N
    for i in range(N):
        for j in range(i+1, N):
            d = min(j-i, abs(X-i)+abs(Y-j)+1)
            ans[d] += 1

    for a in ans[1:]:
        print(a)


main(N, X, Y)
# coding:utf-8
def gcd(x,y):
    a = x % y
    y_ans = []
    two_ans = []
    for i in range(1,y + 1):
        if y % i == 0:
            y_ans.append(i)
    for i in range(1,a + 1):
        if a % i == 0:
            two_ans.append(i)
    yset = set(y_ans)
    twoset = set(two_ans)
    matched = list(yset & twoset)
    print max(matched) 

n = map(int, raw_input().split())
gcd(n[0],n[1])

### FIXED CODE ###

# coding:utf-8
def gcd(a,b):
    while b:
        a, b = b, a % b
    return a
n = map(int, raw_input().split())
n.sort(reverse=True)
print gcd(n[0],n[1])
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

table = [0] * 100001

c = 0
s = 0
 
for i in A:
    table[i] += 1
    sum += i
    
for i in range(Q):
    B, C = map(int,input().split())
    c = table[B]
    s += (C - B) * c
    table[C] += table[B]
    table[B] = 0
    print(s)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
S = []
c = 0
s = sum(A)
table = [0] * 100001
 
for i in A:
    table[i] += 1
 
for i in range(Q):
    B, C = map(int,input().split())
    c = table[B]
    s += (C - B) * c
    table[C] += table[B]
    table[B] = 0
    S.append(s)

for s in S:
    print(s)
n = int(input())
s = input()

k = 0

for i in range(n-2):
	if s[i]=A and s[i+1]=B and s[i+2]=C:
		k += 1
        
print(k)


### FIXED CODE ###

n = int(input())
s = input()

k = 0

for i in range(n-2):
	if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
		k += 1
        
print(k)
n = (int)(input())
s = (input())

l = len(s)
ans = l
for i in range(l):
  l_we = s[0:i] if(i >= 0)else None
  l_ea = s[i+1:l] if(i+1 <= l) else None
  print(l_we)
  print(l_ea)
  tmp = 0
  tmp += l_we.count('W')
  tmp += l_ea.count('E')
  ans = min(ans, tmp)
print(ans)


### FIXED CODE ###

def sum_list(l1, l2):
  for i in range(len(l1)):
    l1[i] += l2[i]

  return l1


n = (int)(input())
s = input()
l_e = [0 for _ in range(n+1)]
l_w = [0 for _ in range(n+1)]

for i in range(n):
  if s[i] == 'W':
    l_e[i] += 1
  l_e[i+1] = l_e[i]

for i in reversed(range(n)):
  if s[i] == 'E':
    l_w[i] += 1
  l_w[i-1] = l_w[i]

l_e = l_e[:-1]
l_w = l_w[:n]


#print("E", l_e)
#print("W", l_w)

print(min(sum_list(l_e, l_w))-1)
while True:
    n = int(raw_input())
    a = []
    for i in range(n):
        a.append(int(raw_input())
    b = list(set(a))
    flag = 0
    for i in b:
        if a.count(i) > n/2.0:
            ans = i
            flag = 1
    print ans if flag = 1 else "NO COLOR"

### FIXED CODE ###

while 1:
    n = input()
    if n == 0: break
    A = map(int,raw_input().split())
    A.sort()
    c,l = A[0],0
    for i in A:
        if i == c:
            l += 1
            if l > n/2:
                print c
                break
        else:
            c = i
            l = 1
    else:
        print "NO COLOR"
N = int(raw_input())

print(N // 2 + N % 2)

### FIXED CODE ###

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
  
n = I()

print(n // 2 + n % 2)
x=input()
print(x ** 3)



### FIXED CODE ###

x=int(input())
print(x**3)
n=int(input())
d=sorted(list(map(int,input().split())))


print(int(d[n//2+1]-d[n//2]))

### FIXED CODE ###

n = int(input())
d = sorted(list(map(int,input().split())))

print(d[n//2]-d[n//2-1])
a=int(input())
b=a**2
print b

### FIXED CODE ###

a=int(input())
b=a**2
print (b)
age=int(input())
if age==3,5,7:
  print("YES")
else :
  print('NO')

### FIXED CODE ###

age=int(input())
if age==3:
  print ('YES')
elif age==5:
  print ('YES')
elif age==7:
  print ('YES')
else :
  print('NO')
N, a, b = map(int, input().split())
M = 1000000007

m = N//2 + 1
fact_list = [1] * (N+1)
fact_inv = [1] * (N+1)

for i in range(1, N+1):
    fact_list[i] = fact_list[i-1] * i % M

for i in range(1, N+1):
    fact_inv[i] = pow(int(fact_list[i]), M-2, M)

def mod_comb_k(n,k,M):
    return int(fact_list[n]) * int(fact_inv[k]) % M * int(fact_inv[n-k]) % M

ans = 0
for i in range(1, N+1):
    if i == a or i == b:
        continue
    ans += mod_comb_k(N, i, M) % M
    # print(ans)
print(ans)








### FIXED CODE ###

N, a, b = map(int, input().split())
M = 1000000007


def mod_comb_k(n, k):
    n_P_n_k = 1
    fact_k = 1
    for i in range(k):
        n_P_n_k = n_P_n_k * (n - i) % M
        fact_k = fact_k * (i + 1) % M
    return n_P_n_k * pow(fact_k, M-2, M)

ans = (pow(2, N, M) - 1 - mod_comb_k(N, a) - mod_comb_k(N, b)) % M
print(ans)
A, B, C = int(input())

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
else :
  print(C * 10 + A + B)

### FIXED CODE ###

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


ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)
# from math import factorial
# from collections import defaultdict, deque
#  from heapq import heappush, heappop, heapify

# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# edges = defaultdict(list)
# for _ in range(N - 1):
#     a, b = [int(i) for i in input().split(" ")]
#     edges[a-1].append(b-1)
import math

A, B = [int(i) for i in input().split(" ")]
a, b = [], []
m = math.gcd(A, B)
# print(m)
i = 1
while i <= m:
  if A % i == 0:
     a.append(i)
  if B % i == 0:
     b.append(i)
  i += 1
c = list(sorted(set(a) & set(b)))
ans = []
# print(c)
for i in c:
   for a in ans:
       if a == 1: continue
       if i % a == 0:
          break
   else:
      ans.append(i) 
print(len(ans)) 


### FIXED CODE ###

# from math import factorial
# from collections import defaultdict, deque
#  from heapq import heappush, heappop, heapify

# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# edges = defaultdict(list)
# for _ in range(N - 1):
#     a, b = [int(i) for i in input().split(" ")]
#     edges[a-1].append(b-1)
import math

A, B = [int(i) for i in input().split(" ")]

def solve(n):
    ans, i = [], 1
    while i * i <= n:
        div, mod = divmod(n, i)
        if mod == 0:
            ans.append(i)
            if i != div:
                ans.append(div)
        i += 1
    return list(sorted(ans))  # 順番気にしないならソートせずにより高速

a = solve(A)
b = solve(B)
c = list(sorted(set(a) & set(b)))
# print(c)

ans = []
for i in c:
   for a in ans:
       if a == 1: continue
       if i % a == 0:
          break
   else:
      ans.append(i) 
# print(ans)
print(len(ans))
N = int(input())
X = []
for i in range(N):
	s, p = input()
	X.append([s, p,  i+1])
X.sort()
s = X[0][0]
for i in range(N):
	j = i
	while True:
		if j == len(X) - 1:
			break
		if X[j][0] != s:
			j -= 1
			break
		else j += 1
	for k in range(j-i+1):
		print(X[j][2])
		j -= 1

### FIXED CODE ###

N = int(input())
X = []
for i in range(N):
	s, p = input().split()
	X.append([s, -int(p),  i+1])
X.sort()
for i in range(N):
	print(X[i][2])
#82b
s=sorted(list(input()))
t=sorted(list(input()))

ss=''.join(s)
tt=''.join(t)

ans=sorted([tt,ss])

if ss==tt:
    print('No')
else:
    print(['No','Yes'][ans[0]==ss])

### FIXED CODE ###

#82a
import math
a,b=map(int,input().split())
print(math.ceil((a+b)/2))
N,M=map(int,input().split())
A=[list(input()) for i in range(N)]
B=[list(input()) for i in range(M)]

ans=0

for i in range(N-M+1):
    for j in range(N-M+1):
        if A[i][j]==B[0][0]:
            for k in range(0,M):
                for l in range(0,M):
                    if A[i+k][j+l]==B[k][l]:
                        ans+=1
                        if ans==M**2:
                            flag=1
                    else:
                        ans=0
                        break
    
print("Yes" if flag else "No")
                

### FIXED CODE ###

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

ans=0
flag=0

for i in range(N-M+1):
    for j in range(N-M+1):
        if A[i][j]==B[0][0]:
            for k in range(0,M):
                for l in range(0,M):
                    if A[i+k][j+l]==B[k][l]:
                        ans+=1
                        if ans==M**2:
                            flag=1
                    else:
                        ans=0
                        break
    
print("Yes" if flag else "No")
n, l = (int(i) for i in input().split())

ap=[]

for i in range(n):
	ap[i]=l+i

idx=ap.index(min(abs(ap))

res=(l-1)*n+(1+n)*n/2-ap[idx]

print(res)

### FIXED CODE ###

n, l = (int(i) for i in input().split())
ap=[]
 
for i in range(n):
	ap.append(l+i)
 
mn=min(map(abs,ap))
 
if mn not in ap:
	mn=-mn
 
res=int((l-1)*n+(1+n)*n/2-mn)
print(res)
import math

[N,X] = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]

xs.append(X)
xs = sorted(xs)

d = [y-x for x,y in zip(xs[:-1], xs[1:])]

ans = d[0]
for i in range(1, len(d)):
    ans = math.gcd(ans, d[i])
print(ans)


### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


[N,X] = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]

xs.append(X)
xs = sorted(xs)

d = [y-x for x,y in zip(xs[:-1], xs[1:])]

ans = d[0]
for i in range(1, len(d)):
    ans = gcd(ans, d[i])
print(ans)
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
a, b = map(int, input().split())
print(lcm(a, b))

### FIXED CODE ###

def gcd(a, b):
    while b!=0:
        a,b = b, a%b
    return a

def lcm(a, b):
    return a*b//gcd(a,b)

a, b = map(int, input().split())
print(lcm(a, b))
import math

d = input()
m = []
itr = 0
cnt = 0
N = 0
X = 0
min_m = 0
for i in range(d):
	if itr == 0:
		e = input().split()
		N = e[0]
		X = e[1]
	else:
		X = X - input()
		mi = input()
		if min_m == 0 or min_m > mi
			min_m = mi
	itr = itr + 1
print(N + math.floor(X/mi))

### FIXED CODE ###

import math

d = list(map(int,input().split(' ')))
N = d[0]
X = d[1]
min_m = 0

for i in range(N):
	mi = int(input())
	X = X - mi
	if min_m == 0 or min_m > mi:
		min_m = mi

print(N + math.floor(X/min_m))
def main():
    n = int(input())
    A = list(map(int, input().split()))
    B = [0] * n
    ans = []
    for i, a in enumerate(A[::-1]):
        i = n - i
        b = sum(B[i::i])
        if b % 2 != a:
            ans.append(str(i))
            B[i] = 1
    print(len(ans))
    print(' '.join(ans))

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    A = list(map(int, input().split()))
    B = [0] * n
    ans = []
    for i, a in enumerate(A[::-1]):
        i = n - i
        b = sum(B[i - 1::i])
        if b % 2 != a:
            ans.append(str(i))
            B[i - 1] = 1
    print(len(ans))
    print(' '.join(ans))

if __name__ == '__main__':
    main()
import numpy as np
 
N = int(input())
x_list = np.array(list(map(int, input().split()))).reshape(1,N)

print(np.sum(np.sum(x_list%x_list.reshape(N,1)==0, axis=0)==1))

### FIXED CODE ###

N = int(input())
a_list = sorted(list(map(int, input().split())))
a_max = a_list[-1]

count = [0] * (a_max+1)

for a in a_list:
  for j in range(a, a_max+1, a):
    count[j] += 1
  
ans = 0
for a in a_list:
  if count[a] == 1:
    ans += 1
print(ans)