Harryxun/stf_run huggingface dataset:
N = int(input())
T = [int(input()) for i in range(N)]

dvs = []
dvs_all = []

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

def lcm(m,n):
  return int(m * n / gcd(m,n))

if N == 1:
  ans = T[0]
else:
  for i in range(N - 1):
    T[i+1] = lcm(T[i], T[i+1])
    ans = T[i+1]

print(ans)

### FIXED CODE ###

N = int(input())
T = [int(input()) for i in range(N)]

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

def lcm(m,n):
  return int(m * n // gcd(m,n))

ans = 1
for i in range(N):
    ans = lcm(T[i], ans)

print(ans)
# -*- coding: utf-8

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

for i in range(int(input())):
    p, x = map(int, input().split())
    print(sum(t) - t[p] + x)

### FIXED CODE ###

# -*- coding: utf-8

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

for i in range(int(input())):
    p, x = map(int, input().split())
    print(sum(t) - t[p- 1] + x)
n, x = map(int, input().split())
l = list(map(int, input().split()))
count = 0
d = 0
for i in range(1, n+2):
    d += l[i-1]
    if d <= x:
        count += 1
    else:
        break
print(count+1)


### FIXED CODE ###

n, x = map(int, input().split())
l = list(map(int, input().split()))
count = 0
d = 0
for i in range(1, n+1):
    d += l[i-1]
    if d <= x:
        count += 1
    else:
        break
print(count+1)
from bisect import bisect, bisect_left
 
N= int(input())
L= list(map(int,input().split()))
L.sort()
 
ans = 0
for i in range(N-2):
  a=L[i]
  for k in range(i+1,n-1):
    b=s[k]
    t=bisect_left(L,a+b)
    ans+=t-k-1
print(ans)

### FIXED CODE ###

from bisect import bisect, bisect_left
 
N=int(input())
L=list(map(int,input().split()))
L.sort()
 
ans = 0
for i in range(N-2):
  a=L[i]
  for k in range(i+1,N-1):
    b=L[k]
    t=bisect_left(L,a+b)
    ans+=t-k-1
print(ans)
n = int(input())
A = list(map(int, input().split()))
B = set()
C = []
for i in A:
    if 1<= i <= 399:
        B.add("grey")
    elif 400 <= i <= 799:
        B.add("brown")
    elif 800 <= i <= 1199:
        B.add("green")
    elif 1200 <= i <= 1599:
        B.add("sky")
    elif 1600 <= i <= 1999:
        B.add("blue")
    elif 2000 <= i <= 2399:
        B.add("yellow")
    elif 2400 <= i <= 2700:
        B.add("orange")
    elif 2800 <= i <= 3199:
        B.add("red")
    else:
        C.append("X")

if C:
    S = len(B)
    if S == 0:
        S = 1
    T = len(B) + len (C)
    if T > 8:
        T = 8
    print(str(S) + " " + str(T))
else:
    print(str(len(B)) + " " + str(len(B)))

### FIXED CODE ###

x,y,z = map(int, input().split())
S = x * 100 + y * 10 + z
if S % 4 == 0:
    print("YES")
else:
    print("NO")
N, D = map(int, input().split())

count = 0

for i in range(N):
  x, y = map(int, input().split())
  if D > pow(x**2+y**2, 0.5):
    count += 1
  else:
    continue
    
print(count)

### FIXED CODE ###

x = input()
if int(x) >= 30:
  print("Yes")
else:
  print("No")
n = int(input())
a = [int(input()) for i in range(n)]

count = 0
nextbottun = 1

while(nextbottun != 2 and count <= 100000):
    nextbottun = a[nextbottun - 1]
    count += 1

if count <= 100000:
    print(count)
else:
    print(-1)


### FIXED CODE ###

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

z = a - b

if z >= 0:
    print("delicious")
elif z*(-1) <= x:
    print("safe")
else:
    print("dangerous")
s = input().split()
h = int(s[0])
w = int(s[1])
s = []
for i in range(h):
    s.append(input())

for i in range(h):
    row = ''
    for j in range(w):
        cnt = 0
        if s[i][j] == '#':
            row += '#'
            continue
        if i > 0 and j > 0 and s[i-1][j-1] == '#':
            cnt += 1
        if i > 0 and s[i-1][j] == '#':
            cnt += 1
        if i > 0 and j < w - 1 and s[i-1][j+1] == '#':
            cnt += 1
        if j > 0 and s[i][j-1] == '#':
            cnt += 1
        if j < w - 1 and s[i][j+1] == '#':
            cnt += 1
        if i < h - 1 and s[i+1][j-1] == '#':
            cnt += 1
        if i < h - 1 and s[i+1][j] == '#':
            cnt += 1
        if  i < h - 1 and j < w - 1 and s[i+1][j+1] == '#':
            cnt += 1
        row += str(cnt)
    print(row)


### FIXED CODE ###

import math
n = int(input())
print(math.factorial(n)%(10**9+7))
n,m=input().split()
if(n>m):
  print(n*str(m))

### FIXED CODE ###

x, y = map(int, input().split())
if(x>y):
  print(x*str(y))
else:
  print(y*str(x))
x = int(input())

N = x // 11
M = x % 11

ans = 0
if M <= 5:
  ans = 1
else ans = 2

print(2N + ans)

### FIXED CODE ###

x = int(input())

N = x // 11
M = x % 11

if M == 0:
  ans = 0
elif M <= 6:
  ans = 1
else:
  ans = 2

print(2*N + ans)
first_line = input().split()
second_line = input().split()
third_line = input().split()
 
first_line = [int(i) for i in first_line]
second_line = [int(i) for i in second_line]
third_line = [int(i) for i in third_line]
N = input()
N = int(N)

B  = [] 
for i in range(N):
    inp  =input()
    inp = int(inp)
    B.append(inp)


# arr = [[0]*3]*3
# print(arr)
# for i in range(3):
#     arr[0][i]= first_line[i]
#     print(arr)
# print(arr)
# for i in range(3):
#     arr[1][i]= second_line[i]
# for i in range(3):
#     arr[2][i]= third_line[i]

arr = []
arr.append(first_line)
arr.append(second_line)
arr.append(third_line)
carr = [[False for i in range(3)] for j in range(3)]

print(arr)
for b in B:
    for i in range(3):
        for j  in range(3):
            if b == arr[i][j]:
                # print(b, carr)
                carr[i][j] = True

# print(carr)

def yoko(carr):
    for i in range(3):
        for j in range(3):
            if carr[i][j] != True:
                break
        return  True
    
    return False


def tate(carr):
    for i in range(3):
        for j in range(3):
            if carr[j][i] != True:
                break
        return  True
    
    return False

def naname (carr):
    for i in range(3):
        if carr[i] != True:
            for j in range(3):
                if carr[3-j-1] != True:
                    return False
            return True    
    return True


def checker(carr):
    # if tate:
    #     print('tate')
    # if yoko:
    #     print('yoko')
    # if naname:
    #     print('naname')
    
    if not tate  and not yoko and not naname:
        return 'No'
    else:
        return 'Yes' 



print(checker(carr))

### FIXED CODE ###

N = input()
N = int(N)
if N%2 ==0:
    amari = 0
else:
    amari = 1

N  = N/2
N = int(N)

print(N+ amari)
H,W=mamp(int,input().split())
bd=[]

for i in range(H):
        bd.append(input())

x=set()
y=set()

for i in range(H):
        for j in range(W):
                if bd[i][j]=="#":
                        x.add(j)
                        y.add(i)
for i in y:
        for j in x:
                print(bd[i][j],end="")
        print()

### FIXED CODE ###

H,W=map(int,input().split())
bd=[]

for i in range(H):
        bd.append(input())

x=set()
y=set()

for i in range(H):
        for j in range(W):
                if bd[i][j]=="#":
                        x.add(j)
                        y.add(i)
for i in y:
        for j in x:
                print(bd[i][j],end="")
        print()
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

  
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
  
  
N,M = map(int, input().split())
m_factorized = factorize(M)
mod = 10 ** 9 + 7
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
ans = 1
for i in range( 2, 2**N + 1 ):
  g1.append( ( g1[-1] * i ) % mod )
  inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
  g2.append( (g2[-1] * inverse[-1]) % mod )
    
    
for i in m_factorized:
  k = i[1] 
  ans *= cmb(N-1+k,k,mod)
  ans %= mod
print(ans)
  

### FIXED CODE ###

from functools import reduce
from operator import mul

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

  
def cmb(n, r):
    """
    組み合わせの数 nCr
    :param n:
    :param r:
    :return:
    """
    r = min(n - r, r)
    if r == 0:
        return 1
    return reduce(mul, range(n, n - r, -1)) // reduce(mul, range(r, 0, -1))
  
  
N,M = map(int, input().split())
m_factorized = factorize(M)
mod = 10 ** 9 + 7

ans = 1

    
for i in m_factorized:
  k = i[1] 
  ans *= cmb(N-1+k,k)
  ans %= mod
print(ans)
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
t = [int(input()) for i in range(n)]
print(lcm_list(t))

### FIXED CODE ###

from fractions import gcd
from functools import reduce
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
t = [int(input()) for i in range(n)]
print(lcm_list(t))
n,m=map(int,input().split())
b=[int(input()) for _ in range(m)]
a=[]
if 1 not in b:
  a.append=1
else:a.append=0
if 2 not in b:
  a.append=2
else:a.append=0
for i in range(2,n):
  if i+1 not in b:
    a.append=(a[-1]+a[-2])%(10**9+7)
  else:a.append=0
print(a[-1])

### FIXED CODE ###

n,m=map(int,input().split())
mod=10**9+7
dp=[1]*(n+1)
for _ in range(m):
  dp[int(input())]=0
dp[1]*=dp[0]
for i in range(2,n+1):
  dp[i]*=dp[i-1]+dp[i-2]
print(dp[-1]%mod)
# ans

N = int(input())
A = list(map(int, input().split()))
cnt = [0] * 100000
for i in A:
  cnt[i] += 1
Q = int(input())
S = sum(A)

for i in range(Q):
  B, C = map(int, input().split())
  diff = (C - B) * cnt[B]
  S += diff
  print(S)
  cnt[C] += cnt[B]
  cnt[B] = 0
  

### FIXED CODE ###

# ans

N = int(input())
A = list(map(int, input().split()))
cnt = [0] * 100001
for i in A:
  cnt[i] += 1
Q = int(input())
S = sum(A)

for i in range(Q):
  B, C = map(int, input().split())
  diff = (C - B) * cnt[B]
  S += diff
  print(S)
  cnt[C] += cnt[B]
  cnt[B] = 0
x = input()

str_list = list(x)
dict_ = {

    }

for a in str_list:
    if ord(a) - 3 < 65:
        print(chr(90 - 65 - ord(a) - 3) ,end = "")
    else:
        print(chr(ord(a) - 3) ,end = "")
print()


### FIXED CODE ###

x = input()

str_list = list(x)
dict_ = {
    "D":"A",
"E":"B",
"F":"C",
"G":"D",
"H":"E",
"I":"F",
"J":"G",
"K":"H",
"L":"I",
"M":"J",
"N":"K",
"O":"L",
"P":"M",
"Q":"N",
"R":"O",
"S":"P",
"T":"Q",
"U":"R",
"V":"S",
"W":"T",
"X":"U",
"Y":"V",
"Z":"W",
"A":"X",
"B":"Y",
"C":"Z"
    }

for a in str_list:
    print(dict_.get(a) , end = "")
print()
if int((input())*int(input()))%2==0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2==0:
  print('Even')
else:
  print('Odd')
N, L = map(int, input().split())
flavor = []
for i in range(1, N + 1):
    flavor.append(L + i - 1)
print(sum(flavor) - min(abs(flavor)))



### FIXED CODE ###

N, L = map(int, input().split())
flavor = []
for i in range(1, N + 1):
    flavor.append(L + i - 1)
import numpy as np
for j in flavor:
    if abs(j) == min(np.abs(flavor)):
        eat = j
print(sum(flavor) - eat)
from math import ceil


def solve(string):
    pass
    n, *csf = map(int, string.split())
    f_list = []
    for c, s, f in csf:
        f_list = [c + ceil((max(_f, s)) / f) * f for _f in f_list]
        f_list.append(c + s)
    f_list.append(0)
    return "\n".join([str(_f) for _f in f_list])


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(n - 1)])))


### FIXED CODE ###

#!/usr/bin/env python3

import math
import sys

n = int(sys.stdin.readline().strip())
f_list = []
for _ in range(n - 1):
    c, s, f = sys.stdin.readline().strip().split(" ")
    c = int(c)
    s = int(s)
    f = int(f)
    f_list = [c + math.ceil((max(_f, s)) / f) * f for _f in f_list]
    f_list.append(c + s)
f_list.append(0)
for _f in f_list:
    print(_f)
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]

cards = A[0] + A[1] + A[2]

for b in B:
    cards = [c if c != b else 0 for c in cards]

if (sum(A[0:3]) == 0):
    print('Yes')
elif (sum(A[3:6]) == 0):
    print('Yes')
elif (sum(A[7:9]) == 0):
    print('Yes')
elif ((A[0] + A[3] + A[6]) == 0):
    print('Yes')
elif ((A[1] + A[4] + A[7]) == 0):
    print('Yes')
elif ((A[2] + A[5] + A[8]) == 0):
    print('Yes')
elif ((A[0] + A[4] + A[8]) == 0):
    print('Yes')
elif ((A[2] + A[4] + A[6]) == 0):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

cards = A[0] + A[1] + A[2]

for b in B:
    cards = [c if c != b else 0 for c in cards]

if (sum(cards[0:3]) == 0):
    print('Yes')
elif (sum(cards[3:6]) == 0):
    print('Yes')
elif (sum(cards[6:9]) == 0):
    print('Yes')
elif ((cards[0] + cards[3] + cards[6]) == 0):
    print('Yes')
elif ((cards[1] + cards[4] + cards[7]) == 0):
    print('Yes')
elif ((cards[2] + cards[5] + cards[8]) == 0):
    print('Yes')
elif ((cards[0] + cards[4] + cards[8]) == 0):
    print('Yes')
elif ((cards[2] + cards[4] + cards[6]) == 0):
    print('Yes')
else:
    print('No')
n = int(input())

ans = list(range(1,n))

print(sum(ans))

### FIXED CODE ###

n = int(input())
print((n * (n-1)) // 2)
for i in range(10):
    if 1000 * i >= N:
        break

return 1000*i - N

### FIXED CODE ###

N = int(input())

amari = N % 1000

if amari > 0:
	answer = 1000 - amari
else:
  	answer = amari
        
print(answer)
import sys
n=int(input())
lst=[]
for i in range(n):
  T,X,Y=map(int,input().split())
  lst.append([T,X,Y])
lst.sort(lambda x:x[0])
for j in range(n-1):
  if abs(lst[j][1]-lst[j+1][1])==1 or abs(lst[j][2]-lst[j+1][2])==1:
    lst=lst  
  else:
    print('No')
    sys.exit()
print('Yes')


### FIXED CODE ###

import sys
n=int(input())
lst=[]
for i in range(n):
  T,X,Y=map(int,input().split())
  lst.append([T,X,Y])
if (abs(lst[0][1])+abs(lst[0][2]))%2==lst[0][0]%2:
  if abs(lst[0][1])+abs(lst[0][2])<=lst[0][0]:
    pass
  else:
    print('No')
    sys.exit()
else:
  print('No')
  sys.exit()

for j in range(n-1):
  if (abs(lst[j][1]-lst[j+1][1])+abs(lst[j][2]-lst[j+1][2]))%2==(lst[j+1][0]-lst[j][0])%2:
    if abs(lst[j][1]-lst[j+1][1])+abs(lst[j][2]-lst[j+1][2])<=(lst[j+1][0]-lst[j][0]):
      pass
    else:
      print('No')
      sys.exit()
  else:
    print('No')
    sys.exit()
print('Yes')
def solution(a):
    A = a[0]
    B = sum(a) - a[0]
    Min = abs(A - B)
    for i in xrange(1, len(a)-1):
        A += a[i]
        B -= a[i]
        if Min > abs(A- B):
            Min = abs(A - B)
    print Min
import math
N = int(raw_input())
a = map( int, raw_input().split())
solution(a)


### FIXED CODE ###

a,b =map( int, raw_input().split())
if a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:
    print 'Possible'
else:
    print 'Impossible'
import sys
import numpy as np
if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

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

ans = []
for i in range(N):
	a = np.argmin(A)
	ans.append(str(a+1))
	A[a] = float('INF')

print(' '.join(ans))

### FIXED CODE ###

import sys
if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

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

AS = [[a,idx+1] for idx,a in enumerate(A)]
AS.sort()

for a in AS:
	print(a[1], end=" ")
H,W = map(int,input().split())
g = []
for i in range(N):
    g.append(list(input()))

c = []
l = []
for w in range(W):
    l.append(0)
for h in range(H):
    c.append(l)

hs = []
for i in range(W):
    hs.append(0)

for h in range(H):
    ws = 0
    for w in range(W):
        if g[h][w] == '#':
            for i in range(ws,w):
                c[h][i] += w-ws-1
            ws = w+1
            for j in range(hs[w],h):
                c[j][w] += h-hs[w]
            hs[w] = h+1
    w2 = w+1
    for i in range(ws,w2):
        c[h][i] += w2-ws-1
h2 = h+1
for w in range(W):
    for j in range(hs[w],h2):
        c[j][w] += h2-hs[w]

#print(c)

ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans,c[h][w])

print(ans)
'''
横方向と縦方向に分けてプログラムを作成してまとめた
横方向
for h in range(H):
    ws = 0
    for w in range(W):
        if g[h][w] == '#':
            for i in range(ws,w):
                c[h][i] += w-ws-1
            ws = w+1
    w2 = w+1
    for i in range(ws,w2):
        c[h][i] += w2-ws-1

縦方向
hs = [0 for i in range(W)]
for h in range(H):
    for w in range(W):
        if g[h][w] == '#':
            for j in range(hs[w],h):
                c[j][w] += h-hs[w]
            hs[w] = h+1
h2 = h+1
for w in range(W):
    for j in range(hs[w],h2):
        c[j][w] += h2-hs[w]
'''


### FIXED CODE ###

H,W = map(int,input().split())
g = [list(input()) for i in range(H)]

c = [[0 for w in range(W)] for h in range(H)]

hs = [0 for i in range(W)]

for h in range(H):
    ws = 0
    for w in range(W):
        if g[h][w] == '#':
            for i in range(ws,w):
                c[h][i] += w-ws-1
            ws = w+1
            for j in range(hs[w],h):
                c[j][w] += h-hs[w]
            hs[w] = h+1
    w2 = w+1
    for i in range(ws,w2):
        c[h][i] += w2-ws-1
h2 = h+1
for w in range(W):
    for j in range(hs[w],h2):
        c[j][w] += h2-hs[w]

#print(c)

ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans,c[h][w])

print(ans)
'''
横方向と縦方向に分けてプログラムを作成してまとめた
横方向
for h in range(H):
    ws = 0
    for w in range(W):
        if g[h][w] == '#':
            for i in range(ws,w):
                c[h][i] += w-ws-1
            ws = w+1
    w2 = w+1
    for i in range(ws,w2):
        c[h][i] += w2-ws-1

縦方向
hs = [0 for i in range(W)]
for h in range(H):
    for w in range(W):
        if g[h][w] == '#':
            for j in range(hs[w],h):
                c[j][w] += h-hs[w]
            hs[w] = h+1
h2 = h+1
for w in range(W):
    for j in range(hs[w],h2):
        c[j][w] += h2-hs[w]
'''
x = list(map(lambda x:int(x), input().split()))
X = x[0]
N = x[1]
p = []
if N != 0:
  p = list(map(lambda x:int(x), input().split()))

near = [False]*102
#print(near)
#print(near[200])

for i in p:
  near[i] = True
  
for i in range(0,100):
  if not near[X-i]:
    print(X-i)
    break
  elif not near[X+i]:
    print(X+i)
    break
  

### FIXED CODE ###

x = list(map(lambda x:int(x), input().split()))
#x = list()

for i in range(len(x)):
  if x[i] == 0:
    print(i+1)
    break
import math
print(math.factorial(int(input())%10**9+7)

### FIXED CODE ###

import math
print(math.factorial(int(input())) % (10**9+7))
K=4000
S=[input()for i in R(3)]
A,B,C=S
a,b,c=len(A),len(B),len(C)
def F(S,T):
 R=[1]*(K*2+1)
 for i in R(-len(T),len(S)):
  for j in range(max(i,0),min(len(S),len(T)+i)):
   if S[j]!=T[j-i]and S[j]!="?"and T[j-i]!="?":
    R[i]=0
    break
 return R
AB=F(A,B)
AC=F(A,C)
BC=F(B,C)
i=K*3
for i in range(-K,K+1):
 if A[i]!=0:
  for i in range(-K,K+1):
   if A[c]==0 or B[i-i]==0:
    m=min(m,max(b+b,c+c,a)-min(b,c,0))
print(m)

### FIXED CODE ###

print('YNeos'[1-(input()in['hi'*i for i in range(11)])::2])
# AtCoder Regular Contest 080
# C - 4-adjacent

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

oddcount=0
mod40=0
other=0

for a in alist:
    if a%2==1:
        oddcount+=1
    elif a%4==0:
        mod40+=1
    else:
        other+=1

if N==1:
    if mod40==N:
        print("Yes")
    else:
        print("No")
if N==2 or N==3:
    if mod40>0 or other==N:
        print("Yes")
    else:
        print("No")
# ↑ここまではあってそう。

if N%2==1:
    if (N-((other//2)*2))//2 <= mod40:
        print("Yes")
    else:
        print("No")

else:
    print(np.array)


    # if (N-other)//2 < mod40:
    #     print("Yes")
    # else:
    #     print("No")


### FIXED CODE ###

# AtCoder Regular Contest 080
# C - 4-adjacent

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

oddcount=0
mod40=0
other=0

for a in alist:
    if a%2==1:
        oddcount+=1
    elif a%4==0:
        mod40+=1
    else:
        other+=1

if N==1:
    if mod40==N:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
if N==2 or N==3:
    if mod40>0 or other==N:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
# ↑ここまではあってそう。

if N%2==1:  # N>3 ,Nが奇数の時
    if (N-((other//2)*2))//2 <= mod40:
        print("Yes")
        exit()
    else:
        print("No")
        exit()

else:   # N>3 ,Nが偶数の時
    if other%2==1:  #かつ、要素が偶数である数が奇数の時  
        if (N-((other//2)*2))//2 <= mod40:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    else:
        if (N-((other//2)*2))//2 <= mod40:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
N, K = map(int, input().split())
D = int(input())

ANSlist = []

for i in range(1,K):
    inportant = int(input())
    trash = input()
    ANSlist.append(inportant)

ANS = N - max(ANSlist)

print(ANS)

### FIXED CODE ###

N, K = map(int, input().split())
#ANSlist = [1]*(N)
ANSlist = []
ANS = 0

for i in range(K):
    I = input() #
    S = input().split()
    #print(ANSlist)
    for j in range(len(S)):
        if S[j] != " ":
            #ANSlist[int(S[j])-1] = 0
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            


'''for i in range(len(ANSlist)):
    if ANSlist[i] != 0:
        ANS += 1'''
ANS = N - len(ANSlist)
print(ANS)
n = int( raw_input() )
A = map( int , raw_input().strip().split(' ') )
q = int( raw_input() )
mi = map( int , raw_input().strip().split(' ') )

def solve(i, m):
  if m == 0:
    return True
  if i >= n:
    return False
res = solve( i+1 , m ) | solve( i+1 , m-A[i] )
return res

for m in mi:
  if solve( 0 , m ):
    print 'yes'
  else:
    print 'no'
   

### FIXED CODE ###

n = input()
A = map( int , raw_input().split() )
q = input()
mi = map( int , raw_input().split() )

def solve(i, m):
  if m == 0:
    return True
  elif i >= n or m > sum(A):
    return False

  res = solve( i+1 , m ) or solve( i+1 , m-A[i] )
  return res

for m in mi:
  if solve( 0 , m ): print "yes"
  else: print "no"
mod = 10**9+7
def fctr(n): 
    res=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            res.append([i,c])
            c=0
    if n!=1:
        res.append([n,1])
    return res
N = int(input())
A = list(map(int, input().split()))
A_inv = [pow(a, mod-2, mod) for a in A]
primes = [0]*(10**4+1)
for a in A:
    res = fctr(a)
    for i, c in res:
        primes[i] = max(primes[i], c)
m = 1
for i in range(1, 10**4+1):
    c = primes[i]
    m*=pow(i, c, mod)
    m%=mod
ans = 0
for a in A_inv:
    ans+=m*a
    ans%=mod
print(ans)




### FIXED CODE ###

mod = 10**9+7
def fctr(n): 
    res=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            res.append([i,c])
            c=0
    if n!=1:
        res.append([n,1])
    return res
N = int(input())
A = list(map(int, input().split()))
A_inv = [pow(a, mod-2, mod) for a in A]
primes = [0]*(10**6+1)
for a in A:
    res = fctr(a)
    for i, c in res:
        primes[i] = max(primes[i], c)
m = 1
for i in range(1, 10**6+1):
    c = primes[i]
    m*=pow(i, c, mod)
    m%=mod
ans = 0
for a in A_inv:
    ans+=m*a
    ans%=mod
print(ans)