Harryxun/stf_run huggingface dataset:
def main():
    temp = [True] * (10 ** 12)
    temp[0] = False
    temp[1] = False
    for i in range(2, 10 ** 12):
        if temp[i]:
            cnt = 2 * i
            while cnt < 10 ** 12:
                temp[cnt] = False
                cnt += i
    prime = []
    for i in range(10 ** 12):
        if temp[i]:
            prime.append(i)

    n = int(input())
    ans = 0
    for i in prime:
        if i > n ** 0.5 + 1:
            break
        if n % i:
            continue
        div = 0
        tempN = n
        while True:
            cnt = 1
            while tempN % (i ** (2 * cnt)) == 0:
                cnt += 1
            if tempN % (i ** cnt):
                break
            div += cnt
            tempN = tempN // (i ** cnt)
        #print(div)
        if div > 2:
            div = int((div * 2) ** 0.5)
        else:
            div = 1
        #print(i, div, tempN)
        ans += div

    print(ans)
    return

if __name__ == "__main__":
    main()

### FIXED CODE ###

# Contest No.: ABC169
# Problem No.: D
# Solver:      JEMINI
# Date:        20200531

import sys
import heapq

def main():
    temp = [True] * (10 ** 6 + 10)
    temp[0] = False
    temp[1] = False
    for i in range(2, 10 ** 6 + 10):
        if temp[i]:
            cnt = 2 * i
            while cnt < 10 ** 6 + 10:
                temp[cnt] = False
                cnt += i
    prime = []
    for i in range(10 ** 6 + 10):
        if temp[i]:
            prime.append(i)
 
    n = int(input())
    ans = 0
    tempN = n
    for i in prime:
        if i > tempN:
            break
        if tempN % i:
            continue
        div = 0
        while tempN % i == 0:
            tempN = tempN // i
            div += 1
        tempAns = int((div * 2) ** 0.5)
        if tempAns * (tempAns + 1) // 2 > div:
            tempAns -= 1
        #print(tempAns)
        ans += tempAns
    if tempN > 1:
        ans += 1
    print(ans)
    return
 
if __name__ == "__main__":
    main()
year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 && month<5:
  print("Heisei")
else:
  print("TBD")

### FIXED CODE ###

year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 and month<5:
  print("Heisei")
else:
  print("TBD")
n = int(input())
s = set()
for _ in range(n):
    string = input()
    s.add(string)
return len(s)    
    


### FIXED CODE ###

n = int(input())
s = set()
for _ in range(n):
    string = input()
    s.add(string)
print(len(s))
N, K = map(int, input().split())

def calculate_Expectation(n):
    n = int(n)
    p = 1/n
    e = p * (n*(n+1)/2)
    return e

E = list(map(calculate_Expectation, input().split()))
S = [0]
for i, e in enumerate(E):
    S.append(S[i]+e)

sum_of_E = []
for left in range(1, N+1-K):
    right = left + K
    sum_of_E.append(S[right]-S[left])
print(max(sum_of_E))

### FIXED CODE ###

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

def calculate_Expectation(n):
    n = int(n)
    p = 1/n
    e = p * (n*(n+1)/2)
    return e

E = list(map(calculate_Expectation, input().split()))
if N == K:
    print(sum(E))
else:
    S = [0]
    for i, e in enumerate(E):
        S.append(S[i]+e)

    sum_of_E = []
    for left in range(1, N+1-K):
        right = left + K
        sum_of_E.append(S[right]-S[left])
    print(max(sum_of_E))
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007
    
    N, W = map(int,input().split())
    wv = [tuple(map(int,input().split())) for i in range(n)]
    dp = [0]*(W+1)
    for i in range(N):
        for j in range(W, wv[i][0]-1, -1):
            dp[j] = max(dp[j], dp[j-wv[i][0]]+wv[i][1])
    print(max(dp))

if __name__ == '__main__':
    main()

### FIXED CODE ###



def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    N, W = map(int, input().split())
    w = [0]*N
    v = [0]*N
    for i in range(N):
        w[i], v[i] = map(int, input().split())
    dp = [[0]*(W+1) for _ in range(N+1)]
    for i in range(N):
        for j in range(W+1):
            if w[i]<=j:
                dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i])
            else:
                dp[i+1][j] = dp[i][j]
    print(dp[N][W])
    

if __name__ == '__main__':
    main()
s, t = intput().split("")
a, b = map(int, input().split(""))
u = input()

if u == t :
  num = b - 1
  print(a, num)
else:
  num = a - 1
  print(num, b)

### FIXED CODE ###

str = input().split()
s = str[0]
t = str[1]
a, b = map(int, input().split())
u = input()
 
if u == t :
  num = b - 1
  print(a, num)
else:
  num = a - 1
  print(num, b)
li = set(list(map(int, input().split())))
print(li[0])

### FIXED CODE ###

li = list(map(int, input().split()))
if li.count(li[0]) == 1:
    print(li[0])
if li.count(li[1]) == 1:
    print(li[1])
if li.count(li[2]) == 1:
    print(li[2])
def cmb(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


p = 10 ** 9 + 7
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

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)


n,a,b=map(int,input().split())
ans=((2**n-1)%(10**9+7)-cmb(n,a,p)%p-cmb(n,b,p)%p)
print(int(ans))


### FIXED CODE ###

mod=10**9+7
n,a,b=map(int,input().split())
ans=pow(2,n,mod)-1 #n種類の花を使って花束を作る総数は2^n-1通り
comb1=1 #nCaの計算
for i in range(n-a+1,n+1): #n*(n-1)*…*(n-a+1)を計算
 comb1*=i
 comb1%=mod
for i in range(1,a+1): #1/a!=1/(1*2*…*a)=1^(p-2)*2^(p-2)*…*a^(p-2) (p=10**9+7)を計算
 comb1*=pow(i,mod-2,mod)
 comb1%=mod
comb2=1
for i in range(n-b+1,n+1): #n*(n-1)*…*(n-b+1)を計算
 comb2*=i
 comb2%=mod
for i in range(1,b+1): #1/b!=1/(1*2*…*b)=1^(p-2)*2^(p-2)*…*b^(p-2) (p=10**9+7)を計算
 comb2*=pow(i,mod-2,mod)
 comb2%=mod
ans-=(comb1+comb2) #nCa、nCbを総数から引く
ans%=mod
print(ans)
a=int(input())
b=map(int,input().split())
b.sort()
c=b[0]

for i in range(1,a):
  c=(c+b[i])/2
  
print(c)

### FIXED CODE ###

a=int(input())
b=list(map(int,input().split()))
b.sort()
c=b[0]

for i in range(1,a):
  c=(c+b[i])/2
  
print(c)
import os

def qcount(s,t,count):
    if s=="?" or s==t:
        count += 1
        return count
    else:
        return 0

S = list(input())
T = list(input())
count = 0
i = 0
result =False
if len(S)>=len(T):
    while len(S)-i:
        count = qcount(S[i],T[count],count)
        if count == len(T):
            i = len(S)-1
            result = True
            for j in range(len(T)):
                S[i-count+j+1] = T[j]
                for k in range(len(S)):
                    if S[k]=="?":
                        S[k] = "a"
    i += 1
if result:
    print("".join(S))
else:
    print("UNRESTORABLE")


### FIXED CODE ###

import os

s = list(map(str,input()))
t = list(map(str,input()))

m = len(s)
n = len(t)
ans = 0

if m<n:
    print("UNRESTORABLE")
    exit()
for i in range(m-n+1):
    s2 = s.copy()
    s1 = s2[i:i+n]
    flag = True
    for j in range(n):
        if s1[j]!="?" and s1[j]!=t[j]:
            flag = False
            break
        else:
            s1[j] = t[j]
    if flag:
        s2[i:i+n] = s1
        s2 = "".join(s2)
        a = s2.replace("?","a")
        if ans==0:
            ans = a
        elif ans > a:
            ans = a
if ans==0:
    print("UNRESTORABLE")
else:
    print(ans)
n = input()
a = list(map(int,input().split()))

for i in range(n):
  if not a[i] % 2 != 0 or (a[i] % 3 == 0 or a[i] % 5 == 0):
    print("DNIED")
    exit()
else:
  print("APPROVED")


### FIXED CODE ###

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

if a == b and b == c:
  print("No")
elif a != b and b != c and a != c:
  print("No")
else:
  print("Yes")
a = list(map(int, input().split()))
count = 1
for i in a:
    count *= i
if count > 10 ** 18:
    print(-1)
else:
    print(count)

### FIXED CODE ###

import math
ab = input()
ab = list(ab.split())
a, b = int(ab[0]), ab[1]
b = b[0] + b[2] + b[3]
b = int(b)

print(a * b // 100)
H = int(input())
W = int(input())
N = int(input())

if H <= W:
    if N % W == 0:
        print(N/W)
    else:
        print((N//W) + 1)
else:
    if N % H == 0:
        print(int(N/H)
    else:
        print(int((N//H) + 1))

### FIXED CODE ###

H = int(input())
W = int(input())
N = int(input())

if H <= W:
    if N % W == 0:
        print(int(N/W))
    else:
        print(int((N//W) + 1))
else:
    if N % H == 0:
        print(int(N/H))
    else:
        print(int((N//H) + 1))
K = int(input())
A, B = map(int, input().split())

if A//K == B//K:
  if A % K == 0:
    print("OK")
    else:
      print("NG")
      
  else:
    print("OK")


### FIXED CODE ###

K = int(input())
A, B = map(int,input().split())
 
 
if A // K == B // K:
    if A % K ==0:
        print('OK')
    else:
        print('NG')  
else:
    print('OK')
mport numpy as np
N,M=map(int,input().split())
S=np.zeros((N,N))
H=list(map(int,input().split()))

for j in range(M):
  a,b=map(int,input().split())
  
  if H[a-1]<H[b-1]:
    S[a-1,b-1]=-1
    S[b-1,a-1]=1
  elif H[a-1]>H[b-1]:
    S[a-1,b-1]=1
    S[b-1,a-1]=-1
  else:
    S[a-1,b-1]=-1
    S[b-1,a-1]=-1

s=np.zeros(N)
for k in range(N):
  s[k]=np.any(S[k,:]<0)

print(len([i for i,x in enumerate(s) if x==0]))

### FIXED CODE ###

import numpy as np
N,M=map(int,input().split())
S=np.ones(N)
H=list(map(int,input().split()))

for j in range(M):
  a,b=map(int,input().split())
  
  if H[a-1]<H[b-1]:
    S[a-1]=0

  elif H[a-1]>H[b-1]:
    S[b-1]=0

  else:
    S[a-1]=0
    S[b-1]=0

print(int(np.sum(S)))
import numpy as np


h,w,m = map(int,input().split())
yp = np.zeros((h,2),dtype=np.int)
yp[:,1] = np.arange(h)
xp = np.zeros((w,2),dtype=np.int)
xp[:,1] = np.arange(w)

b = np.zeros((h,w),dtype=np.int)


for i in range(m):
    hi,wi = map(int,input().split())
    b[hi-1,wi-1] += 1
    yp[hi-1,0] += 1
    xp[wi-1,0] += 1
xp[:,0] -= 1
yps = np.argsort(yp[:,0])[::-1]
xps = np.argsort(xp[:,0])[::-1]

#print(xp)
#print(yp)
#print(yps)
#print(xps)

#print(xp)
#print(yp)
#print(b)
ans = yp[yps[0],0]
a = xp[xps[0],0]
ans += a
ans += a==0
print(ans)

### FIXED CODE ###

from random import randint
import numpy as np
from numba import njit


#@njit
def f(h,w,m,ins):
    yp = np.zeros((h,2),dtype=np.int)
    xp = np.zeros((w,2),dtype=np.int)
    yp[:,1] = np.arange(h)
    xp[:,1] = np.arange(w)
    ans = 0
    s = set()
    for hi,wi in ins:
        s.add((hi-1,wi-1))
        yp[hi-1,0] += 1
        xp[wi-1,0] += 1
    ypm = yp[:,0].max()
    xpm = xp[:,0].max()
    yps = yp[yp[:,0] == ypm][:,1]
    xps = xp[xp[:,0] == xpm][:,1]
    #y = yp[yps]
    for ypsi in yps:
        for xpsi in xps:
            a = yp[ypsi,0]+xp[xpsi,0]
            if (ypsi,xpsi) in s:
                a -= 1
                ans = max(ans,a)
            else:
                return a
    return ans


if False:
    while True:
        h,w = randint(1,10**5*3),randint(1,10**5*3)
        m = randint(1,min(h*w,10**5*3))
        ins = [(randint(1,h),randint(1,w)) for i in range(m)]
        ans1 = f1(h,w,m,ins)
        ans2 = f2(h,w,m,ins)
        if ans1 != ans2:
            print("!!!!")
            print(h,w,m)
            print(ins)
else:
    h,w,m = map(int,input().split())
    ans = f(h,w,m,[tuple(map(int,input().split())) for i in range(m)])
    print(ans)
S = input()
if len(set(S)) == 2:
	ans = 'Yes'  
else ans = 'No'
print(ans)

### FIXED CODE ###

S = input()
if len(set(S)) == 2:
	ans = 'Yes'  
else:
	ans = 'No'
print(ans)
x = list(input())
i = 0
while i < len(x) - 1:
    if  i % 2 == 0:
        if x[i] in ["L", "U", "D"]:
            edetector = True 
        else:
            edetector = False
    else:
        if x[i] in ["R", "U", "D"]:
            odetector = True 
        else:
            odetector = False
    i += 1
if edetector and odetector:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

x = list(input())
i = 0
edetector = True
odetector = True
while i < len(x):
    if  i % 2 == 0:
        if not x[i] in ["R", "U", "D"]:
            edetector = False
    else:
        if not x[i] in ["L", "U", "D"]:
            odetector = False
    i += 1

if edetector and odetector:
    print("Yes")
else:
    print("No")
eval"A,B="+gets.split*?,;p (B+B/100)*100**A

### FIXED CODE ###

a,b=map(int,input().split())
print((b+b//100)*100**a)
import sys
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]
d = [0]*N
d[0] = 1
d[1] = 1
def func(N):
    if d[N] > 0:
        return d[N]
    d[N] = func(N-1) + func(N-2)
    return d[N]
if M == 0:
    print(func(N)/%1000000007)
    sys.exit()

for i in range(M-1):
    if A[i+1] == A[i]+1:
        print(0)
        sys.exit()
        

A = [-1] + A + [N+1]

B = [A[i+1]-A[i]-2 for i in range(M+1)]
ans = 1
for i in range(M+1):
    ans = ans * func(B[i])
ans = ans%1000000007
print(ans)

### FIXED CODE ###

import sys
 
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]+[0] #jがはみ出ないように最後に付け足しておく
MOD=7+10**9 #%MODを忘れない
 
dp=[1]+[0]*n
 
j=0
#iにのぼることができるかを考える
for i in range(1,n+1):
  if i==a[j]:
    j+=1
  elif i>1:
    dp[i] = (dp[i-1] + dp[i-2])%MOD #-1,-2からの遷移を考える
  else:
    if i!=a[0]:
      dp[i] = dp[i-1]

print((dp[-1])%MOD)
import sys
import fractions
def input():
    return sys.stdin.readline()[:-1]
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7


ans = a[0]
for i in range(1, n):
    ans = ans * a[i] // fractions.gcd(ans, a[i])

cnt=0
b=[ans//a[i] for i in range(n)]
print(sum(b)%mod)


### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
n,m=map(int,input().split())
if n==m:
    print("Yes")
else:
    print("No")
a = map(int, input().split())
print(a.count(1))


### FIXED CODE ###

a = list(input())
print(a.count('1'))
A, B = map(int, input().split())
        print("No")

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")


### FIXED CODE ###

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

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")
b = ["the", "this", "that"]
while 1:
        try:
                a = raw_input()
        except IndexError:
                break
        for y in range(26):
                for x in b:
                        if x in a:
                                print a
                                break
                a = list(a)
                for x in range(len(a)):
                        if a[x] == "z":
                                a[x] = "a"
                        elif "a" <= a[x] < "z":
                                a[x] = chr(ord(a[x])+1)
                a = "".join(a)

### FIXED CODE ###

b = ["the", "this", "that"]
while 1:
        try:
                a = raw_input()
        except EOFError:
                break
        for y in range(26):
                for x in b:
                        if x in a:
                                print a
                                break
                a = list(a)
                for x in range(len(a)):
                        if a[x] == "z":
                                a[x] = "a"
                        elif "a" <= a[x] < "z":
                                a[x] = chr(ord(a[x])+1)
                a = "".join(a)
import sys
import math

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

ans = a[0]

for i in range(1, n):
    ans *= a[i]
    if math.log10(ans) > 18:
        print("-1")
        sys.exit()


print(ans)

### FIXED CODE ###

from decimal import Decimal

a, b = [Decimal(str(x)) for x in input().split()]

c = a * b

print(int(c))
x=input()
if x==A:
  print(C)
elif x==T:
  print(G)
elif x==G:
  print(T)
else:
  print(A)

### FIXED CODE ###

x=input()
if x=='A':
    print('T')
elif x=='T':
    print('A')
elif x=='G':
    print('C')
elif x=='C':
    print('G')
n = int(input())
s = input()
k = int(input())
c = s[k]
ans = ''
for i in range(n):
    if s[i] == c:
        ans += c
    else:
        ans += '*'
print(ans)

### FIXED CODE ###

n = int(input())
s = input()
k = int(input())
c = s[k-1]
ans = ''
for i in range(n):
    if s[i] == c:
        ans += c
    else:
        ans += '*'
print(ans)
list = input().split()
N = list[0]
K = list[1]
i = K
s = 0

def sum(a,b):
    i=0
    for p in range (b-a+1):
        i += a + p
    return i

for i =< N + 1:
    s = s + sum(N-i+1,N) - sum(0,i-1)
    i += 1
print(s)

### FIXED CODE ###

list = input().split()
N = int(list[0])
K = int(list[1])
i = K
s = 0

def sum(a,b):
    i=0
    i = (a + b)*(b - a + 1)/2
    return i

while i <= N + 1:
    #print(sum(N-i+1,N) + sum(0,i-1))
    s = s + sum(N-i+1,N) - sum(0,i-1) + 1
    i += 1
print(int(s % (10**9+7)))
n = int(input())
d = [int(input()) for i in range(n)]
s = 0
for i in range(n):
    for j in range(n):
        if i != j:
            s += d[i] * d[j]
print(int(s/2))

### FIXED CODE ###

n = int(input())
d = list(map(int, input().split()))
s = 0
for i in range(n):
    for j in range(n):
        if i != j:
            s += d[i] * d[j]
print(int(s/2))
n, m = input().split()

print((n-1)*(m-1))

### FIXED CODE ###

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

print((n-1)*(m-1))
from decimal import Decimal
n, k = map(int, input().split())
p = list(map(int, input().split()))

num_li = [0]*n
ans = 0
num = 0

for i in range(n):
    num_li[i] = ((p[i]*(p[i]+1))/2)/Decimal(p[i])

num = sum(num_li[:k])

for j in range(n-k):
    num = num-num_li[j]+num_li[j+k]
    ans = max(num,ans)

print('{:.10f}'.format(ans))

### FIXED CODE ###

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

num_li = [0]*n

for i in range(n):
    num_li[i] = (p[i]+1)/2

num = sum(num_li[:k])
ans = num

for j in range(n-k):
    num = num-num_li[j]+num_li[j+k]
    ans = max(num, ans)

print(ans)
from math import gcd
N,M=map(int,input().split())
S=input()
T=input()

C=N*M//gcd(N,M)
n=C//N
m=C//M

i=0
j=0
ans=C
while i<C and j<C:
    if  i==j:
        if S[i//n]!=T[j//m]:
            ans=-1
        i+=n
        j+=m
    elif i<j:
        i+=n
    else:
        j+=m
print(ans)

### FIXED CODE ###

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

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

C=N*M//gcd(max(N,M),min(N,M))
n=C//N
m=C//M

i=0
j=0
ans=C
while i<C and j<C:
    if  i==j:
        if S[i//n]!=T[j//m]:
            ans=-1
        i+=n
        j+=m
    elif i<j:
        i+=n
    else:
        j+=m
print(ans)
k, x = map(int, input().split())
for i in range(x-k+1,x+k-1):
print (i)

### FIXED CODE ###

k, x = map(int, input().split())
for i in range(x-k+1,x+k):
	print (i)
N = int(input())
eList = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
n = N
mod = N
numList = []

while n > 0:
  n, mod = divmod(n,26)
  if mod != 0:
    numList.insert(0, mod - 1)
  else:
    numList.insert(0, 25)
    n -= 1
for num in numList:
  if num != 0:
    ans += eList[num]
print(ans)

### FIXED CODE ###

N = int(input())
eList = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
n = N
mod = N
numList = []
 
while n > 0:
  n, mod = divmod(n,26)
  if mod != 0:
    numList.insert(0, mod - 1)
  else:
    numList.insert(0, 25)
    n -= 1
ans =''
for num in numList:
  ans += eList[num]
print(ans)
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
d = [0]*m
for i in range(1,m):
    d[i] = x[i]-x[i-1]
d.sort()
if n < m:
    d = d[1:m-n]
else:
    d = [0]
ans
for i in range(len(d)):
    ans += d[i]
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
d = [0]*m
for i in range(1,m):
    d[i] = x[i]-x[i-1]
d.sort()
if n < m:
    d = d[1:m-n+1]
else:
    d = [0]
ans = 0
for i in range(len(d)):
    ans += d[i]
print(ans)
N = int(input())
A = list(map(int,input().split()))
MAX = max(A)
dic = {}
for i in range(N):
  if A[i] not in dic:
    dic[A[i]] = 1
  else:
    dic[A[i]] += 1

ans = []
for i in range(1,MAX+1):
  mae = 0;ima=0;tsugi = 0
  if i in dic:
    ima = dic[i]
  if i != 1:
    if i-1 in dic:
      mae = dic[i-1]
  if i+1 <= MAX:
    if i+1 in dic:
      tsugi = dic[i+1]
  temp = mae + ima + tsugi
  ans.append(temp)
print(max(ans))  
    

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
MAX = max(A)
dic = {}
for i in range(N):
  if A[i] not in dic:
    dic[A[i]] = 1
  else:
    dic[A[i]] += 1

ans = []
for i in range(MAX+1):
  mae = 0;ima=0;tsugi = 0
  if i in dic:
    ima = dic[i]
  if i-1 in dic:
    mae = dic[i-1]
  if i+1 in dic:
    tsugi = dic[i+1]
  temp = mae + ima + tsugi
  ans.append(temp)
print(max(ans))
l = list(map(int, input().split()))
if l[0] == l[1]:
    print(l[0]+" == "+l[1])
elif l[0]<l[1]:
    print(l[0]+" < "+l[1])
else:
    print(l[0]+" > "+l[1])

### FIXED CODE ###

l = list(map(int, input().split()))
if l[0] == l[1]:
    print("a == b")
elif l[0]<l[1]:
    print("a < b")
else:
    print("a > b")
s = input()

if s = "ARC":
    print("ABC")
elif s = "ABC":
    print("ARC")


### FIXED CODE ###

s = input()

if s == "ARC":
    print("ABC")
elif s == "ABC":
    print("ARC")
# C - AtCoDeerくんと選挙速報 / AtCoDeer and Election Report

# 比がa:bとなる合計最小の票分布はa,b
# 次にc:dになったとき、a<=cかつb<=dとなるようにc,dに同じ数をかける

import math

N = int(input())
TA = [list(map(int, input().split())) for _ in range(N)]

a, b = TA[0]

for idx in range(1,N):
    c, d = TA[idx]
    multi = max(math.ceil(a/c), math.ceil(b/d))
    c *= multi
    d *= multi
    a,b = c,d
    
print(c+d)

### FIXED CODE ###

# C - AtCoDeerくんと選挙速報 / AtCoDeer and Election Report

# 比がa:bとなる合計最小の票分布はa,b
# 次にc:dになったとき、a<=cかつb<=dとなるようにc,dに同じ数をかける

import math

N = int(input())
TA = [list(map(int, input().split())) for _ in range(N)]

a, b = TA[0]
c, d = a, b

for idx in range(1,N):
    c, d = TA[idx]
    multi = max((a+c-1)//c, (b+d-1)//d)
    c *= multi
    d *= multi
    a,b = c,d
    
print(c+d)
import collections as c
# from fractions import gcd
from math import gcd
ip = lambda : map(int, input().split())
# ##############
mod = 1e9+7
n,l = ip()
ans = 0
k=abs(l)
for i in range(l,l+n):
    ans+=i
    if abs(i) < abs(k):
        k = i
ans -= k
print(ans)

### FIXED CODE ###

import collections as c
ip = lambda : map(int, input().split())
# ##############
mod = 1e9+7
n,l = ip()
ans = 0
k=abs(l)
for i in range(l,l+n):
    ans+=i
    if abs(i) < abs(k):
        k = i
ans -= k
print(ans)
from collections import deque

n,m=map(int,input().split())
l=list(map(int,input().split()))
l=[i/2 for i in l]
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

g=gcd(l[0],l[1])
lcm=1
d=1
for a in l:
  d=gcd(g,a)
  lcm=d*(a/d)*(g/d)
  g=lcm
  

if lcm>m:
  print(0)
  exit()
for a in l:
  if (lcm/a)%2==0:
    print(0)
    break
else:
  if (m//lcm)%2==0:
    print(int((m//lcm)/2))
  else:
    print(int((m//lcm+1)/2))

### FIXED CODE ###

#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n,m=map(int,input().split())
a=list(map(int,input().split()))

def lcm(a,b):
    g=math.gcd(a,b)
    return b*(a//g)
l=a[0]//2
for i in range(n):
    r=a[i]//2
    l=lcm(l,r)
for i in range(n):
    if (l//(a[i]//2))%2==0:
        print(0)
        exit()
res=m//l
print((res+1)//2)