Harryxun/stf_run huggingface dataset:
import math
N,M = map(int,input().split())
S = input()
T = input()

flag = True
for n in range(N):
    if (M*n)%N==0:
        m = M*n//N
        flag = S[n]==T[m]
        if not flag:
            break

if flag:
    print(N*M//math.gcd(N,M))
else:
    print(-1)


### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
N,M = map(int,input().split())
s = input()
t = input()
g = gcd(N,M)
l = N*M//g

n = N//g
m = M//g

ans = l

for i in range(g):
    if s[i*n]!=t[i*m]:
        ans = -1
        break
print(ans)
import math
a = int(input())
s = 1
for i in range(a):
    t= int(input())
    s = (t*s)//math.gcd(t,s)
print(s)
    


### FIXED CODE ###


def gcd(x,y):
    if x==0:return y
    else:return gcd(y%x,x)
a = int(input())
s = 1
for i in range(a):
    t= int(input())
    s = (t*s)//gcd(t,s)
print(s)
a=[]
for i in range(3):
  aa=list(map(str,input().split()))
  a.append(aa)
  
n=int(input())
ln=[]
for i in range(n):
  lnn=input()
  ln.append(lnn)
  
visited=[[0]*3 for i in range(3)]

for i in range(3):
  for j in range(3):
    for k in range(n):
      if ln[k] in a[i][j]:
        visited[i][j]=1

for j in range(3):
  if all([visited[i][j] for i in range(3)])==1:
    print('Yes')
    exit()
    
for i in range(3):
  if all([visited[i][j] for j in range(3)])==1:
    print('Yes')
    exit()
    
if visited[0][0]==1 and visited[1][1]==1 and visited[2][2]==1:
  print('Yes')
  exis()
  
if visited[0][2]==1 and visited[1][1]==1 and visited[2][0]==1:
  print('Yes')
  exis()
  
print('No')



### FIXED CODE ###

bingo=[]
for i in range(3):
  a=list(map(int,input().split()))
  bingo.append(a)
  
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    if b in bingo[j]:
      bingo[j][bingo[j].index(b)]=0
      
def hantei(l):
  for i in range(3):
    if all([l[i][j]==0 for j in range(3)]):
      return 'Yes'
    
    elif all([l[j][i]==0 for j in range(3)]):
      return 'Yes'
    
    elif l[0][0]==0 and l[1][1]==0 and l[2][2]==0:
      return 'Yes'
    
    elif l[0][2]==0 and l[1][1]==0 and l[2][0]==0:
      return 'Yes'
    
    else:
      continue
      
  return 'No'
    
#print(bingo)
print(hantei(bingo))
import math

n = int(input())
x = list(map(int,input().split()))

mod = 10**9 + 7

l = []
for i in range(n-1):
    d = x[i+1] - x[i]
    l.append(d)

# print(l)

f = math.factorial(n-1)

count = 0
k = f
plus = 0
for i in range(1,n):
    # print(k)
    k = f + plus
    count += l[i-1] * k
    plus += f / (i+1)

print(int(count)%mod)

### FIXED CODE ###

import math

n = int(input())
x = list(map(int,input().split()))

mod = 10**9 + 7

f = math.factorial(n-1)
f %= mod

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

l = []
for i in range(n-1):
    d = x[i+1] - x[i]
    l.append(d)

# print(l)

count = 0
k = f
plus = 0
for i in range(1,n):
    # print(k)
    k = f + plus
    count += l[i-1] * k
    plus += f * modinv(i+1,mod)

print(int(count)%mod)
X, Y = map(int, input().split())
P = 10 ** 9 + 7
N = (X+Y) // 3
R = (2 * X -Y) // 3
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]

for i in range(2, N+1):
    fact.append((fact[-1] * i) % P)
    inv.append((-inv[P % i] * (P//i) % P))
    factinv.append((factinv[-1] * inv[-1] % P))


def cmb_mod(n, r, p):
    r = min(r, n-r)
    return fact[n] * factinv[r] * factinv[n-r] % p


if (X+Y) % 3 != 0:
    print(0)
else:
    print(cmb_mod(N, R, P))


### FIXED CODE ###

X, Y = map(int, input().split())
P = 10 ** 9 + 7
N = (X+Y) // 3
R = (2 * X - Y) // 3
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]

for i in range(2, N+1):
    fact.append((fact[-1] * i) % P)
    inv.append((-inv[P % i] * (P//i) % P))
    factinv.append((factinv[-1] * inv[-1] % P))


def cmb_mod(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n-r)
    return fact[n] * factinv[r] * factinv[n-r] % p


if (X+Y) % 3 != 0:
    print(0)
else:
    print(cmb_mod(N, R, P))
from fractions import gcd
def yaku2(a):
    count=0
    while a%2:
        count+=a//2
    return(count)

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

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

yaku=yaku2(A[0])
for a in range(1,N):
    if yaku!=yaku2(A[i]):
        print(0)
        break


_lcm=A[0]
for i in range(1,N):
    A[0]=lcm(A[0],A[i])
#print(A[0])
print((M-(A[0]-A[0]//2-A[0]))//A[0])


### FIXED CODE ###

from fractions import gcd
def yaku2(a):
    count=0
    while a%2==0:
        a=a//2
        count+=1
    return(count)

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

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

yaku=yaku2(A[0])
for i in range(1,N):
    if yaku!=yaku2(A[i]):
        print(0)
        exit()



_lcm=A[0]
for i in range(1,N):
    A[0]=lcm(A[0],A[i])
#print(A[0])
print((M-(A[0]-A[0]//2-A[0]))//A[0])
import sys

radius = sys.argv[0]
print (radius * radius)

### FIXED CODE ###

import sys

r = input()
print(int(r) * int(r))
S,T = [x for x in input().split()]
A,B = [int(y) for y in input().split()]
U = input()

if S == U:
  A -= 1
elif T == U:
  B -= 1

print(f"{A} {B}")

### FIXED CODE ###

S,T = [x for x in input().split()]
A,B = [int(y) for y in input().split()]
U = input()

if S == U:
  A -= 1
elif T == U:
  B -= 1

print(A,end=" ")
print(B)
N = str(input())
enc = 0

for char in list(N):
  	if char == 7:
    	enc +=1

if enc >= 1:
  return Yes
else:
   return No

### FIXED CODE ###

N = str(input())
enc = 0

for char in list(N):
  if char == "7":
    enc += 1
    
if enc >= 1:
  print("Yes") 
else:
  print("No")
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import defaultdict

def main():
    N = II()
    xy = []
    for _ in range(N):
        xy.append(LI())
    xy2g = defaultdict(int)
    g2xy = defaultdict(set)
    for x, y in xy:
        gx = xy2g[x]
        gy = xy2g[-y]
        if gx != 0 and gy != 0:  # merge
            if len(g2xy[gx]) < len(g2xy[gy]):
                gx, gy = gy, gx
            for xy in g2xy[gy]:
                xy2g[xy] = gx
            g2xy[gx] |= g2xy[gy]
            g2xy[gx] += {x, -y}
            g2xy[gy].clear()
        else:
            g = gx or gy or x
            xy2g[x] = xy2g[-y] = g
            g2xy[g] |= {x, -y}
    ans = -N
    for xys in g2xy.values():
        m, p = 0, 0
        for xy in xys:
            if xy < 0:
                m += 1
            else:
                p += 1
        ans += m * p
    return ans

print(main())

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import defaultdict

def main():
    N = II()
    xy = []
    for _ in range(N):
        xy.append(LI())
    xy2g = defaultdict(int)
    g2xy = defaultdict(set)
    for x, y in xy:
        y = -y
        gx = xy2g[x]
        gy = xy2g[y]
        if gx != 0 and gy != 0:  # merge
            if gx == gy:
                continue
            if len(g2xy[gx]) < len(g2xy[gy]):
                gx, gy = gy, gx
            for xy in g2xy[gy]:
                xy2g[xy] = gx
            g2xy[gx] |= g2xy[gy]
            g2xy[gy].clear()
        else:
            g = gx or gy or x
            xy2g[x] = xy2g[y] = g
            g2xy[g] |= {x, y}
    ans = -N
    for xys in g2xy.values():
        m, p = 0, 0
        for xy in xys:
            if xy < 0:
                m += 1
            else:
                p += 1
        ans += m * p
    return ans

print(main())
#https://atcoder.jp/contests/abc150/tasks/abc150_b
N= int(input())

A= []
s= input()
A= list(s)


print(A)

add = 0
for i in range(0, N-1):
    if A[i]== 'A' and A[i+1]=='B' and A[i+2]=='C':
        add = add + 1

print(add)

### FIXED CODE ###

#https://atcoder.jp/contests/abc150/tasks/abc150_b
N= int(input())
s= input()

A= []
A= list(s)

#print(A)

add = 0
for i in range(0, N-2):
    if A[i]== 'A' and A[i+1]=='B' and A[i+2]=='C':
        add = add + 1

print(add)
#DivRem number
N  = int(input())
ans = 0
def divisor(N):
    div_lst = [N]
    for n in range(2, int(N ** 0.5 + 1)):
        if N % n == 0:
            if  n == int(N / n):
                div_lst.append(n)
            else:
                div_lst.append(n)
                div_lst.append(int(N / n))

    return div_lst

div_lst = divisor(N)
for m in div_lst:
    m = m - 1
    if int(N / m) == N % m:
        ans += m
print(ans)
        

### FIXED CODE ###

#DivRem number
N  = int(input())
ans = 0
def divisor(N):
    div_lst = [N] if N != 1 else []
    for n in range(2, int(N ** 0.5 + 1)):
        if N % n == 0:
            if  n == N // n:
                div_lst.append(n)
            else:
                div_lst.append(n)
                div_lst.append(N // n)

    return div_lst

div_lst = divisor(N)
for m in div_lst:
    m = m - 1
    if N // m == N % m:
        ans += m
print(ans)
a,b=input(int,input().split())
if a<10 and b<10:
  print(str(a*b))
else:
  print("-1")

### FIXED CODE ###

a,b=map(int,input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print(-1)
N=int(input())
A=list(map(int, input().split()))
cal=1
i=0
while i < len(A):
    cal*=A[i]
    i+=1
if cal>=10**18:
        print(-1)
else:
        print(cal)


### FIXED CODE ###

A,B=input().strip().split()
A,B=[int(A),int(B)]    
if A>=1 and A<=100:
    if B>=1 and B<=100:
        print(A*B)
a,b = input().split(' ')
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

a,b = input().split(' ')
a = int(a)
b = int(b)
if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')
N = int(input())
def su(n):
    s = 0
    for i in range(1,n+1):
        s += i
    return s

if N == 1:
    print(1)

else:
    for i in range(N):
        if su(i) >= N:
            M = i
            break
    print(M)

    now = N-M
    
    for i in range(1,M):
        if now - (M-i) >=(M-i):
            now -= M-i
            print(M-i)
        else:
            print(M-i)
            print(now-(M-i))
            break

### FIXED CODE ###

import math
N,K = map(int,input().split())
A = list(map(int,input().split()))
print(math.ceil((N-1)/(K-1)))
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt
import math

import bisect
import re
import heapq


from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"


def main():
    


main()




### FIXED CODE ###

from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt
import math

import bisect
import re
import heapq


from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"


def main():
    x,n = mi()
    p = li()
    for i in range(100):
        if not x-i in p:
            print(x-i)
            exit()
        elif not x+i in p:
            print(x+i)
            exit()



main()
n,m = list(map(int,input().split()))
a = [[None] for i in range(n+1)]
b = [None]*m
for i in range(m):
    p,s = list(map(int,input().split()))
    a[p].append(s)
    b[i] = [p,s]
print(a)
for i in a:
    a[i].sort()
print(a)
for i in b:
    ken = b[i][0]
    si = a[ken].index(b[i][1]) +1
    ken = str(ken).zfill(6)
    si = str(si).zfill(6)
    print("".join([ken,si]))

### FIXED CODE ###

from bisect import bisect_left


n,m = list(map(int,input().split()))
a = [[0] for i in range(n)]
b = [None]*m
for i in range(m):
    p,s = list(map(int,input().split()))
    p-=1
    a[p].append(s)
    b[i] = [p,s]
for i in range(len(a)):
    a[i].sort()
for i in range(len(b)):
    ken = b[i][0]
    si = bisect_left(a[ken], b[i][1])
    ken = str(ken+1).zfill(6)
    si = str(si).zfill(6)
    print("".join([ken,si]))
n,m,x = map(int,input().split())
a = [int(input()) for i in range(m)]
x_s = 0
x_l = 0
for i in range(m):
    if x>a[i]:
        x_l+=1
    else:
        x_s+=1
print(min(x_s,x_l))

### FIXED CODE ###

n,m,x = map(int,input().split())
a = list(map(int,input().split()))
x_s = 0
x_l = 0
for i in range(m):
    if x>a[i]:
        x_l+=1
    else:
        x_s+=1
print(min(x_s,x_l))
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
n=0
for j in range(N):
   k=V[j]-C[j]
   if k>0:
      n+=k
print(n)

### FIXED CODE ###

A,B,T=map(int,input().split(" "))
ans=T//A*B
print(ans)
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  li.append(D)
if max(li) > x:
  print(n+1)
else:
  print(c)

### FIXED CODE ###

n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)
[a,b] = input()
print a*b 2*(a+b)

### FIXED CODE ###

a,b = map(int, raw_input().split())
s = a*b
l = 2*a + 2*b
print s, l
import sys
from itertools import product
read = sys.stdin.read
sys.setrecursionlimit(1000000)

r1, c1, r2, c2 = map(int, read().split())
mod = 10 ** 9 + 7
dic = {}


def count(r, c):
    if r * c == 0:
        return 1
    if (r - 1, c) in dic:
        a = dic[(r - 1, c)]
    else:
        a = dic[(r - 1, c)] = count(r - 1, c) % mod
    if (r, c - 1) in dic:
        b = dic[(r, c - 1)]
    else:
        b = dic[(r, c - 1)] = count(r, c - 1) % mod
    return (a + b) % mod


dic[(r1 - 1, c2)] = count(r1 - 1, c2)
dic[(r2, c1 - 1)] = count(r2, c1 - 1)
res = 0
for r, c in product(range(r1, r2 + 1), range(c1, c2 + 1)):
    tmp = dic[(r, c)] = dic[(r - 1, c)] + dic[(r, c - 1)]
    res += tmp % mod
print(res % mod)

### FIXED CODE ###

import sys
read = sys.stdin.read
mod = 10 ** 9 + 7
r1, c1, r2, c2 = map(int, read().split())

def prepare(n, MOD):

    # 1! - n! の計算
    f = 1
    factorials = [1]  # 0!の分
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    # n!^-1 の計算
    inv = pow(f, MOD - 2, MOD)
    # n!^-1 - 1!^-1 の計算
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv

    return factorials, invs


fac, finv = prepare(2 * 10**6 + 10, mod)


def comb(n, k, mod=mod, fac=fac, finv=finv):
    '''
    二項係数の計算

    Parameters
    n : int
        元集合
    k : int
        元集合から選択する数
    mod : int
        あまり
    fac : list
        階乗のリスト
    finv : list
        逆元のリスト

    Returns
    c : int
        nCkの組み合わせの数
    '''
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod


answer = comb(r2 + c2 + 2, r2 + 1) - comb(r1 + c2 + 1, r1) - \
    comb(c1 + r2 + 1, c1) + comb(r1 + c1, r1)
answer %= mod
print(answer)
def main() -> None:
    H, W = map(int, input().split())
    s = ['0' + input() + '0' for _ in range(W)]
    s.insert(0, '0' * (W + 2))
    s.append('0' * (W + 2))
    for i in range(1, H):
        for j in range(1, W):
            if s[j][i] == "#":
                if s[j+1][i] == "#" or s[j-1][i] == "#" or s[j][i+1] == "#" or s[j][i-1] == "#":
                    pass
                else:
                    print("No")
                    exit()
    print("Yes")


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main() -> None:
    H, W = map(int, input().split())
    s = ['0' + input() + '0' for _ in range(H)]
    s.insert(0, '0' * (W + 2))
    s.append('0' * (W + 2))
    for i in range(1, H + 1):
        for j in range(1, W + 1):
            # print(s[i][j])
            if s[i][j] == "#":
                if s[i+1][j] == "#" or s[i-1][j] == "#" or s[i][j+1] == "#" or s[i][j-1] == "#":
                    continue
                else:
                    print("No")
                    exit()
    print("Yes")


if __name__ == '__main__':
    main()
a, b = map(int, input().split())
count = 1

for i in range(20):
    if b > count:
        count += a-1
    else:
        break
c = -(-count // a)
if a == b:
    print(c + 1)
elif count // a >= 1:
    print(c)
else:
    print(0)

### FIXED CODE ###

a,b,c = input()
d,e,f = input()
count = 0
if a == d:
    count+= 1
if b == e:
    count+= 1
if c == f:
    count+= 1
print(count)
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ai = 0
bi = 0

def read(ai, bi, count, rest):
    if rest <= 0:
        return count
    else:
        if ai >= N:
            a_c = count
        elif rest >= A[ai]:
            a_c = read(ai+1, bi, count+1, rest - A[ai])
        else:
            a_c = count

        if bi >= M:
            b_c = count
        elif rest >= B[bi]:
            b_c = read(ai, bi+1, count+1, rest - B[bi])
        else:
            b_c = count

        return max(a_c, b_c)

res = read(ai,bi,0,K)
print(res)

### FIXED CODE ###

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
cumA = [0] * (N+1)
cumB = [0] * (M+1)

point = 0
for i in range(N):
    cumA[i+1] = cumA[i] + A[i]
for i in range(M):
    cumB[i+1] = cumB[i] + B[i]

# 尺取りの要領でiを増やしjを減らす
res, j = 0, M
for i in range(N+1):
    if cumA[i] > K:
        break
    while cumB[j] > K - cumA[i]:
        j -= 1
    res = max(res, i+j)

print(res)
def main():
    S = [int(s) for s in list(input())]
    K = int(input())
    for i in S:
        if i != 1:
            print(i)
            break


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    A, B = map(int, input().split())
    print(A*B-(A+B)+1)

if __name__ == "__main__":
    main()
a, b = map(int, input().split())

if a + b == 15:
    print("+"):
elif a * b == 15:
    print("*")
else:
    print("x")

### FIXED CODE ###

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

if a + b == 15:
    print("+")
elif a * b == 15:
    print("*")
else:
    print("x")
ef suber(c, k):
    if ord('a')<=ord(c):
        w = ord(c) - ord('a')
        if w < k:
            return chr(ord('Z') - (k - w - 1)) if k<=26 else chr(ord('z') - (k - w - 27))
        return chr(ord('a') + (w - k))
    else:
        w = ord(c) - ord('A')
        if w < k:
            return chr(ord('z') - (k - w - 1)) if k<=26 else chr(ord('Z') - (k - w - 27))
        return chr(ord('A') + (w - k))
while True:
    n = input()
    if n==0:
        break
    k = map(int, raw_input().split())
    s = raw_input()
    print "".join(suber(s[i], k[i%n]) for i in xrange(len(s)))

### FIXED CODE ###

station = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
while True:
    n = input()
    if n==0:
        break
    k = map(int, raw_input().split())
    s = raw_input()
    print "".join(station[(station.find(s[i])-k[i%n]+52)%52] for i in xrange(len(s)))
w = []
num = 0
for i in a:
    if 1 <= i <= 399:
        if 1 not in w:
            w.append(1)
    elif 400 <= i <= 799:
        if 400 not in w:
            w.append(400)
    elif 800 <= i <= 1199:
        if 800 not in w:
            w.append(800)
    elif 1200 <= i <= 1599:
        if 1200 not in w:
            w.append(1200)
    elif 1600 <= i <= 1999:
        if 1600 not in w:
            w.append(1600)
    elif 2000 <= i <= 2399:
        if 2000 not in w:
            w.append(2000)
    elif 2400 <= i <= 2799:
        if 2400 not in w:
            w.append(2400)
    elif 2800 <= i <= 3199:
        if 2800 not in w:
            w.append(2800)
    else:
        num += 1
if 0 < len(w):
    print(len(w), len(w)+num)
else:
    print(1, len(w)+num)

### FIXED CODE ###

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

w = []
num = 0
for i in a:
    if 1 <= i <= 399:
        if 1 not in w:
            w.append(1)
    elif 400 <= i <= 799:
        if 400 not in w:
            w.append(400)
    elif 800 <= i <= 1199:
        if 800 not in w:
            w.append(800)
    elif 1200 <= i <= 1599:
        if 1200 not in w:
            w.append(1200)
    elif 1600 <= i <= 1999:
        if 1600 not in w:
            w.append(1600)
    elif 2000 <= i <= 2399:
        if 2000 not in w:
            w.append(2000)
    elif 2400 <= i <= 2799:
        if 2400 not in w:
            w.append(2400)
    elif 2800 <= i <= 3199:
        if 2800 not in w:
            w.append(2800)
    else:
        num += 1
if 0 < len(w):
    print(len(w), len(w)+num)
else:
    print(1, len(w)+num)
A,B = map(int(input()).split())

if A >= 13:
  print(B)
elif 6<=A<=12:
  print(B/2)
else:
  print(0)

### FIXED CODE ###

A,B = map(int,input().split())
 
if A >= 13:
  print(B)
elif 6<=A<=12:
  print(B//2)
else:
  print("0")
import numpy as np

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

c = np.where(a < 3200, a//400, 8)
j = np.count_nonzero(c == 8)
ans = min(8, len(np.unique(c)) - 1 + j) if j else len(np.unique(c))
print(ans)

### FIXED CODE ###

a = int(''.join(input().split()))
ans = "YES" if a%4 == 0 else "NO"
print(ans)
N = int(input())
A = [int(n) for n in input().split()]

def main():
    a = sorted(A)
    even = a[0] == 0
    aborted = False
    for i in range(N):
        correct = (i if even else i + 1) - (0 if i % 2 == 0 else 1)
        if a[i] != correct:
            aborted = True
            break
    ans = 0 if aborted else int(2 ** ((N - (1 if even else 0)) / 2))
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

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

def main():
    d = {}
    for a in A:
        if a not in d:
            d[a] = 0
        d[a] += 1
    ks =  all(map(lambda k: k % 2 == 0, d.keys())) or all(map(lambda k: k % 2 != 0, d.keys()))
    if 0 in d:
        d[0] += 1
    vs = all(map(lambda v: v == 2, d.values()))

    if ks and vs:
        n = N if N % 2 == 0 else N - 1
        n //= 2
        ans = 1
        for _ in range(n):
            ans *= 2
            ans %= 1000000007
    else:
        ans = 0
    print(ans)

if __name__ == '__main__':
    main()
import fractions

n, m = map(int, input().split(" "))
numbers = list(set(map(int, input().split(" "))))

for i in range(len(numbers)):
    if i == 0:
        a = numbers[i]
    else:
        a = fractions.gcd(a, numbers[i])

lcm = a
for i in range(len(numbers)):
    lcm *= int(numbers[i] / a)

if int(lcm/a) % 2 == 0:
    print(0)
else:
    init_num = lcm / 2
    print(int((m - init_num) // lcm) + 1)

### FIXED CODE ###

# coding: utf-8
# Your code here!
 
import fractions
 
n, m = map(int, input().split(" "))
numbers = list(set(map(int, input().split(" "))))
 
for i in range(len(numbers)):
    if i == 0:
        gcd = numbers[i]
        lcm = numbers[i]
    else:
        gcd = fractions.gcd(gcd, numbers[i])
        lcm = (lcm * numbers[i]) // fractions.gcd(lcm, numbers[i])
 
if (lcm//gcd) % 2 == 0:
    print(0)
else:
    init_num = lcm // 2
    print((m - init_num) // lcm + 1)