Harryxun/stf_run huggingface dataset:
import math
nums=list(map(int,input().split(" ")))
g=math.gcd(nums[0],nums[1])
arr=[0 for i in range(100)]
a=0
for i in range(100):
    i+=1
    if nums[0]%i==0 and nums[1]%i==0:
        arr[a]=i
        a+=1
        if i==g:
            print(arr[a-nums[2]])
            break     

### FIXED CODE ###

def gcd(m,n):
    x=max(m,n)
    y=min(m,n)
    if x%y == 0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        else:
            return z

nums=list(map(int,input().split(" ")))
g=gcd(nums[0],nums[1])
arr=[0 for i in range(100)]
a=0
for i in range(100):
    i+=1
    if nums[0]%i==0 and nums[1]%i==0:
        arr[a]=i
        a+=1
        if i==g:
            print(arr[a-nums[2]])
            break
K = int(input("multiple of: "))
A = int(input("From A: "))
B = int(input("To B:"))
for i in range(1, 1000):
    M = K * i
    if M in range(A, B):
        print("OK")
        break
    elif i == 100 and M not in range(A, B):
        print("NG")
    else: 
        continue


### FIXED CODE ###

K = int(input())
A, B = map(int, input().split())
word = "NG"
for i in range(A, B+1):
    if i % K == 0:
        word = "OK"
print(word)
import sys

def main():
  input = sys.stdin.readline
  N = int(input())
  A = int(input())
  B = int(input())
  if N == 1:
    print('Hello World')
  else:
    print(A + B)


if __name__ == '__main__':
  main()

### FIXED CODE ###

import sys
 
def main():
  input = sys.stdin.readline
  N = int(input())
  if N == 1:
    print('Hello World')
  else:
    A = int(input())
    B = int(input())
    print(A + B)
 
 
if __name__ == '__main__':
  main()
S = int(input())
LENS = int((len(S))/2)
mae = S[0:LENS]
usiro = S[LENS:len(S)]

if mae == usiro:
    print("Yes")
else:
    print("No")

    

### FIXED CODE ###

N = int(input())
S = input()
if N%2==1:
    print("No")
else:
    center = int(len(S)/2)
    if S == S[:center]*2:
        print("Yes")
    else:
        print("No")
n=int(input())
#ne,[7,5,3,1,1,3,5,7]8
#no,[8,6,4,2,0,2,4,6,8]9
m=[0]*n
for i in map(int,input().split()):
  m[i]+=1
ans=1
for i in range(n-1,0,-2):
  d[i]!=2:
    ans=0
if d[0]!=n%2:
  ans=0
if ans:
  print(2**(n//2)%1000000007)
else:
  print(0)
    

### FIXED CODE ###

n=int(input())
#ne,[7,5,3,1,1,3,5,7]8
#no,[8,6,4,2,0,2,4,6,8]9
m=[0]*n
for i in map(int,input().split()):
  m[i]+=1
ans=1
for i in range(n-1,0,-2):
  if m[i]!=2:
    ans=0
if m[0]!=n%2:
  ans=0
if ans:
  print(2**(n//2)%1000000007)
else:
  print(0)
n,k = map(int,input().split())
V = list(map(int,input().split()))
ans = 0
T = []
for i in range(k+1):
    if i <= n:
        for a in range(i+1):
            L = V[0:a]+V[n-i+a:n]
            L.sort()
            cur = sum(L)
            for b in range(k-i):
                if b < len(L):
                    if L[b] < 0:
                        cur -= L[b]
            if cur > ans:
                ans = cur
    else:
        L = V
        L.sort()
        cur = sum(L)
        for b in range(k-n):
            if L[b] < 0:
                cur -= L[b]
        if cur > ans:
            ans = cur
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
V = list(map(int,input().split()))
ans = 0
T = []
for i in range(k+1):
    if i <= n:
        for a in range(i+1):
            L = V[0:a]+V[n-i+a:n]
            L.sort()
            cur = sum(L)
            for b in range(k-i):
                if b < len(L):
                    if L[b] < 0:
                        cur -= L[b]
            if cur > ans:
                ans = cur
    else:
        L = V
        L.sort()
        cur = sum(L)
        for b in range(k-i):
            if b < len(L):
                if L[b] < 0:
                    cur -= L[b]
        if cur > ans:
            ans = cur
print(ans)
ary = raw_input().split()
for line in ary:
	a, o, b = line.split()
	a = int(a)
	b = int(b)
	if o == "+":
		print a + b
	elif o == "-":
		print a - b
	elif o == "*":
		print a * b
	elif o == "/":
		print a / b

### FIXED CODE ###


while 1:
	a, o, b = raw_input().split()
	a = int(a)
	b = int(b)
	if o == "+":
		print a + b
	elif o == "-":
		print a - b
	elif o == "*":
		print a * b
	elif o == "/":
		print a / b
	elif o == "?":
		break
N,M=map(int,input().split())
list_A=input().split()
for i in range(len(list_A)):
    list_A[i]=int(list_A[i])
A =int(sum(list_A)/(4*M))
if M<len([i for i in list_A if i> A]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

X,Y,Z=map(int,input().split())
print(Z,X,Y)
A, B = map(int, input().split())
D = []
E = set()
total = A
for i in range(B):
    C = int(input())
    D = map(int, input().split())
    E.add(D)
for i in range(1, A+1):
  if str(i) in str(E):
    total = total - 1
print(total)

### FIXED CODE ###

I = input()
print("ABC" if I == "ARC" else "ARC")
def main():
  n = int(input())
  P = map(int, input().split())

  count = 0
  p1 = P[0]
  p2 = P[1]
  for i in range(2, n):
    p3 = P[i]
    if p1 < p2 < p3 or p1 > p2 > p3:
      count += 1
    p1 = p2
    p2 = p3

main()


### FIXED CODE ###

def main():
    n = int(input())
    P = list(map(int, input().split()))

    count = 0
    p1 = P[0]
    p2 = P[1]
    for i in range(2, n):
        p3 = P[i]
        if p1 < p2 < p3 or p1 > p2 > p3:
            count += 1
        p1 = p2
        p2 = p3

    print(count)


main()
sn,qn=map(int,input().split())
s=input()
x=list(list(map(int,input().split())) for _ in range(qn))

import math

s2=[0]*(sn+1)

for i in range(sn):
	if s[i]=='A' and s[i+1]=='C':
		s2[i]=0.5
		s2[i+1]=0.5

al=sum(s2)

for i in range(qn):
	res=al-math.ceil(sum(s2[:x[i][0]-1]))-math.ceil(sum(s2[x[i][1]:]))
	print(int(res))

### FIXED CODE ###

sn,qn=map(int,input().split())
s=input()
x=list(list(map(int,input().split())) for _ in range(qn))

s2=[0]*sn

for i in range(sn-1):
	if s[i]=='A' and s[i+1]=='C':
		s2[i+1]=s2[i]+1
	else:
		s2[i+1]=s2[i]

for i in range(qn):
	res=s2[x[i][1]-1]-s2[x[i][0]-1]
	print(res)
import sys

n = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
cnt=0
while True:
    for i, a in enumerate(A):
        if a > i+1:
            A.pop(i)
            cnt+=1
        if A[i] != i+1:
            A.pop(i)
            cnt+=1
            break
    else:
        break

if len(A)==0:
    print(-1)
else:
    print(cnt)

### FIXED CODE ###

import sys

n = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
cnt=0
i=1
for a in A:
    if a ==i:
        i+=1
 
ans =n-i+1
if ans ==n:
    print(-1)
else:
    print(ans)
import sys
import numpy as np


def main():
    f = sys.stdin.buffer
    N, K = map(int, f.readline().split())
    H = list(map(int, f.readline().split()))
    dp = [0] * N
    for i in range(1, N):
        dp[i] = min(
            dp[i - k - 1] + abs(H[i] - H[i - k - 1]) for k in range(K) if i - k - 1 >= 0
        )
    print(dp[-1])


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
f = sys.stdin
n = int(f.readline())
h = list(map(int, f.readline().split()))
dp = [0]*n
dp[1] = abs(h[1] - h[0])
for i in range(2, n):
    dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))
print(dp[-1])
a = input()
if a[6] > 4:
  print('TBD')
elif a[6] < 3:
  print('heisei')
else:
  if a[8] < 2:
    print('heisei')
  else:
    if a[9] > 0:
      print('heisei')
    else:
      print('TBD')
 

### FIXED CODE ###

a = input()
if int(a[5]) == 1:
  print('TBD')
else:
  if int(a[6]) > 4:
    print('TBD')
  else:
    print('Heisei')
#Nが問題数Mが提出数
N, M = map(int, input().split())

submit = []
for _ in range(M):
  temp = [x for x in input().split()]
  submit.append(temp)

ac = [0]*(N + 1)
wa = [0]*(N + 1)
  
for i in range(M):
  result = submit[i][1]
  question = int(submit[i][0])
  
  if result == 'AC' and ac[question] == 0:
    ac[question] = 1
  elif result == 'WA' and ac[question] == 0:
    wa[question] += 1

for i in range(n + 1):
  if ac[i] != 1:
    wa[i] = 0

print(sum(ac), sum(wa))
  

### FIXED CODE ###

#Nが問題数Mが提出数
N, M = map(int, input().split())
 
submit = []
for _ in range(M):
  temp = [x for x in input().split()]
  submit.append(temp)
 
ac = [0]*(N + 1)
wa = [0]*(N + 1)
  
for i in range(M):
  result = submit[i][1]
  question = int(submit[i][0])
  
  if result == 'AC' and ac[question] == 0:
    ac[question] = 1
  elif result == 'WA' and ac[question] == 0:
    wa[question] += 1
 
for i in range(N + 1):
  if ac[i] != 1:
    wa[i] = 0
 
print(sum(ac), sum(wa))
N, A, B = map(int, input().split())
l = ""
cnt = 0
for i in range(N + 1):
    n1 = "b" * A
    n2 = "r" * B
    l += n1 + n2
    
for j in l[0 : N]:
    if j == "b":
        cnt += 1
          
print(cnt)


### FIXED CODE ###

n, a, b = map(int,input().split())
if a == 0 and b == 0:
    print(0)
if a != 0 or b != 0:
         
    kumi = n // (a + b)
    nokori = n % (a + b)
    if nokori == 0:
        print(a * kumi)
    elif nokori >= 1 and nokori < a:
        print(a * kumi + nokori)
    elif nokori >= a:
        print(a * kumi + a)
n,m = list(map(int, input().split()))
 
ac = [0]*n
wa = [0]*n
pena = 0
 
for i in range(m):
  question, answer = input().split()
  question = int(question)
  
  if (answer=="AC") and (ac[question]==0):
    ac[ques] = 1
    pena += wa[ques]
  elif (answer=="WA") and (ac[question]==0):
    wa[question] += 1
    
print(sum(ac), pena)

### FIXED CODE ###

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

ac = [0] * (n+1)
wa = [0] * (n+1)
pena = 0

for i in range(m):
    question, answer = input().split()
    question = int(question)
    if (answer == "AC") and (ac[question] == 0):
        ac[question] = 1
        pena += wa[question]
    elif (answer == "WA") and (ac[question] == 0):
        wa[question] += 1

print(sum(ac), pena)
a=input()
b=input()
s=["1","2","3"]
s.remove(x)
s.remove(y)
print s[0]

### FIXED CODE ###

a=input()
b=input()
if a==1 and b==2:
  print "3"
elif a==2 and b==3:
  print "1"
elif a==3 and b==1:
  print "2" 
elif a==3 and b==2:
  print "1"
elif a==2 and b==1:
  print "3"
else:
  print "2"
def insertionSort(_list, _length):
    for i in range(1, _length):
        ll = [str(_l) for _l in _list]
        print(' '.join(ll))
        val = _list[i]
        j = i - 1
        while j >= 0 and _list[j] > val:
            _list[j+1] = _list[j]
            j -= 1
        _list[j+1] = val
    ll = [str(_l) for _l in _list]
    print(' '.join(ll))


import sys
 
length = input()
eles = map(int, sys.stdin.readlines())

insertionSort(eles, length)

### FIXED CODE ###

length = int(input())
eles = [int(i) for i in input().split()]

for i in range(length):
    val = eles[i]
    j = i - 1
    while j >= 0 and eles[j] > val:
        eles[j+1] = eles[j]
        j -= 1
    eles[j+1] = val
    print(*eles)
h, w = map(int, input().split())
lis = [] * h
for i in range(h):
    lis.append(tuple(map(int, input().split())))
flg = False
res = []

for i in range(h):
    if i % 2 == 0:
        for j in range(w):
            if not flg and lis[i][j] % 2 == 1:
                res.append(i+1)
                res.append(j+1)
                flg = not flg
            elif flg and lis[i][j] % 2 == 0:
                print(*res, i+1, j+1, sep=" ")
                res = []
                res.append(i+1)
                res.append(j+1)
            elif flg and lis[i][j] % 2 == 1:
                print(*res, i+1, j+1, sep=" ")
                res = []
                flg = not flg
    else:
        for j in range(w -1, -1, -1):
            if not flg and lis[i][j] % 2 == 1:
                res.append(i + 1)
                res.append(j + 1)
                flg = not flg
            elif flg and lis[i][j] % 2 == 0:
                print(*res, i + 1, j + 1, sep=" ")
                res = []
                res.append(i + 1)
                res.append(j + 1)
            elif flg and lis[i][j] % 2 == 1:
                print(*res, i + 1, j + 1, sep=" ")
                res = []
                flg = not flg


### FIXED CODE ###

h, w = map(int, input().split())
lis = [] * h
for i in range(h):
    lis.append(tuple(map(int, input().split())))
flg = False
res = []
ans = []
for i in range(h):
    if i % 2 == 0:
        for j in range(w):
            if not flg and lis[i][j] % 2 == 1:
                res.append(i+1)
                res.append(j+1)
                flg = not flg
            elif flg and lis[i][j] % 2 == 0:
                ans.append([res[0], res[1], i+1, j+1])
                res = []
                res.append(i+1)
                res.append(j+1)
            elif flg and lis[i][j] % 2 == 1:
                ans.append([res[0], res[1], i+1, j+1])
                res = []
                flg = not flg
    else:
        for j in range(w -1, -1, -1):
            if not flg and lis[i][j] % 2 == 1:
                res.append(i + 1)
                res.append(j + 1)
                flg = not flg
            elif flg and lis[i][j] % 2 == 0:
                ans.append([res[0], res[1], i+1, j+1])
                res = []
                res.append(i + 1)
                res.append(j + 1)
            elif flg and lis[i][j] % 2 == 1:
                ans.append([res[0], res[1], i+1, j+1])
                res = []
                flg = not flg
print(len(ans))
for a in ans:
    print(*a)
s=int(input())

if s[0] == 1:
    print(a)
elif s[1] == 1:
    print(a)
elif s[2] == 1:
    print(a)
else:
    print(b)
print(count(a))

### FIXED CODE ###

s = input()
count = 0 
if s[0] == '1':
    count += 1
if s[1] == '1':
    count += 1
if s[2] == '1':
    count += 1
print(count)
n,m=map(int,input().split())
a = []
b = []
ans = 0
for i in range(n):
    tempa,tempb = map(int,input().split())
    a.append(tempa)
    b.append(tempb)
test = dict(zip(a,b))
test = sorted(test.items())
print(test)
# test_item = test.values()
# test_key = test.keys()
# print(test_item)
# print(test_key)
# for i in range(n):
#     if m-test[i][1] >=0:

i=0
while m>0:
    if m-test[i][1] >=0:
        ans += test[i][0]*test[i][1]
        m -=test[i][1]
        i += 1
    else:
        ans += test[i][0]*m
        m=0
        print(ans)
        exit()
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
a = []
b = []
ans = 0
for i in range(n):
    tempa,tempb = map(int,input().split())
    a.append(tempa)
    b.append(tempb)
test = list(zip(a,b))
test = sorted(test)
i=0
while m>0:
    if m-test[i][1] >=0:
        ans += test[i][0]*test[i][1]
        m -=test[i][1]
    else:
        ans += test[i][0]*m
        m=0
        print(ans)
        exit()
    i+=1
print(ans)
N = int(raw_input())
count = 0

A_str = raw_input().split()
A = map(int, A_str)

def merge(left, right):
    global count
    sorted_list = []
    l_index = 0
    r_index = 0

    while l_index < len(left) and r_index < len(right):
        count += 1
        if left[l_index] <= right[r_index]:
            sorted_list.append(left[l_index])
            l_index += 1
        else:
            sorted_list.append(right[r_index])
            r_index += 1

    if len(left) != l_index:
        sorted_list.extend(left[l_index:])
        count += len(left[l_index:])
    if len(right) != r_index:
        sorted_list.extend(right[r_index:])
        count += len(right[r_index:])

    return sorted_list 

def mergeSort(A):
    
    if len(A) <= 1:
        return A

    mid = len(A) // 2
    left = A[:mid]
    right = A[mid:]

    left = mergeSort(left)
    right = mergeSort(right)

    return list(merge(left, right))

print ' '.join(map(str, mergeSort(A)))print count
print count

### FIXED CODE ###

N = int(raw_input())
count = 0

A_str = raw_input().split()
A = map(int, A_str)

def merge(left, right):
    global count
    sorted_list = []
    l_index = 0
    r_index = 0

    while l_index < len(left) and r_index < len(right):
        count += 1
        if left[l_index] <= right[r_index]:
            sorted_list.append(left[l_index])
            l_index += 1
        else:
            sorted_list.append(right[r_index])
            r_index += 1

    if len(left) != l_index:
        sorted_list.extend(left[l_index:])
        count += len(left[l_index:])
    if len(right) != r_index:
        sorted_list.extend(right[r_index:])
        count += len(right[r_index:])

    return sorted_list 

def mergeSort(A):
    
    if len(A) <= 1:
        return A

    mid = len(A) // 2
    left = A[:mid]
    right = A[mid:]

    left = mergeSort(left)
    right = mergeSort(right)

    return list(merge(left, right))

print ' '.join(map(str, mergeSort(A)))
print count
a, b, c = input()
d, e, f = input()
if a == d and b == e and c == f:
  print(3)
elif a == b and b == e:
  print(2)
elif b == e and c == f:
  print(2)
elif c == f and a == b:
  print(2)
elif a == d or b == e or c == f:
  print(1)
elif a != d and b != e and c != f:
  peint(0)
else:
  pass

### FIXED CODE ###

s = input()
t = input()
 
count = 0
 
for i in range(3):
		if s[i] == t[i]:
			count += 1  
    
print(count)
import sys
import numpy as np
import itertools

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
A = np.array([0] + lr())
A_cum = A.cumsum()
beauties = []
for i, j in itertools.combinations(range(N+1), 2):
    beauties.append(A_cum[j] - A_cum[i])

beauties = np.array(beauties)
j = 0
def check(x):
    return np.sum(beauties&x == x) >= K

answer = 0
for i in range(40, -1, -1):
    if check(answer + 1 << i):
        answer += 1 << i

print(answer)
# 00


### FIXED CODE ###

import sys
import numpy as np
import itertools

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
A = np.array([0] + lr())
A_cum = A.cumsum()
beauties = []
for i, j in itertools.combinations(range(N+1), 2):
    beauties.append(A_cum[j] - A_cum[i])

beauties = np.array(beauties)
j = 0
def check(x):
    return np.sum(beauties&x == x) >= K

answer = 0
for i in range(40, -1, -1):
    if check(answer + (1 << i)):
        answer += 1 << i

print(answer)
# 00
import math
from sys import stdin
N,P=[int(x) for x in stdin.readline().rstrip().split()]
for i in reversed(range(int(math.pow(P,(1/N)))+2)):
    tmp=math.pow(i,N-1)
    if P==1:
        ans=1
        break
    if N==1:
        ans=P
        break
    if (P/i)%tmp==0:
        ans=i
        break
print(ans)

### FIXED CODE ###

import math
from sys import stdin
N,P=[int(x) for x in stdin.readline().rstrip().split()]
for i in reversed(range(round(math.pow(P,(1/N)))+1)):
    tmp=math.pow(i,N)
    if P==1:
        ans=1
        break
    if N==1:
        ans=P
        break
    if P%tmp==0:
        ans=i
        break
print(ans)
INF = 10**20
N,M = map(int,input().split())
node = [[] for _ in range(N)]
for _ in range(M):
  l,r,d = map(int,input().split())
  node[l-1].append([r-1,d])
  node[r-1].append([l-1,-1*d])

ans = "Yes"
pos = [INF]*N
for i in range(N):
  if pos[i]==INF:
    que = [[i,0]]
    while(que):
      c,cp = que.pop()
      if pos[c]=INF:
        pos[c] = cp
        for n,d in node[c]:
          if pos[n]==INF:
            que.append([n,cp+d])
          elif pos[n] != cp+d:
            ans="No"
            break
        else:
          continue
        break
      elif pos[c] != cp:
        ans="No"
        break
    else:
      continue
    break
print(ans)
      
      
    

### FIXED CODE ###

INF = 10**20
N,M = map(int,input().split())
node = [[] for _ in range(N)]
for _ in range(M):
  l,r,d = map(int,input().split())
  node[l-1].append([r-1,d])
  node[r-1].append([l-1,-1*d])

ans = "Yes"
pos = [INF]*N
for i in range(N):
  if pos[i]==INF:
    que = [[i,0]]
    while(que):
      c,cp = que.pop()
      if pos[c]==INF:
        pos[c] = cp
        for n,d in node[c]:
          if pos[n]==INF:
            que.append([n,cp+d])
          elif pos[n] != cp+d:
            ans="No"
            break
        else:
          continue
        break
      elif pos[c] != cp:
        ans="No"
        break
    else:
      continue
    break
print(ans)
x,y = map(int, input().split())
ans = 0
d = [300000,200000,100000]
if 1<=x and x<=3:
    ans += d[x-1]

if 1<=y and y<=3:
    ans += d[x-1]

if x==y and x==1:
    ans += 400000

print(ans)

### FIXED CODE ###

x,y = map(int, input().split())
ans = 0
d = [300000,200000,100000]
if 1<=x and x<=3:
    ans += d[x-1]

if 1<=y and y<=3:
    ans += d[y-1]

if x==y and x==1:
    ans += 400000

print(ans)
a=int(input())
b=int(input())
print((a-1)*(b-1))

### FIXED CODE ###

a,b=(int(i) for i in input().split())
print((a-1)*(b-1))
import math

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

# A * N + B * d(N) yen 

check_num = [1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000]

if((A*1+B*1)>X):
    print(0)
else:
    flag = True
    for i in range(len(check_num)):
        if((A*check_num[i]+B*(i+1)) > X):
            flag = False
            break
    if(flag):
        print(10**9)
    else:
        value = math.ceil((X - B*i)/A)
        print(value-1)


### FIXED CODE ###


N = int(input())
words = list(input())

for i in range(len(words)):
    check_word  = ord(words[i]) + N 
    if(check_word > ord('Z')):
        print(chr(ord('A') + (check_word - ord('Z'))-1),end="")
    else:
        print(chr(check_word),end="")
print()
# import sys
# sys.setrecursionlimit(10**7)

def main():
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a%b)

    def lcm(a, b):
        return int(a / gcd(a, b)) * b
    
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_ = 1
    for a in A:
        a_lcm = lcm(a_, a)
        a_ = a_lcm
    if a_lcm / 2 > m:
        print(0)
    else:
        ans = int((m - (a_lcm / 2))) // a_lcm + 1
        print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


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

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()
arr=[int(i) for i in input()]
csum=[arr[0]]
for i in range(1,len(arr)):
  csum.append(csum[-1]+arr[i])
maxsum= csum[-1]

print(max(maxsum,arr[0]-1+9*(len(are)-1)))

### FIXED CODE ###

arr=[int(i) for i in input()]
csum=[arr[0]]
for i in range(1,len(arr)):
  csum.append(csum[-1]+arr[i])
maxsum= csum[-1]

print(max(maxsum,arr[0]-1+9*(len(arr)-1)))
improt sys

def solve (a,b):
    c=int(b)//2
    D=int(a)+int(c)
    print(D)

def readQuestion（）：
    ws = sys.stdin.readline（）。strip（）。split（）
    a = int（ws [0]）
    b = int（ws [1]）
    return（a、b）

def main（）：
    print（solve（* readQuestion（）））

＃提出前にコメントを外す
main（）

### FIXED CODE ###

import sys

def solve(a, b):
    return(int(a)+int(b)//2)


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    a = int(ws[0])
    b = int(ws[1])
    return (a, b)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
main()
x,y,z = map(int, input().split())
ret = (x-z)//(y+z)
print(ret)


### FIXED CODE ###

c1 = input()
c2 = input()
if c1 == c2[::-1]:
    print('YES')
else:
    print('NO')
S = input()

if S == 'Sunny':
	print('Cloudy')
else if S == 'Cloudy':
	print('Rainy')
else if S == 'Rainy':
	print('Sunny')


### FIXED CODE ###

s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
N = int(input())
A = int(input())
B = int(input())

if N == 1:
    print("Hello World")
elif N == 2:
    print(A+B)

### FIXED CODE ###

N = int(input())

if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A+B)