Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(1000000000)
N = int(input())
candi =int((N+1)/2*N -N)
def f(count,i):
    if i == 2:
        return count +1
    nex_num = (i//2) + 1
    count += (i%nex_num) 
    middle_sum = int((i-1 + nex_num )/2*(i -nex_num))
    count += middle_sum
    nex_num = nex_num -1
    return f(count,nex_num)

def f2(count,i):
    if i == 1:
        return count
    nex_num = (i+1)//2
    count += (i%nex_num)
    middle_sum = int((i-1 + nex_num )/2*(i -nex_num))
    count += middle_sum
    nex_num = nex_num -1
    return f2(count,nex_num)

if N%2 == 0:
    nex_num = N
    count = f(0,nex_num)
else:
    nex_num = N
    count = f2(0,nex_num)
print(count)
'''
if candi > count:
    print(candi)
else:
    print(count)
'''

### FIXED CODE ###

N = int(input())
print((N-1)*N//2)
import math
n, m = map(int, input().split())

mod = 10 ** 9 + 7

b = []

c = int(math.sqrt(m))
for i in range(2, c+2):
    if m % i != 0:
        continue
    count = 0
    while m % i == 0:
        count += 1
        m = m // i
    b.append(count)

fac = [1, 1]
inv = [1, 1]
finv = [1, 1]
for i in range(2, c):
    fac.append(fac[i-1] * i % mod)
    inv.append(mod - inv[mod%i] * (mod//i) % mod)
    finv.append(finv[i-1] * inv[i] % mod)

def nck(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod

ans = 1
for i in b:
    ans = (ans * nck(n-1+i, n-1)) % mod

print(ans)

### FIXED CODE ###

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

mod = 10**9 + 7

b = []

c = int(math.sqrt(m))
for i in range(2, c+2):
    count = 0
    while m % i == 0:
        count += 1
        m = m // i
    b.append(count)
if m > 1:
    b.append(1)

fac = [1, 1]
inv = [1, 1]
finv = [1, 1]
for i in range(2, n + max(b)+3):
    fac.append(fac[i-1] * i % mod)
    inv.append(mod - inv[mod%i] * (mod//i) % mod)
    finv.append(finv[i-1] * inv[i] % mod)

def nck(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod

ans = 1
for i in b:
    ans *= nck(n-1+i, i)
    ans %= mod

print(ans)
def comb(n, r):
  if n < r or n < 0 or r < 0:
    return 0
  r = min(r, n - r)
  if n == 0 or r == 0:
    return 1
  return (n - r + 1) * comb(n, r - 1) // r

N, K = list(map(int, input().split()))
for i in range(K):
  print(comb(N - K + 1, i + 1) * comb(K - 1, i) % (10 ** 9 + 7))

### FIXED CODE ###

def comb(n, r):
  if n < 0 or r < 0:
    raise ValueError
  r = min(r, n - r)
  if n == 0 or r == 0:
    return 1
  return (n - r + 1) * comb(n, r - 1) // r

N, K = list(map(int, input().split()))
for i in range(K):
  if N - K + 1 < i + 1:
    print('0')
    continue
  print(comb(N - K + 1, i + 1) * comb(K - 1, i) % (10 ** 9 + 7))
def ds(n):
  return sum(map(int,str(n)))
print(n%ds(n)==0)

### FIXED CODE ###

n=int(input())
def ds(n):
  return sum(map(int,str(n)))
print('Yes' if n%ds(n)==0 else 'No')
import random
n, m, k = map(int, input().split())
# n, m, k = random.randint(1, 10**5), random.randint(1, 10**5), random.randint(10**7, 10**8)
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
# a_list = [random.randint(1, 10**2) for i in range(n)]
# b_list = [random.randint(1, 10**2) for i in range(m)]
# print(n,m,k)
# print(a_list[0], b_list[0])
a_sum = [0]
b_sum = [0]
for i in range(1, max(n+1, m+1)):
    if i < n+1:
        a_sum.append(a_sum[i-1] + a_list[i-1])
    if i < m+1:
        b_sum.append(b_sum[i-1] + b_list[i-1])

ans = 0
for i in range(n+1):
    if a_sum[i] > k:
        break
    else:
        j = m
        while b_sum[j] <= k - a_sum[i]:
            j -= 1
    ans = max(ans, i+j)
        
print(ans)
# print(n+m) 

### FIXED CODE ###

import random
n, m, k = map(int, input().split())
# n, m, k = random.randint(1, 10**5), random.randint(1, 10**5), random.randint(10**8, 10**9)
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
# a_list = [random.randint(1, 10**3) for i in range(n)]
# b_list = [random.randint(1, 10**3) for i in range(m)]
# print(n,m,k)
# print(a_list[0], b_list[0])
a_sum = [0]
b_sum = [0]
max_a = 0
for i in range(1, max(n+1, m+1)):
    if i < n+1:
        a_sum.append(a_sum[i-1] + a_list[i-1])
        if a_sum[i] <= k:
            max_a = i
    if i < m+1:
        b_sum.append(b_sum[i-1] + b_list[i-1])

ans = 0
j = m
for i in range(0, max_a+1):
    while b_sum[j] > k - a_sum[i]:
        j -= 1
    ans = max(ans, i+j)
        
print(ans)
# print(n+m)
input()
D = {}
for a in [int(a) for a in input().split()]:
    if a not in D: D[i] = 0
    D[a] += 1

input()
for a in [int(a) for a in input().split()]:
    if a not in D: D[i] = 0
    D[a] -= 1

for a in D:
    if D[a] < 0:
        print("NO")
        break
else:
    print("YES")


### FIXED CODE ###

input()
D = {}
for a in [int(a) for a in input().split()]:
    if a not in D: D[a] = 0
    D[a] += 1

input()
for a in [int(a) for a in input().split()]:
    if a not in D: D[a] = 0
    D[a] -= 1

for a in D:
    if D[a] < 0:
        print("NO")
        break
else:
    print("YES")
N,M,K=map(int,input().split())
At=list(map(int,input().split()))
Bt=list(map(int,input().split()))

#０冊を初期値にする
A=[0]
B=[0]


for a in At:
    if A[-1]+a<K:
        A.append(A[-1]+a)

for b in Bt:
    if B[-1]+b<K:
        B.append(B[-1]+b)

def is_ok(arg):
    # 条件を満たすかどうか？問題ごとに定義
    if Ak+B[arg]<=K:
        return True
    else:
        return False


def meguru_bisect(ng, ok):
    '''
    めぐる2分探査
    okはBの冊数たりうる値
    ngはBの冊数たり得ない値を入れる。
    '''

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok


Ak=0

maxBooks=0
for Ai in range(len(A)): 
    Ak=A[Ai]
    Bi=meguru_bisect(len(B),0) #len(B)は配列の要素数として使われるとき最大＋１
    if maxBooks<(Ai+Bi):
        maxBooks=Ai+Bi
print( maxBooks )




### FIXED CODE ###

N,M,K=map(int,input().split())
At=list(map(int,input().split()))
Bt=list(map(int,input().split()))

#０冊を初期値にする
A=[0]
B=[0]


for a in At:
    if A[-1]+a<=K:
        A.append(A[-1]+a)
    else:
        break
for b in Bt:
    if B[-1]+b<=K:
        B.append(B[-1]+b)
    else:
        break

def is_ok(arg):
    # 条件を満たすかどうか？問題ごとに定義
    if Ak+B[arg]<=K:
        return True
    else:
        return False


def meguru_bisect(ng, ok):
    '''
    めぐる2分探査
    okはBの冊数たりうる値
    ngはBの冊数たり得ない値を入れる。
    '''

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok


Ak=0

maxBooks=0
for Ai in range(len(A)): 
    Ak=A[Ai]
    Bi=meguru_bisect(len(B),0) #len(B)は配列の要素数として使われるとき最大＋１
    if maxBooks<(Ai+Bi):
        maxBooks=Ai+Bi
print( maxBooks )
#!/usr/bin/env python
#-*- coding: utf-8 -*-

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

n, m = [int (i) for i in raw_input ().split ()]
s = raw_input ()
t = raw_input ()
L = n * m / g (n, m)
l = [''] * (n * m + 5)
cnt = 0
ok = True
for i in range (n):
    l [i * L / n] = s [i]
for i in range (m):
    ok &= (l [i * L / m] == '' or l [i * L / m] == t [i])
    l [i * L / m] = t [i]
if not ok: L = -1
print L


### FIXED CODE ###

#!/usr/bin/env python
#-*- coding: utf-8 -*-

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

n, m = [int (i) for i in raw_input ().split ()]
s = raw_input ()
t = raw_input ()
L = n * m / g (n, m)
d = defaultdict (str)
cnt = 0
ok = True
for i in range (n):
    d [i * L / n] = s [i]
for i in range (m):
    ok &= (d [i * L / m] == '' or d [i * L / m] == t [i])
    d [i * L / m] = t [i]
if not ok: L = -1
print L
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
from heapq import heappush, heappop
from collections import defaultdict
 
n,q = map(int,readline().split())
data = list(map(int,read().split()))
A = data[:3*n]
D = data[3*n:]

E = []
F = {}
for i in range(n):
    s = A[i][0]
    t = A[i][1]
    x = A[i][2]
    F[x] = 0
    E.append((s-x, x, 1))
    E.append((t-x, x, -1))
E.append((10**10, 10**10, 1))

E.sort()

# print(E)

from heapq import heappush, heappop
Q = []

j = 0
for i in range(q):
    # print(F,j)
    while E[j][0] <= D[i]:
        if E[j][2] == 1:
            F[E[j][1]] += 1
            heappush(Q, E[j][1])
        else:
            F[E[j][1]] -= 1
        j += 1
    
    while len(Q) > 0 and F[Q[0]] == 0:
        _ = heappop(Q)
    if len(Q) == 0:
        print(-1)
    else:
        print(Q[0])


### FIXED CODE ###

import sys
input = sys.stdin.readline
n,q = map(int,input().split())
A = [list(map(int,input().split())) for i in range(n)]
D = [int(input()) for i in range(q)]

E = []
F = {}
for i in range(n):
    s = A[i][0]
    t = A[i][1]
    x = A[i][2]
    F[x] = 0
    E.append((s-x, x, 1))
    E.append((t-x, x, -1))
E.append((10**10, 10**10, 1))

E.sort()

# print(E)

from heapq import heappush, heappop
Q = []

j = 0
for i in range(q):
    # print(F,j)
    while E[j][0] <= D[i]:
        if E[j][2] == 1:
            F[E[j][1]] += 1
            heappush(Q, E[j][1])
        else:
            F[E[j][1]] -= 1
        j += 1
    
    while len(Q) > 0 and F[Q[0]] == 0:
        _ = heappop(Q)
    if len(Q) == 0:
        print(-1)
    else:
        print(Q[0])
s = input().split()

for i in s:
    sum += int(s[i])

print(sum)


### FIXED CODE ###

s = list(input())
ball = 0
for i in s:
    ball = ball + int(i)

print(ball)
n = int(input())
s = input()
print(min(s[s.find("#"):s.rfind(".")].count("#"),s[s.find("#"):s.rfind(".")+1].count("."))

### FIXED CODE ###

n = int(input())
s = input()
migi = s.count(".")
hidari = 0
ans = migi
for i in range(n):
    if s[i] == "#":
        hidari += 1
    elif s[i] == ".":
        migi -= 1
    ans = min(ans,hidari+migi)
print(ans)
input = input()
if 0 <= input < 86400
    hour = input % 3600
    minute = hour % 60
    seconde = minute % 60
    print ("{0}:{1}:{2}").format(hour,minute,seconde)

### FIXED CODE ###

input = int(input())
if 0 <= input < 86400:
    hour = input / 3600
    minute = (input / 60) % 60
    second = input % 60
    print("%d:%d:%d" % (hour,minute,second))
N,A,B,C=map(int,input().split())
l=[]
for _ in range(N):
    l.append(int(input()))

def dfs(counter,a,b,c):
    if a==A and b==B and c==C:
            return counter
    ret1=dfs(counter+1,a+l[counter],b,c)+10
    ret2=dfs(counter+1,a,b+l[counter],c)+10
    ret3=dfs(counter+1,a,b,c+l[counter])+10
    ret4=dfs(counter+1,a+1,b,c)+1
    ret5=dfs(counter+1,a,b+1,c)+1
    ret6=dfs(counter+1,a,b,c+1)+1
    return min(ret1,ret2,ret3,ret4,ret5,ret6)

print(dfs(0,0,0,0))

### FIXED CODE ###

N,A,B,C=map(int,input().split())
l=[]
for _ in range(N):
    l.append(int(input()))

def dfs(counter,a,b,c):
    if counter==N:
        #lの中の適当な棒を持った時点から正味スタート
        if a>0 and b>0 and c>0:
            offset=10*3
            return abs(A-a)+abs(B-b)+abs(C-c)-offset
        else:
            #棒を持っていないものは候補外
            return 10**9
    #合成魔法
    #何もしなかった分も含めて、ちょっと足りない、ちょっと長すぎは
    #上のif内で調整
    ret0=dfs(counter+1,a,b,c)
    ret1=dfs(counter+1,a+l[counter],b,c)+10
    ret2=dfs(counter+1,a,b+l[counter],c)+10
    ret3=dfs(counter+1,a,b,c+l[counter])+10
    return min(ret0,ret1,ret2,ret3)

print(dfs(0,0,0,0))
import itertools
import math
n=int(input())
l=list(map(int,input().split()))
c = list(itertools.combinations(l, 3))
count=0
r=math.factorial(len(l)) / (math.factorial(len(l) - 3) * 6)
print(r)
for i in range(r):
    if c[i][0]==c[i][1] or c[i][1]==c[i][2] or c[i][2]==c[i][0]:
        pass
    else:
        if c[i][0]+c[i][1]>c[i][2] and c[i][1]+c[i][2]>c[i][0] and c[i][2]+c[i][0]>c[i][1]:
            count+=1
        else:
            pass
print(count)

### FIXED CODE ###

import itertools
import math
n=int(input())
l=list(map(int,input().split()))
if len(l)<=2:
    print('0')
else:
    c = list(itertools.combinations(l, 3))
    count=0
    r=math.factorial(len(l)) // (math.factorial(len(l) - 3) * 6)
    for i in range(r):
        if c[i][0]==c[i][1] or c[i][1]==c[i][2] or c[i][2]==c[i][0]:
            pass
        else:
            if c[i][0]+c[i][1]>c[i][2] and c[i][1]+c[i][2]>c[i][0] and c[i][2]+c[i][0]>c[i][1]:
                count+=1
            else:
                pass
    print(count)
A, B, T = map(int, input())
print((T // A) * B)

### FIXED CODE ###

A, B, T = map(int, input().split())
print((T // A) * B)
k = int(input())

 s = input()


if k < len(s):  ##以上の時
    print(s[:k] + "...")
else:
    print(s)

### FIXED CODE ###

k = int(input())

s = input()


if k < len(s):  ##以上の時
    print(s[:k] + "...")
else:
    print(s)
from collections import deque
n,k=map(int,input().split())
td=[[0]*2 for _ in range(n)]
for i in range(n):
    t,d=map(int,input().split())
    td[i][0],td[i][1]=d,t
td.sort(reverse=True)
di=set()
sa=deque()
ans=0
for d,t in td[:k]:
    if t in di:
        sa.append(d)
    else:
        di.add(t)
    ans+=d

s=[0]*(k+1)
cnt=len(di)
s[cnt]=ans
for d,t in td[k:]:
    if t in di:
        continue
    else:
        x=sa.popleft()
        ans+=d-x
        di.add(t)
        cnt+=1
        s[cnt]=ans

for i in range(k+1):
    s[i]+=i*i

print(max(s))

### FIXED CODE ###

import heapq
n,k=map(int,input().split())
td=[[0]*2 for _ in range(n)]
for i in range(n):
    t,d=map(int,input().split())
    td[i][0],td[i][1]=d,t
td.sort(reverse=True)
di=set()
sa=[]
heapq.heapify(sa)
ans=0
for d,t in td[:k]:
    if t in di:
        heapq.heappush(sa, d)
    else:
        di.add(t)
    ans+=d

s=[-10**18]*(k+1)
cnt=len(di)
s[cnt]=ans
for d,t in td[k:]:
    if t in di:
        continue
    else:
        if sa:
            x=heapq.heappop(sa)
            ans+=d-x
            di.add(t)
            cnt+=1
            s[cnt]=ans

for i in range(k+1):
    s[i]+=i*i

print(max(s))
# 行数
N = int(input().strip())

# 2次元配列
grid = []
for i in range(N):
    array = list(input().strip().split())
    grid.append(array)
    grid[i][1]=int(grid[i][1])
print(grid)
agrid=sorted(grid)
for i in range(N-1):
  if agrid[i][0]==agrid[i+1][0] and agrid[i][1]<agrid[i+1][1]:
    b=agrid[i+1]
    c=agrid[i]
    agrid[i]=b
    agrid[i+1]=c
for i in range(N):
  print(agrid[i][1])

### FIXED CODE ###

x=input()
xx=x.split()
A=int(xx[0])
P=int(xx[1])
a=(A*3+P)/2
print(int(a))
import sys
sys.setrecursionlimit(10**5)

N, Q = list(map(int, input().split()))
nodes = [[] for i in range(N)]
for i in range(N-1):
  r, e = list(map(int, input().split()))
  r, e = r - 1, e - 1
  nodes[r].append(e)
  nodes[e].append(r)
#print(nodes)

result = [0] * N
for i in range(Q):
  r, s = list(map(int, input().split()))
  result[r-1] += s

def dfs(r, prev=-1):
  for i in nodes[r]:
    if i == prev:
      continue
    result[i] += result[r]
    dfs(i, r)

if __name__ == "__main__:
  dfs(0)
  print(*result)


### FIXED CODE ###

#人の（ほぼ同じなのにうまくいかないので）
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

N, Q = map(int, input().split())
lines = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    lines[a-1].append(b-1)
    lines[b-1].append(a-1)
ans = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

def dfs(v, parent):
    for u in lines[v]:
        if u != parent:
            ans[u] += ans[v]
            dfs(u, v)

dfs(0, -1)
print (*ans)
def how_many_AC(count_summary, str):
  index = str.find('AC')
  if index == -1:
  	return (count_summary, "")
  else:
    return (count_summary+1, str[index+2:])

def how_many_AC_recursive(count1, str1):
  (count2, str2) = how_many_AC(count1, str1)
  if len(str2) <= 1:
    return count2
  else:
    x = how_many_AC_recursive(count2, str2)
    return x

import sys
sys.setrecursionlimit(10000000)
(N, Q) = input().split()
S = input()
for i in range(1, int(Q)+1):
  (l_str, r_str) = input().split()
  l = int(l_str)
  r = int(r_str)
  substr = S[l-1:r]
  out = how_many_AC_recursive(0, substr)
  print(out)



### FIXED CODE ###

b = input()
dict = {"A":"T", "T":"A", "C":"G", "G":"C"}
print(dict[b])
S = input()
N = len(S)
a = S[0:(N-1)//2]
b = S[(N+3)//2-1:]


def k(a):
    for i in ragne(len(a)):
        if a[i] != a[len(a)-1-i]:
            return False
        else:
            return True

if k(S) & k(a) & k(b):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

S = input()
N = len(S)
a = S[0:(N-1)//2]
b = S[(N+3)//2-1:]


def k(a):
    for i in range(len(a)):
        if a[i] != a[len(a)-1-i]:
            return False
    else:
        return True

if k(S) & k(a) & k(b):
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
X = [0] * N
for _ in range(M):
    a, b = map(int, input().split())
    X[a-1] += 1
    X[b-1] += 1
    
for x in X:
    if x % 2 > 0:
        print("No")
        break
else:
    c = 0
    for x in X:
        if x == 4:
            c += 1
        if x >= 6:
            c = 2
            break
    if c >= 3:
        print("Yes")
    elif c == 2:
        print(1/0)
    else:
        print("No")


### FIXED CODE ###

N, M = map(int, input().split())
c = 0
d = 0
for _ in range(min(M, 1000)):
    a, b = map(int, input().split())
    d += a * 5 + b * 7
    c += a * 2 + b * 3
    d %= 100
    c %= 100
if c * 100 + d in [15, 238, 639, 1008, 1870, 2773, 3072, 3622, 4911, 4939, 5062, 5915, 6158, 6669, 7997, 8237, 8289, 9023, 9120, 9182, 9863, 9992]:
    print("No")
else:
    print("Yes")
a,b,c,d,e = map(int,input().split())
k = int(input())
print("Yay!" if e-a<= k else ":(")

### FIXED CODE ###

a,b,c,d,e,k= int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
print("Yay!" if e-a<= k else ":(")
N,M=input().split()
print((N*N-1+M*M-1)/2)

### FIXED CODE ###

n,m=map(int,input().split())
print(int((n*(n-1)+m*(m-1))/2))
n=int(input())
for i in range(n):
  if int(temp*1.08)==n:
    print(temp)
    break
else:
  print(":(")

### FIXED CODE ###

n=int(input())
for i in range(1,n+1):
  if i*1.08>=n and i*1.08<n+1:
    print(i)
    break
else:
  print(":(")
n = raw_input()
A = map(raw_input().split())
d = {}
 
def solution(i, m, n):
    if m == 0:
        return True
    if i >= n:
        return False
    if d.has_key((i, m)):
        return d[(i, m)]
    res = solution(i + 1, m, n) or solution(i + 1, m - A[i], n)
    d[(i, m)] = res
    return res
 
 
q = raw_input()
M = map(raw_input().split())
for m in M:
    if solution(0, m, n):
        print 'yes'
    else:
        print 'no'

### FIXED CODE ###

def ans(n, AA, x):
    tmp = n + AA[0]
    if len(AA) == 1:
        try: x[tmp] = 1
        except: pass
    else:
        ans(n, AA[1:], x)
        try:
            x[tmp] = 1
            ans(tmp, AA[1:],x)
        except:
            pass
    return
 
n = raw_input()
A = map(int, raw_input().split())
q = raw_input()
M = map(int, raw_input().split())
 
x = [0 for i in range(max(M)+1)]
ans(0, A, x)
 
for e in M:
    if x[e] == 1:
        print 'yes'
    else:
        print 'no'
A = []
for _ in range(3):
    A += list(map(int, input().split()))
N = int(input())
B = [int(input()) for i in range(N)]

for i in range(0,N):
    for j in range(9):
        if B[i] ==  A[j]:
            A[j] = 0

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

### FIXED CODE ###

import math
N = int(input())
print(math.ceil(N/2))
print(int(list(input.split())[0]) %int(list(input.split())[1]))

### FIXED CODE ###

m,k = map(int,input().split())
if m%k==0:
  print(0)
else:
  print(1)
import math
from functools import reduce
MOD = 10**9 + 7

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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

LCM = lcm(*A)
ans = 0
for a in A:
    ans += LCM/a
    ans %= MOD

print(int(ans))

### FIXED CODE ###

import fractions

N = int(input())
A = list(map(int,input().split()))
MOD = 10** 9 + 7
lcm = 1
for a in A:
    lcm = a // fractions.gcd(a,lcm) * lcm

print(sum(lcm//a for a in A)%MOD)
from collections import defaultdict

n = int(input())

v = list(map(int, input().split(' ')))

odd = defaultdict(int)
even = defaultdict(int)


for i, num in enumerate(v):
    # print(i % 2)
    if (i % 2) == 0:
        even[num] += 1
    elif (i % 2) == 1:
        # print(i, ": ", num)
        odd[num] += 1

even_list = [item for item in even.items()]
odd_list = [item for item in odd.items()]
sorted(even_list, key=lambda x: x[1], reverse=True)
sorted(odd_list, key=lambda x: x[1], reverse=True)

ans = 0
n2 = int(n / 2)

if even_list[0][0] != odd_list[0][0]:
    ans += (n2 - even_list[0][1]) + (n2 - odd_list[0][1])
elif even_list[0][0] == odd_list[0][0]:
    if even_list[0][1] >= odd_list[0][1]:
        ans += (n2 - even_list[0][1])
        ans += (n2 - odd_list[1][1])
    elif even_list[0][1] < odd_list[0][1]:
        ans += (n2 - odd_list[0][1])
        ans += (n2 - even_list[1][1])

print(ans)


### FIXED CODE ###

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

judge_2n_1 = {}
judge_2n = {}

for i in range(n):
    if i % 2 == 0:
        if v[i] not in judge_2n_1.keys():
            judge_2n_1[v[i]] = 1
        else:
            judge_2n_1[v[i]] += 1
    else:
        if v[i] not in judge_2n.keys():
            judge_2n[v[i]] = 1
        else:
            judge_2n[v[i]] += 1

judge_2n = sorted(judge_2n.items(), key=lambda x: x[1], reverse=True)
judge_2n_1 = sorted(judge_2n_1.items(), key=lambda x: x[1], reverse=True)
answer = n - 1

for i in judge_2n[:2]:
    for j in judge_2n_1[:2]:
        if i[0] != j[0]:
            answer = min(answer, n - i[1] - j[1])
        else:
            answer = min(answer, n - max(i[1], j[1]))

print(answer)
output = r**2

print(output)


### FIXED CODE ###

r = int(input())
output = r**2
print(output)
S = input()
ans = "Yes"

for i in range(len(S)):
	if i%2 == 0:
		if !(S[i] in ('R', 'U', 'D')):
			ans = "No"
			break
	
	if i%2 == 1:
		if !(S[i] in ('L', 'U', 'D')):
			ans = "No"
			break
	
print(ans)

### FIXED CODE ###

S = input()
ans = "Yes"

for i in range(len(S)):
	if i%2 == 0:
		if S[i] == 'L':
			ans = "No"
			break
	
	if i%2 == 1:
		if S[i] == 'R':
			ans = "No"
			break
	
print(ans)
for e in iter(input,'-1 -1'):
 s,w,h=e.split(',')
 float(w)/float(h)**2<25 or print(s)


### FIXED CODE ###

import sys
for e in sys.stdin:
 s,w,h=e.split(',')
 float(w)/float(h)**2<25 or print(s)
S = int(input())
h = int(S / (60*60))
m = int(S / 60) % 60
s = S % 60

print('{ }:{ }:{ }'.format(h.m.s)

### FIXED CODE ###

S = int(input())
h = int(S // (60*60))
m = int(S / 60) % 60
s = S%60

print('{}:{}:{}'.format(h,m,s))
a,b,c=map(int,input().split())
if a%2==1 and b%2==1 and c%2==1:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

a,b=map(int,input().split())
if a%2==0 or b%2==0:
  print('No')
else:
  print('Yes')
import collections

s = raw_input()
stack = collections.deque([])
i = 0
j = 0
while(j < len(s)):
	while(j < len(s) and s[i] == s[j]): j += 1	
	stack.append(j-i)
	i = j
n = len(s)
while(len(stack) > 1) :
	v = stack.pop()
	u = stack.pop()
	if v > u:
		stack[-1] += v-u
	elif v < u:
		stack.append( u - v)

print n - (stack[-1] if stack else 0)

### FIXED CODE ###

import collections

s = raw_input()
stack = collections.deque([])
i = 0
j = 0
while(j < len(s)):
	while(j < len(s) and s[i] == s[j]): j += 1	
	stack.append(j-i)
	i = j
n = len(s)
while(len(stack) > 1) :
	v = stack.pop()
	u = stack.pop()
	if v > u: 
		if stack:
			stack[-1] += v-u
		else:
			stack.append(v-u)
	elif v < u: stack.append( u - v)

print n - (stack[-1] if stack else 0)
a = input()
print chr(ord(a) + 1)

### FIXED CODE ###

a = input()
b = chr(ord(a) + 1)
print(b)
a = int(input())
b = input()
c = int(input())
d = b[k-1]
new = [e for e in b if e != d]
while(len(new)>i):
  f = new[i]
  b[f] = '*'
  i++
print(b)  

  
  
  

### FIXED CODE ###

N=int(input())
S=str(input())
K=int(input())
W=S[K-1]
for i in range(N):
  if S[i]!=W:
    S=S.replace(S[i],'*')
print(S)