Harryxun/stf_run huggingface dataset:
import bisect
import array

n, m = map(int, input().split())
a = map(int, input().split())
a = array.array("L", sorted(list(a)))
for _ in range(m):  # O(m*n)
    max_num = a.pop()  # O(1)
    index = bisect.insert(a, max_num // 2)  # O(log n)
print(sum(a))

### FIXED CODE ###

class heap():
    def __init__(self, maxcom=True):
        if maxcom:
            self.compare = lambda x, y: x > y
        else:
            self.compare = lambda x, y: x < y

    def heappush(self, x, heap):
        heap.append(x)
        length = len(heap)
        pointer = length
        while True:
            if pointer == 1:
                break
            if self.compare(heap[pointer - 1], heap[(pointer >> 1) - 1]):
                heap[pointer - 1], heap[(pointer >> 1) - 1] = heap[(pointer >> 1) - 1], heap[pointer - 1]
                pointer = pointer >> 1
            else:
                break

    def heapreplace(self, function, heap):
        heap[0] = function(heap[0])
        pointer = 1
        length = len(heap)
        while True:
            if (pointer << 1) > length:
                break
            elif (pointer << 1) + 1 > length :
                if self.compare(heap[(pointer << 1) - 1], heap[pointer - 1]):
                    heap[(pointer << 1) - 1], heap[pointer - 1] = heap[pointer - 1], heap[(pointer << 1) - 1]
                else:
                    break
            else:
                if self.compare(heap[(pointer << 1) - 1], heap[pointer << 1]):
                    next_pointer = pointer << 1
                else:
                    next_pointer = (pointer << 1) + 1
                if self.compare(heap[next_pointer - 1], heap[pointer - 1]):
                    heap[next_pointer - 1], heap[pointer - 1] = heap[pointer - 1], heap[next_pointer - 1]
                    pointer=next_pointer
                else:
                    break


n, m = map(int, input().split())
a = map(int, input().split())
heapq = []
heapc=heap(True)
for i in a:
    heapc.heappush(i,heapq)
for _ in range(m):
    heapc.heapreplace(lambda x:x>>1,heapq)
print(sum(heapq))
import networkx as nx

N = int(input())
ABC = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(Q)]

G = nx.Graph()

for a, b, c in ABC:
    G.add_edge(a - 1, b - 1, weight=c)

pred, dist = nx.dijkstra_predecessor_and_distance(G, K - 1)

for x, y in XY:
    print(dist[x - 1] + dist[y - 1])



### FIXED CODE ###

import networkx as nx

N = int(input())
ABC = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(Q)]

G = nx.Graph()

for a, b, c in ABC:
    G.add_edge(a - 1, b - 1, weight=c)

pred, dist = nx.dijkstra_predecessor_and_distance(G, K - 1)

for x, y in XY:
    print(dist[x - 1] + dist[y - 1])
n = int(input())
V = list(map(int, input().split()))

from collections import Counter

C0 = Counter(V[0::2])
C1 = Counter(V[1::2])

n0 = C0.most_common()[0][0]
n1 = C1.most_common()[0][0]



if n0 == n1:
    if C0.most_common()[1][1] >= C1.most_common()[1][1]:
        n0 = C0.most_common()[1][0]
    else:
        n1 = C1.most_common()[1][0]
    
count = 0
for v in V[0::2]:
    if v != n0:
        count += 1

for v in V[1::2]:
    if v != n1:
        count += 1
print(count)

### FIXED CODE ###

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

import sys
from collections import Counter

C0 = Counter(V[0::2])
C1 = Counter(V[1::2])

n0 = C0.most_common()[0][0]
n1 = C1.most_common()[0][0]

minV = min(V)
if all([v == minV for v in V]):
    print(len(V)//2)
    sys.exit()

if n0 == n1:
    if C0.most_common()[1][1] >= C1.most_common()[1][1]:
        n0 = C0.most_common()[1][0]
    else:
        n1 = C1.most_common()[1][0]
    
count = 0
for v in V[0::2]:
    if v != n0:
        count += 1

for v in V[1::2]:
    if v != n1:
        count += 1
print(count)
import numpy as np
from itertools import combinations
from itertools import permutations
from math import factorial


N = int(input())
a = [list(map(int, input().split())) for _ in range(N)]
L = np.array(list(permutations(a,3)))
cnt = 0
for i, j, k in L:
    cnt += sum(diff**2 for diff in i -j)**.5 + sum(diff**2 for diff in j -k)**.5
print(cnt/len(L))






### FIXED CODE ###

from itertools import permutations
from math import sqrt, pow, factorial

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

def calc(a, b):
    [x1, y1] = a
    [x2, y2] = b
    return sqrt(pow(x1 - x2, 2) + pow(y1 -y2, 2))
ans = 0
for order in permutations(range(N)):
    tmp = 0
    for i in range(1, N):
        tmp += calc(l[order[i]], l[order[i-1]])
    ans += tmp
print(ans/factorial(N))
n,k = map(int,input().split()) #n任 k種類
d = []
a = []
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))


sunuke =[0] * n
for i in range(n-1):
    #print("d[i]",d[i])
    for j in range(int(d[i])):
        temp = a[i][j] -1 
        sunuke[temp] += 1

print(sunuke.count(0))



### FIXED CODE ###

n,k = map(int,input().split()) #n任 k種類
d = []
a = []
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))


sunuke =[0] * n
for i in range(k):
    #print("d[i]",d[i])
    for j in range(int(d[i])):
        temp = a[i][j] -1 
        sunuke[temp] += 1

#print(sunuke)
print(sunuke.count(0))
N = int(input())
rest = N//1000
return 1000-rest

### FIXED CODE ###

N = int(input())
rest = N%1000
if rest==0:
  print(0)
else:
  print(1000-rest)
n = int(input())
output = []
for i in range(n):
    order,data = map(str,input().split() )
#    if order == "insert":
#        output.append(int(data))
#    elif order == "deleteFirst":
#        output.pop()
#    elif order == "deleteLast":
#        output.popleft()

#   elif order == "delete":
#        try:
#            output.remove(int(data))
#        except:
#            pass
#output.reverse()
print(" ".join(output))
#print(" ".join(map(str,output)))

### FIXED CODE ###

import sys
from collections import deque
n = int(sys.stdin.readline())
lines = sys.stdin.readlines()
 
Q = deque()
for i in range(n):
    command = lines[i].split()
    if command[0] == "insert":
        Q.appendleft(command[1])
    elif command[0] == "deleteFirst":
        Q.popleft()
    elif command[0] == "deleteLast":
        Q.pop()
    elif command[0] == "delete":
        try:
            Q.remove(command[1])
        except:
            pass
print(" ".join(Q))
n,m=map(int,input().split())
ans=[-1]*n
a,b=map(int,input().split())
ans[a-1]=b

for i in range(m-1):
    a,b=map(int,input().split())
    if ans[a-1]==-1 or ans[a-1]==b:
        ans[a-1]=b
    else:
        print(-1)
        exit()


if n>1 and ans[0]==0:
    print(-1)
elif n==1:
    if ans[0]==-1:
        print(0)
    else:
        print(ans[0])

elif n==2:
    for j in range(2):
        if ans[j]==-1:
            ans[j]=0
    print(10*ans[0]+ans[1])
else:
    for j in range(3):
        if ans[j]==-1:
            ans[j]=0
    
    print(100*ans[0]+10*ans[1]+ans[2])
    
          

### FIXED CODE ###

n,m=map(int,input().split())
ans=[]

for i in range(m):
    ans.append(list(map(int,input().split())))
for j in range(10**n):
    if len(str(j))==n and all(str(j)[s-1]==str(c) for s,c in ans):
        print(j)
        break
else:
    print(-1)
a = []
for i in range(3):
    a1, a2, a3 = map(int, input().split())
    a.append(a1)
    a.append(a2)
    a.append(a3)

l = [0]*9
n = int(input())

for i in range(n):
    b = int(input())
    for k in range(9):
        if a[k] == b:
            l[k] += 1
 
if l[0] == 1 and l[1] == 1 and l[2] == 1:
    print('Yes')
elif l[3] == 1 and l[4] == 1 and l[5] == 1:
    print('Yes')
elif l[6] == 1 and l[7] == 1 and l[8] == 1:
    print('Yes')
elif l[0] == 1 and l[3] == 1 and l[6] == 1:
    print('Yes')
elif l[1] == 1 and l[4] == 1 and l[7] == 1:
    print('Yes')
elif l[2] == 1 and l[5] == 1 and l[8] == 1:
    print('Yes')
elif l[0] == 1 and l[4] == 1 and l[8] == 1:
    print('Yes')
elif l[2] == 1 and l[4] == 1 and l[6] == 1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import math

n = int(input())

print(math.ceil(n / 2))
s, w = map(int, input().strip())
print s
if s > w:
  print("safe")
else:
  print("unsafe")

### FIXED CODE ###

s, w = map(int, input().split())
if s > w:
  print("safe")
else:
  print("unsafe")
n = int(input())
s = input()

if n < 3200:
	print("red")
else
	print("s")

### FIXED CODE ###

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

if n < 3200:
    print('red')
else:
    print(s)
n=int(input())
a=list(map(int,input().split()))
sumFrontHalf=0
halfIndex=0
sumA=aum(a)
for i in range(n):
  sumFrontHalf+=a[i]
  if sumFrontHalf>=sumA/2:
    halfIndex=i
    break
sumBackHalf=sumA-sumFrontHalf+a[halfIndex]
if sumFrontHalf<sumBackHalf:
  print(sumFrontHalf-sumBackHalf+a[halfIndex])
else:
  print(sumBackHalf-sumFrontHalf+a[halfIndex])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
sumFrontHalf=0
halfIndex=0
sumA=sum(a)
for i in range(n):
  sumFrontHalf+=a[i]
  if sumFrontHalf>=sumA/2:
    halfIndex=i
    break
sumBackHalf=sumA-sumFrontHalf+a[halfIndex]
if sumFrontHalf<sumBackHalf:
  print(sumFrontHalf-sumBackHalf+a[halfIndex])
else:
  print(sumBackHalf-sumFrontHalf+a[halfIndex])
import numpy as np
N=int(input())
A=map(int,input().split())
B=map(int,input().split())
C=array(map(int,input().split()))

sb=sum(B)
dC=np.diff(A)
sC=C[np.where(dC==1)[0]].sum()

print(sb+sC)


### FIXED CODE ###

import numpy as np
N=int(input())
A=np.array(list(map(int,input().split())))
B=list(map(int,input().split()))
C=np.array(list(map(int,input().split())))

sb=sum(B)
dC=np.diff(A)

sC=C[A[np.where(dC==1)[0]]-1].sum()
#print(sb, sC)
print(sb+sC)
l,r,d = map(int,input().split())
print((r//d - l//d)


### FIXED CODE ###

l,r,d = map(int,input().split())
print(r//d - (l-1)//d)
while 1:
  R0,W0,C,R=map(int,input().split())
  if not R0 and not W0 and not C and not R:break
  n=0
  while 1:
    if W0>1 and int((R0+R*n)/W0)==C:break
    elif W0==1 and (R0+R*n)>=C:break 
    n+=1
  print(n)


### FIXED CODE ###

while 1:
  R0,W0,C,R=map(int,input().split())
  if not R0 and not W0 and not C and not R:break
  n=0
  while 1:
    if W0>1 and int((R0+R*n)/W0)>=C:break
    elif W0==1 and (R0+R*n)>=C:break 
    n+=1
  print(n)
n = int(input())
st = [list(input().split()) for nesya in range(n)]
x = input()
c = 0
for a in st:
  if x == st[0]:
    c = 0
  else:
    c += int(st[1])
print(c)

### FIXED CODE ###

n = int(input())
st = [list(input().split()) for nesya in range(n)]
x = input()
c = 0
for a in st:
  if x == a[0]:
    c = 0
  else:
    c += int(a[1])
print(c)
inf = 10**20
n, k = map(int, input().split())
hs = [int(s) for s in input().split()]

dp = [inf] * n
dp[0] = 0

for i in range(1, n):
    for j in range(i-1, max(0, i-k)-1, -1):
        dp[i] = min(dp[j] + abs(hs[i] - hs[j]), dp[i])
print(dp[-1])

### FIXED CODE ###

n = int(input())
hs = [int(s) for s in input().split()]
dp = [0]*n
dp[0], dp[1] = 0, abs(hs[1]-hs[0])
for i in range(2, n):
  dp[i] = min(dp[i-1] + abs (hs[i] - hs[i-1]), dp[i-2] + abs(hs[i] - hs[i-2]))
print(dp[-1])
# coding:utf-8
# ??\??????????????´??°????°???????????????????

i = 1
x = 1
while x != 0 and y != 0:
    xy = raw_input().split()
    x = int(xy[0])
    y = int(xy[1])
    if x == 0 and y ==0:
        break
    if x < y :
        print x,y
    else:
        print y,x

### FIXED CODE ###

# coding:utf-8
# ??\??????????????´??°????°???????????????????

i = 1
x = 1
y = 1
while x != 0 or y != 0:
    xy = raw_input().split()
    x = int(xy[0])
    y = int(xy[1])
    if x == 0 and y ==0:
        break
    if x < y :
        print x,y
    else:
        print y,x
def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [a]
i = 1
while True:
  i += 1
  an_1 = col(an[-1])
  if an_1 in an:
    break
  an.append(an_1)

print(i)

### FIXED CODE ###

def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [s]
i = 1
while True:
  i += 1
  an_1 = col(an[-1])
  if an_1 in an:
    break
  else:
    an.append(an_1)

print(i)
from collections import deque
N = int(input())
a = list(map(int,input().split()))
value = deque()
for i in range(2,N):
    x = sum(a[0:i])
    y = sum(a[i:N])
    value.append(abs(x-y))
print(min(value))


### FIXED CODE ###


N = int(input())
a = list(map(int,input().split()))
x = a[0]
y = sum(a[1:])
ans = abs(x-y)
for i in range(1,N-1):
    x += a[i]
    y -= a[i]
    ans = min(abs(x-y),ans)

print(ans)
a,b,c = for i in input().split()

if(a <= c && c <= b)
    print('Yes')
else
    print('No')
  
  

### FIXED CODE ###

a,b,c = (int(i) for i in input().split())
if(a<=c and c<=b):
    print('Yes')
else:
    print('No')
a,b,x = list(map(int,input().split()))

import math

if x*2/a > b:
    y = 2*x/(a**2)-b

    print(90-math.degrees(math.atan(a/(b-y))))
else:
    y = 2*x/(a*b)

    print(90-math.degrees(math.atan(y/b)))

### FIXED CODE ###

import math
a,b,x=list(map(int,input().split()))
maxv=a*a*b
sukima=maxv-x
teimenseki=sukima/a
y=teimenseki*2/a
 
if x > (maxv/2):
    print(math.degrees(math.atan(y/a)))
else:
    tei=x/a
    z=tei*2/b
    print(math.degrees(math.atan(b/z)))
def multipilation():
    N = int(input())
    A = list(map(int,input().split()))
    if 0 in A
        print(0) 
        return
    
    prod = 1
    for a in A
        prod *= a
        if prod > 1000000000000000000
            print(-1)
            return

    print(prod)
    
multipilation()
    
    


### FIXED CODE ###

def multipilation():
    N = int(input())
    A = list(map(int,input().split()))
    if 0 in A:
        print(0) 
        return
    
    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return

    print(prod)
    
multipilation()
import sys
def f(j):
  if j==0:return 0
  if j<0: return 100000
  if dp[j]!=-1:return dp[j]
  f_k=[f(j-l-1)+abs(h[j]-h[j-l-1]) for l in range(k)]
  dp[j]=min(f_k)
  return dp[j]
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[-1]*n
sys.setrecursionlimit(1000000000)
print(f(n-1))


### FIXED CODE ###

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
from functools import lru_cache
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))
def inpl_str():
    '''
    一行に複数の文字
    '''
    return list(input().split())


n,k = inpl()
h = inpl()
dp = [INF] * (n)
dp[0] = 0
for i in range(min(n,k)):
    dp[i] = abs(h[i] - h[0])
for i in range(n - k):
    option=[dp[i+j]+abs(h[i+k]-h[i+j]) for j in range(k)]
    dp[i + k] = min(option)
print(dp[n - 1])
N=int(input())
nums = [int(i) for i in input().split()]

def gcd(x,y):
    if x < y:
        x = x ^ y
        y = x ^ y
        x = x ^ y
    div = x % y
    if div:
        return gcd(div, y)
    else:
        return y

memo = {}
memo[(0, 1)] = nums[0]
memo[(N-1, N)] = nums[N-1]

def solve(left, right):
    if (left, right) in memo:
        return memo[(left, right)]
    if left == 0:
        sol = gcd(nums[right - 1], solve(left, right - 1))
        memo[(left, right)] = sol
        return sol
    if right == N:
        sol = gcd(nums[left], solve(left+1, right))
        memo[(left, right)] = sol
        return sol

res = 1
for i in range(1, N-1):
    res = max(res, gcd(solve(0, i), solve(i+1, N)))

res = max(res, solve(0, N-1))
res = max(res, solve(1, N))

print(res)


### FIXED CODE ###

N=int(input())
nums = [int(i) for i in input().split()]

def gcd(x, y):
    if x < y:
        x = x ^ y
        y = x ^ y
        x = x ^ y
    div = x % y
    while div != 0:
        x = y
        y = div
        div = x % y
    return y

memo = {}
memo[(0, 1)] = nums[0]
memo[(N-1, N)] = nums[N-1]

for i in range(2, N+1):
    memo[(0, i)] = gcd(memo[(0, i - 1)], nums[i-1])
    # print("{} {} memo:{}".format(0, i, memo[(0,i)]))


for i in reversed(range(0, N-1)):
    memo[(i, N)] = gcd(memo[(i + 1, N)], nums[i])
    # print("{} {} memo:{}".format(i, N, memo[(i,N)]))

res = 1
for i in range(1, N-1):
    res = max(res, gcd(memo[(0, i)], memo[(i+1, N)]))
    # print("gcd:{}".format(gcd(memo[(0, i)], memo[(i+1, N)])))

res = max(res, memo[(0, N-1)])
res = max(res, memo[(1, N)])

print(res)
n = int(input())
a = list(map(int,input().split()))
f, r = [], []
for i in range(n):
    if i%2==0:
        f.append(a[i])
    else:
        r.append(a[i])
        
if n%2==0:
    print(*r[::-1], *f)
else:
    print(*f[::-1], *r)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
f, r = [], []
for i in range(n):
    if i%2==0:
        f.append(a[i])
    else:
        r.append(a[i])
ans = r[::-1] + f      
if n%2==0:
    print(*ans)
else:
    print(*ans[::-1])
x = input()
print(x*x*x)


### FIXED CODE ###

x = input()
x = int(x)
print(x*x*x)
n, l = map(int, input().split())
ss = [input() for _ in range(l)]
print(''.join(sorted(ss)))

### FIXED CODE ###

n, l = map(int, input().split())
ss = [input() for _ in range(n)]
print(''.join(sorted(ss)))
X, N = map(int, input().split())
P = list(map(int, input().split()))

min_abs = min([abs(X-i) for i in range(1, 100+1) if not i in P])

delta, notP = [], []
for i in range(1, 101):
    if not i in P:
        delta.append(abs(X-i))
        notP.append(i)

i = delta.index(min(delta))
print(notP[i])

### FIXED CODE ###

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

delta, notP = [], []
for i in range(0, 102):
    if not i in P:
        delta.append(abs(X-i))
        notP.append(i)

i = delta.index(min(delta))
print(notP[i])
n, m =map(int,input().split())
A = list(map(int,input().split()))
BC = [tuple(map(int,input().split()))for i in range(m)]

A.sort()
BC.sort(key= lambda x : -x[1])


i = 0
for b, c in BC:
    for _ in range(b):
        if c <=  A[i] : break
        A[i] = c
        i += 1
        if i >= n: break
        else:continue
print(sum(A))

### FIXED CODE ###

n, m =map(int,input().split())
A = list(map(int,input().split()))
BC = [tuple(map(int,input().split()))for i in range(m)]

A.sort()
BC.sort(key= lambda x : -x[1])


i = 0
for b, c in BC:
    for _ in range(b):
        if c <=  A[i] : break
        A[i] = c
        i += 1
        if i >= n: break
    else:continue
    break
print(sum(A))
import sympy

N=int(input())
count=0
for i in range(N):
    if sympy.divisor_count(i+1)==8 and (i+1)%2==1:
        count+=1
input(count)


### FIXED CODE ###

N=int(input())
count=0
if N>=195:
    print(5)
elif N>=189:
    print(4)
elif N>=165:
    print(3)
elif N>=135:
    print(2)
elif N>=105:
    print(1)
else:
    print(0)
N,X = map(int,input().split())

"""
　　レベルnの層数：a_0 = 1 , a_n = 2*a_(n-1)+3
レベルnのパティ数：b_0 = 1 , b_n = 2*b_(n-1)+1
"""

def thickness(n):
    if n == 0:
        return 1
    else:
        return 2 * thickness(n-1) + 3

def patty(n):
    if n == 0:
        return 1
    else:
        return 2 * patty(n-1) + 1

def ans(n,x):
    if n == 0:
        return 1
    else:
        if x == 1:
            return 0
        if 1 < x <= thickness(n-1)+1:
            return ans(n-1,x-1)
        if x == thickness(n-1) + 2:
            return patty(n-1) + 1
        if thickness(n-1) + 2 < x < 2 * thickness(n) + 2:
            return patty(n-1) + 1 + ans(n-1,x-2-thickness(n-1))
        if x == 2 * thickness(n-1) + 3:
            return 2 * patty(n-1) + 1

print(ans(N,X))


### FIXED CODE ###

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

"""
　　レベルnの層数：a_0 = 1 , a_n = 2*a_(n-1)+3
レベルnのパティ数：b_0 = 1 , b_n = 2*b_(n-1)+1
"""

def thickness(n):
    if n == 0:
        return 1
    else:
        return 2 * thickness(n-1) + 3

def patty(n):
    if n == 0:
        return 1
    else:
        return 2 * patty(n-1) + 1

def ans(n,x):
    if n == 0:
        return 1
    else:
        if x == 1:
            return 0
        if 1 < x <= thickness(n-1)+1:
            return ans(n-1,x-1)
        if x == thickness(n-1) + 2:
            return patty(n-1) + 1
        if thickness(n-1) + 2 < x <= 2 * thickness(n-1) + 2:
            return patty(n-1) + 1 + ans(n-1,x-2-thickness(n-1))
        if x == 2 * thickness(n-1) + 3:
            return 2 * patty(n-1) + 1

print(ans(N,X))
import sys

T, X = sys.argv[1], sys.argv[2]
T, X = int(T), int(X)
time = T/X
print(time)

### FIXED CODE ###

T, X = [int(_) for _ in input().split()]
T, X = int(T), int(X)
time = T/X
print(time)
N,M = map(int,input().split())
A = list(map(int,input().split()))

ans = N - sum(A):
if sum(A) < N
    print(-1)
else:
    print(ans)

### FIXED CODE ###

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

ans = N - sum(A)
if sum(A) > N:
    print(-1)
else:
    print(ans)
n = int(input().strip())
A = [int(s) for s in input().strip().split()]
M = 10 ** 9 + 7

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

factors = [0] * 2000
for a in A:
    d = 0
    while a % 2 == 0:
        d += 1
        a //= 2
    factors[2] = max(factors[2], d)
    for i in range(3, int(a ** 0.5) + 1, 2):
        d = 0
        while a % i == 0:
            d += 1
            a //= i
        factors[i] = max(factors[i], d)
        if a == 1:
            break
    if a > 1:
        factors[a] = max(factors[a], 1)

m = 1
for k, v in enumerate(factors):
    if v > 0:
        m = (m * pow(k, v, M)) % M

result = 0
for a in A:
    result = (result + m * modinv(a, M)) % M
print(result)

### FIXED CODE ###

n = int(input().strip())
A = [int(s) for s in input().strip().split()]
M = 10 ** 9 + 7

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

factors = [0] * 1001
large_factors = set()
for a in A:
    d = 0
    while a % 2 == 0:
        d += 1
        a //= 2
    factors[2] = max(factors[2], d)
    for i in range(3, int(a ** 0.5) + 1, 2):
        d = 0
        while a % i == 0:
            d += 1
            a //= i
        factors[i] = max(factors[i], d)
        if a == 1:
            break
    if a > 1000:
        large_factors.add(a)
    elif a > 1:
        factors[a] = max(factors[a], 1)

m = 1
for k, v in enumerate(factors):
    if v > 0:
        m = (m * pow(k, v, M)) % M
for k in large_factors:
    m = (m * k) % M

result = 0
for a in A:
    result = (result + m * modinv(a, M)) % M
print(result)
r = int(input())
import math
print('%.6f %.6f' % (math.pi * (r ** 2), math.pi * r * 2))

### FIXED CODE ###

r = float(input())
import math
print('%.6f %.6f' % (math.pi * (r ** 2), math.pi * r * 2))
n=int(input())
a=list(map(int,input()))

ans=0

for i in range(n):
    if [a(i)]>[a(i+1)]:
        ans+=[a(i)]-[a(i+1)]
print(ans)

### FIXED CODE ###

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

ans=0

for i in range(n-1):
    if a[i]>a[i+1]:
        ans+=a[i]-a[i+1]
        a[i+1]=a[i]
print(ans)
a, b, x = (i for i in input().split())
if x-a <= a+b:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a, b, x = (int(i) for i in input().split())
if x >= a and x-a <= b:
  print('YES')
else:
  print('NO')