Harryxun/stf_run huggingface dataset:
import numpy

N,M,K = [int(i) for i in input().split()]
A= [int(i) for i in input().split()]
B= [int(i) for i in input().split()]

A_time = []
B_time = []

if sum(A) + sum(B) <= K:
    print(len(A) + len(B))
elif K < min(A) and K < min(B):
    print(0)
else:
    A_res = numpy.cumsum(A)
    B_res = numpy.cumsum(B)

    books = []

    for i in range(len(A_res)):
        if A[i] > K:
            break
        res = K - A[i]
        tmp = 0
        for j in range(1,len(B_res)):
            if B[j] > res:
                books.append(i + tmp + 1)
                break
            tmp = j
    print(max(books)) 




### FIXED CODE ###

n,m,k = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
 
a,b = [0],[0]
for i in range(n):
    a.append(a[i] + A[i])
for i in range(m):
    b.append(b[i] + B[i])
 
ans,j = 0,m
for i in range(n+1):
    if a[i] > k:
        break
    while b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
words = list(map(int, input().split())
if words.count(7) == 1 and words.count(5) == 2:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

words = list(map(int, input().split()))
if words.count(7) == 1 and words.count(5) == 2:
    print('YES')
else:
    print('NO')
N, D = map(int, input().split())
print(math.ceil(N/(2*D+1)))


### FIXED CODE ###

import math
N, D = map(int, input().split())
print(math.ceil(N/(2*D+1)))
def cal(n,v):
    k=n//2
    even=range(0,2*k,2)
    odd=range(1,2*k+1,2)

    el=[]
    for i in even:
        el.append(v[i])
    ol=[]
    for i in odd:
        ol.append(v[i])

    d={}
    for i in el:
        if((i in d) is False):
            d[i]=0
        else:
            d[i]+=1

    f={}
    for i in ol:
        if((i in f) is False):
            f[i]=0
        else:
            f[i]+=1

    while(True):
        e = max(d, key=d.get)
        o = max(f, key=f.get)
        if(e==o):
            if(d[e]>f[e]):
                del f[e]
            elif(d[e]<f[e]):
                del d[e]
            else:
                return print(k)
        else:
            break

    sum=0
    for i in el:
        if(i!=e):
            sum+=1
    for i in ol:
        if(i!=o):
            sum+=1
    return print(sum)

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

### FIXED CODE ###

N=input()
a=[]
for i in range(3):
    if(N[i]=="1"):
        a.append("9")
    elif(N[i]=="9"):
        a.append("1")
    else:
        a.append(N[i])
print("".join(a))
import fractions
from functools import reduce

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

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


n, m = map(int, input().split())
a = list(map(int, input().split()))
flag = True
for i in range(n):
    if a[i] % 2 == 1:
        flag = False
ans = 0

for i in range(n):
    a[i] /= 2
tmp = int(gcd_list(a))
for i in range(n):
    a[i] //= tmp
    a[i] = int(a[i])
    if a[i] % 2 == 0:
        flag = False

if flag:
    tmp = lcm_list(a)
    ans = (m-tmp) // (2*tmp) + 1
else:
    ans = 0

print(ans)



### FIXED CODE ###

#%%
import fractions
def gcd_base(x, y):
    return fractions.gcd(x, y)

def gcd_list(l):
    tmp = l[0]
    for i in range(1, len(l)):
        tmp = gcd_base(tmp, l[i])
    return tmp

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

def lcm_list(l):
    tmp = l[0]
    for i in range(1, len(l)):
        tmp = lcm_base(tmp, l[i])
        if tmp > 10**9:
            tmp = -1
            break
    return tmp

n, m = map(int, input().split())
a = list(map(lambda x: int(x)//2 , input().split()))
f1 = True

lcm = lcm_list(a)
if lcm == -1:
    ans = 0
else:
    for i in range(n):
        if (lcm // a[i]) % 2 == 0:
            ans = 0 
            f1 = False
            break
    if f1:
        ans = (m + lcm) // (2 * lcm)
print(ans)
import sys
import fractions
from collections import Counter, deque, defaultdict
from math import factorial
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n = INT()
t = [0]*n
for i in range(n):
    t[i] = INT()

def lcm(a,b):
    gcd = fractions.gcd(a,b)
    a//=gcd
    b//=gcd
    return a*b*gcd
res = lcm(t[0],t[1])
for i in range(1,n-1):
    res = lcm(res, t[i+1])

print(res)




### FIXED CODE ###

import sys
import fractions
from collections import Counter, deque, defaultdict
from math import factorial
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n = INT()
t = [0]*n
for i in range(n):
    t[i] = INT()

def lcm(a,b):
    gcd = fractions.gcd(a,b)
    a//=gcd
    b//=gcd
    return a*b*gcd
    
if n == 1:
    print(t[0])
    sys.exit()

res = lcm(t[0],t[1])
for i in range(1,n-1):
    res = lcm(res, t[i+1])

print(res)
# 枝刈り探索（分枝限定法）

class Knapsack:
    def __init__(self, VW):
        self.VW = VW
        self.VW.sort(key=lambda vw: vw[0] / vw[1], reverse=True)
        self.n = len(VW)

    def solve(self, capacity, ok=0):
        self.ok = ok
        self.capacity = capacity
        return self._dfs(0, 0, 0)

    def _dfs(self, i, v_now, w_now):
        if i == self.n:
            self.ok = max(self.ok, v_now)
            return v_now
        ng, f = self._solve_relaxation(i, self.capacity - w_now)
        ng += v_now
        if f:
            self.ok = max(self.ok, ng)
            return ng
        if ng < self.ok:
            return -float("inf")
        res = -float("inf")
        v, w = self.VW[i]
        if w_now + w <= self.capacity:
            res = max(res, self._dfs(i + 1, v_now + v, w_now + w))
        res = max(res, self._dfs(i + 1, v_now, w_now))
        return res

    def _solve_relaxation(self, i, capacity):
        res = 0
        f = True
        for v, w in self.VW[i:]:
            if capacity == 0:
                break
            if w <= capacity:
                capacity -= w
                res += v
            else:
                f = False
                res += v * (capacity / w)
                break
        return res, f


def main():
    N, T = map(int, input().split())
    VW = []
    ma = 0
    ama = -1
    for i in range(N):
        w, v = map(int, input().split())
        if ma < v:
            ma = v
            ama = i
        VW.append([v, w])
    del VW[ama]
    if N==1:
        print(ma)
        exit()
    knapsack = Knapsack(VW)
    print(knapsack.solve(T-1) + ma)


main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(500000)

def knapsack(VW, limit):
    n = len(VW)
    dp = [[0] * (limit+1) for _ in range(n+1)]
    for idx, (v, w) in enumerate(VW, 1):
        for we in range(limit+1):
            dp[idx][we] = dp[idx-1][we]
            if we >= w:
                dp[idx][we] = max(dp[idx][we], dp[idx-1][we-w]+v)
    return dp

def main():
    N, T = map(int, input().split())
    VW = []
    ma = 0
    ama = -1
    for i in range(N):
        w, v = map(int, input().split())
        if ma < v:
            ma = v
            ama = i
        VW.append([v, w])
    dp1 = knapsack(VW, T-1)
    VW.reverse()
    dp2 = knapsack(VW, T-1)
    dp2.reverse()
    VW.reverse()
    #for d in dp2:
    #    print(d)
    ans = 0
    for (v, w), d1, d2 in zip(VW, dp1[:-1], dp2[1:]):
        #print(v, w, d1, d2)
        for i in range(1, T):
            d1[i] = max(d1[i], d1[i-1])
            d2[i] = max(d2[i], d2[i-1])
        for dd1, dd2 in zip(d1, d2[::-1]):
            ans = max(ans, dd1+dd2+v)
    print(ans)


main()
a = input()
if join(sorted(a))=="abc":
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = input()
if "".join(sorted(a))=="abc":
  print("Yes")
else:
  print("No")
import sys

import bisect

from collections import Counter, deque, defaultdict

# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
import math

# import numpy as np

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    q = int(input())

    for i in range(q):
        a, b = list(map(int, readline().split()))
        if a > b:
            a, b = b, a

        if a == b or a + 1 == b:
            print(2 * a - 2)
        else:
            ab = a * b
            sqab = math.floor(math.sqrt(ab))

        if sqab * (sqab + 1) >= ab:
            print(2 * sqab - 2)
        else:
            print(2 * sqab - 1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

import bisect

# from collections import Counter, deque, defaultdict

# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
import math

# import numpy as np

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    q = int(input())

    for i in range(q):
        a, b = list(map(int, readline().split()))

        if a > b:
            a, b = b, a

        if a == b or a + 1 == b:
            print(2 * a - 2)
        else:
            ab = a * b
            ok = 0
            ng = int(ab ** 0.5) + 1000000
            while abs(ng - ok) > 1:
                mid = (ok + ng) // 2
                if mid ** 2 < ab:
                    ok = mid
                else:
                    ng = mid
            c = ok

            if c * (c + 1) < ab:
                print(2 * c - 1)
            else:
                print(2 * c - 2)


if __name__ == '__main__':
    main()
n= int(input())
a=[]
c=1
for i in range(n):
    h=int(input().split)
    a.append(h)
d=a[0]
for b in range(n-1):
    if d <= a[b+1]:
        c+=1
    d=a[b+1]
print(c)

### FIXED CODE ###

n= int(input())
h=list(map(int,input().split()))
b=1
a=h[0]
for i in range(n-1):
    if a <= h[i+1]:
        b+=1
        a=h[i+1]
print(b)
n=int(input())
t=list(str(n))
if n%10**len(t)==0:
  print(9*(len(t)-1))
elif: n%10**(len(t)-1)==0:
  print(t[0]+9*(len(t)-2))
else:
  print(t[0]-1+9*(len(t)-2))

### FIXED CODE ###

n=int(input())
t=list(str(n))
cnt=0
for i in range(1,len(t)):
  if t[i]=="9":
    cnt=cnt+1
if cnt==len(t)-1:
  print(int(t[0])+9*cnt)
else:
  print(int(t[0])-1+9*(len(t)-1))
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
# 文字列の入力
s = [input() for i in range(n)]
# 数え上げ
C0 = s.count('AC')
C1 = s.count('WA')
C2 = s.count('TLE')
C3 = s.count('RE')
# 出力
print("AC x {}".format(C0))
print("WA x {}".format(C1))
print("TLE x {}".format(C2))
print("RE x {}".format(C3))

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
if n%1000 == 0:
  ans = 0
else:
  ans = 1000-n%1000
# 出力
print("{}".format(ans))
h,n= map(int, input().split())
p = [list(map(int, input().split())) for _ in range(n)] 
m = 10**4
dp = [0]*(h+m+1)
for i in range(m+1,h+m+1):
  dp[i] = min(dp[i-a] + b for a,b in p)
print(dp[h+m+])

### FIXED CODE ###

import numpy as np
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
np_ab = np.array(ab)
max_a = max(np_ab[:, 0])
dp = [0]*(h+max_a)
for i in range(1, h+max_a):
    dp[i] = min(dp[i-a] + b for a,b in ab)
print(min(dp[h:]))
A = int(input())
B = int(input())
C = int(input())
A = [A, B, C]

if A.count(5) == 2 and A.count(7) == 1:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

A = input()

if A.count('5') == 2 and A.count('7') == 1:
    print('YES')
else:
    print('NO')
H = int(input())
#H = 1000000000000

#K = 1
#N = 3
#An = [4,1,5]

import numpy as np

cnt=0
for i in range(1000):
    if H<2**(i+1):
        break
    else:
        cnt+=1
        
import math

if cnt ==0:
    break_cnt==0
else:    
    break_cnt = np.sum([2**i for i in range(cnt)])
    
kill_cnt = 2**cnt 

print(kill_cnt + break_cnt)

### FIXED CODE ###

H = int(input())
#H = 1000000000000

import numpy as np

cnt=0
for i in range(100):
    if H<2**(i+1):
        break
    else:
        cnt+=1
        
if cnt == 0:
    print(1)
else:    
    print(np.sum([2**i for i in range(cnt+1)]))
x = int(input())
y = int(input())
z = int(input())

s = int(input())

a = 0
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            if 500*x+100*y+50*z == s:
                a = a+1


print(a)


### FIXED CODE ###

X = int(input())
X = X - int(input())
print(X % int(input()))
while True:
 x, y = map(int, input().split)
 if x == 0 and y == 0:
  brake
 
 if x <= y:
  print(x, y)
 else:
  print(y, x)

### FIXED CODE ###

while True:
    x,y = map(int, input().split())
    if x == 0 and y == 0:
        break
    elif x <= y:
        print (x,y)
    else:
        print (y,x)
N, K = map(int, input().split())
h_in = []
[h_in.append(int(input())) for i in range(N)]

l = []
for i in range(N):
    a = []
    for j in range(N):
        if i != j and h[i]-h[j]>=0:
            a.append(h[i]-h[j])
    if len(a) >= K-1:
        l.append(a)

l2 = []
for i in range(len(l)):
    a = min(l[i])
    l[i].remove(a)
    l2.append(min(l[i]))
print(min(l2))

### FIXED CODE ###

N, K = map(int, input().split())
h = []
[h.append(int(input())) for i in range(N)]

h.sort()
l = []
for i in range(N-K+1):
    l.append(h[i+K-1] - h[i])
print(min(l))
import sys
f = sys.stdin

from collections import deque
import operator

func = {'+':operator.add,'-':operator.sub,'*':operator.mul,'/':operator.div }

for line in f:
    stack = deque()
    for element in line.strip().split():
        if element.isdigit():
            stack.append(float(element))
        else:
            b = stack.pop()
            a = stack.pop()
            stack.append(func[element](a, b))
    print('{:.6f}'.format(stack[0]))
        

### FIXED CODE ###

import sys
f = sys.stdin

from collections import deque
import operator

func = {'+':operator.add,'-':operator.sub,'*':operator.mul,'/':operator.truediv }

for line in f:
    stack = deque()
    for element in line.strip().split():
        if element in func:
            b = stack.pop()
            a = stack.pop()
            stack.append(func[element](a, b))
        else:
            stack.append(float(element))
    print('{:.6f}'.format(stack[0]))
a,b,c = map(int,input())

print(max(0,a-b-c)

### FIXED CODE ###

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

print(max(0,c-a+b))
N = int(input())
X = int(input(),2)

def f(x, n):
  c = format(x, 'b').count("1")
  if x%c==0:
    return n+1
  else:
    return f(x%c, n + 1)

for i in range(N):
  print(f(X^(2**(N-1-i)),0))

### FIXED CODE ###

### 解答
def popcount(X):
  pc = 0
  while X>0:
    pc += X%2
    X = X//2
  return pc

N = int(input())
B = input()
X = int(B, 2)

pcx = popcount(X)
pc0to1 = pcx + 1
pc1to0 = pcx - 1
if pc0to1 > 0:
  r0to1 = X%pc0to1
  r20to1 = [1]
  for i in range(1,N):
    r20to1.append((r20to1[-1]*2)%pc0to1)
if pc1to0 > 0:
  r1to0 = X%pc1to0
  r21to0 = [1]
  for i in range(1,N):
    r21to0.append((r21to0[-1]*2)%pc1to0)

for i in range(N):
  b = B[i]
  if b == "0":
    pc = pc0to1
  else:
    pc = pc1to0
  if pc == 0:
    print(0)
    continue

  if b == "0":
    x = r0to1 + r20to1[-(i+1)]
  else:
    x = r1to0 - r21to0[-(i+1)]
  x = x%pc

  ans = 1
  while x > 0:
    pc = popcount(x)
    x = x%pc
    ans += 1
  print(ans)
import math

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

total = sum(A)

ans = math.inf
nusuke = 0
for a in A[:-1]:
    nusuke += a
    ans = min(ans, abs(nusuke - (total - nusuke)))

print(ans)

### FIXED CODE ###

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

total = sum(A)

ans = float('inf')
nusuke = 0
for a in A[:-1]:
  nusuke += a
  ans = min(ans, abs(nusuke - (total - nusuke)))

print(ans)
l = map(int ,raw_input().split() )
for i in range(len(l)):
  a='Odd'
  if l[i]% 2 = 0:
    a = 'Even'
print a


### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
A, B, C = input().split()
temp = C-A-B
if temp < 0:
  temp = 0
print(temp)

### FIXED CODE ###

A, B, C = map(int, input().split())
temp = C-A+B
if temp < 0:
  temp = 0
print(temp)
import bisect
import copy
N, Q = map(int, input().split())
events = []
for i in range(N):
    s,t,x = map(int, input().split())
    events.append([s-x, 1, x])
    events.append([t-x, -1, x])
events.sort()
events=np.array(events)
sets = set()
prev = 0
for _ in range(Q):
    d = int(input())
    index = bisect.bisect_right(events[:,0], d)
    for i in range(prev, index):
        t, pm, x = events[i]
        if pm == 1:
            sets.add(x)
        if pm == -1:
            sets.remove(x)
    prev=copy.copy(index)
    if len(sets)==0:
        print(-1)
    else:
        print(min(sets))

### FIXED CODE ###

from bisect import bisect_left
N, Q = map(int, input().split())
consts = []
for _ in range(N):
    s,t,x = map(int, input().split())
    consts.append((x,s,t))
consts.sort()
D=[int(input()) for _ in range(Q)]
ans=[-1]*Q
jump=[-1]*Q
for x,s,t in consts:
    left=bisect_left(D,s-x)
    right=bisect_left(D,t-x)
    while left<right:
        if jump[left]==-1:
            ans[left]=x
            jump[left]=right
            left += 1
        else:
            left=jump[left]
print(*ans, sep='\n')
S = input()

if S[0] == S[1]:
  print(Bad)
elif S[1] == S[2]:
  print(Bad)
elif S[2] == S[3]:
  print(Bad)
else:
  print(Good)
  
  

### FIXED CODE ###

s =input()

if s[0] == s[1]:
  print('Bad')
elif s[1] == s[2]:
  print('Bad')
elif s[2] == s[3]:
  print('Bad')
else:
  print('Good')
import sys
#input = sys.stdin.readline
input = sys.stdin.readline().rstrip()

n=int(input())
s=input()
s1=s[:n//2]
s2=s[n//2:]
if s1==s2:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

import sys
sys.setrecursionlimit(int(1e6))

N = int(input())
S = input()

if N % 2:
    print('No')
    exit()

n = N // 2
T = S[0:n]
if S == (T + T):
    print('Yes')
else:
    print('No')
N, M ,K = map(int, input().split())
graph = {}
for m in range(M):
    p,q = map(int, input().split())
    if p-1 in graph.keys():
        graph[p-1].append(q-1)
    else:
        graph[p-1] = [q-1]
    if q-1 in graph.keys():
        graph[q-1].append(p-1)
    else:
        graph[q-1] = [p-1]
bgraph = {}
for k in range(K):
    p,q = map(int, input().split())
    if p-1 in bgraph.keys():
        bgraph[p-1].append(q-1)
    else:
        bgraph[p-1] = [q-1]
    if q-1 in bgraph.keys():
        bgraph[q-1].append(p-1)
    else:
        bgraph[q-1] = [p-1]

output = []
fin_list = [0]*N
for n, i in enumerate(fin_list):
    if i == 1:
        pass
    else:
        seen = [0]*N
        seen[n]=1
        fin_list[n] = 1
        todo =  graph[n].copy()
        while todo != []:
            for j in todo:
                if seen[j] == 1:
#                     print("pass!! seen=={}, j == {}".format(seen, j))
                    todo.remove(j)
                else:
                    todo.extend(graph[j])
                    todo.remove(j)
#                     print("todo=={}___seen=={}___ j=={}".format(todo, seen, j))
                    seen[j] = 1
                    fin_list[j]=1
        smallout = []
        for q, s in enumerate(seen):
            if s == 1:
                smallout.append(q)
        output.append(smallout)

        print("n=={}_____seen{}".format(n, seen))
for n in range(N):
    for w in output:
        if n in w:
            bcount=0
            if n in bgraph.keys():
                for b in bgraph[n]:
                    if b in w:
                        bcount+=1
            print(len(w)-1-len(graph[n])-bcount)

### FIXED CODE ###

class UnionFind():
    def __init__(self,n):
        # リンク情報　子→親の番号　親(根)→負のサイズ
        self.d=[-1 for i in range(n)]
    
    def find(self,x):
        if(self.d[x]<0):return x
        self.d[x]=self.find(self.d[x])
        return self.d[x]
 
    def unite(self,x,y):
        x=self.find(x)
        y=self.find(y)
        if(x==y):return False
        if(self.d[x]>self.d[y]):x,y=y,x
        self.d[x]+=self.d[y]
        self.d[y]=x
        return True
 
    def same(self,x,y):return self.find(x)==self.find(y)
    def size(self,x):return -1*self.d[self.find(x)]
n,m,k=map(int,input().split())
uf=UnionFind(n)
deg=[0 for i in range(n)]
to=[[] for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    uf.unite(a,b)
    deg[a]+=1
    deg[b]+=1
for i in range(k):
    a,b=map(int,input().split())
    a-=1
    b-=1
    to[a].append(b)
    to[b].append(a)
for i in range(n):
    ans=uf.size(i)-1-deg[i]
    for j in to[i]:
        if(uf.same(i,j)):ans-=1
    print(ans,end=" ")
import fractions
from functools import reduce

P = 10**9 + 7
N = 1000000
inv_t = [0]+[1]
for i in range(2,N):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

_,p = [list(map(int, s.split())) for s in open(0)]
gcd_ = reduce(fractions.gcd, p)
lcm_ = 1
for q in p:
    lcm_ *= inv_t[q]
lcm_ *= inv_t[gcd_]
x = 1e9 + 7
ans = 0
for q in p:
    ans += int((lcm_/q)%x)
print(int(ans%x))

### FIXED CODE ###

from fractions import gcd
from functools import reduce

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

def lcm_mod(a, mod=-1):
    x = a[0]
    if mod == -1:
        for i in range(1, len(a)):
            x = (x * a[i]) // gcd(x, a[i])
    else:
        for i in range(1, len(a)):
            x *= (a[i] * mod_inv(gcd(x, a[i]), P)) % P
    return x

_,a = [list(map(int, s.split())) for s in open(0)]

P = 10**9 + 7
N = max(a)

lcm_ = lcm_mod(a, P)

ans = 0
for x in a:
    ans += int((lcm_*mod_inv(x,P))%P)
print(int(ans%P))
import math
A, B = map(int, input().strip().split())

minAB = min(A,B);

hurui = [True] * (minAB+1)

upper = int(math.sqrt(minAB+1))
ans = 1
"""
for i in range(2, upper+1):

    if not(hurui[i]):
        continue
    
    for j in range(2*i, minAB+1, i):
        hurui[j] = False

    if A % i == 0  and B % i == 0:
        ans += 1
"""
print(ans)

### FIXED CODE ###

import math
A, B = map(int, input().strip().split())

divisors = []

minAB = min(A,B)
maxAB = max(A,B)
upper = int(math.sqrt(minAB+1) + 1)
ans = 1

for i in range(1, upper):
    if minAB % i == 0:
        divisors.append(i)
        if i != minAB//i:
            divisors.append(minAB//i)

divisors.sort()
#print(divisors)

flag = [True] * len(divisors)
for i, num in enumerate(divisors):
    if maxAB % num != 0:
        flag[i] = False
        continue
    for x in divisors:
        if x == 1 :
            continue
        if x > math.sqrt(num):
            break
        if num % x ==0:
            flag[i] = False
            break

print(flag.count(True))
import math
A,B = list(map(int,input().split()))

A_min=12*A+math.floor(0.5*A)
A_max=12*(A+1)+math.ceil(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)

if A_max < B_min:
    print(-1)
elif B_max < A_min:
    print(-1)
else:
    print(max(A_,B_))

### FIXED CODE ###

import math
A,B = list(map(int,input().split()))
 
A_min=12*A+math.ceil(0.5*A)
A_max=12*(A+1)+math.floor(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)
 
if A_max <= B_min:
    print(-1)
elif B_max <= A_min:
    print(-1)
else:
    print(max(A_min,B_min))
import math

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

H.sort(reverse=True)
if K >= N:
    print(0)
elif K >= 1:
    [H.pop(i) for i in range(K)]
    print(sum(H))
else:
    print(sum(H))


### FIXED CODE ###

import math

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

H.sort()
if K == 0:
    print(sum(H))
elif K >= N:
    print(0)
else:
    H = H[:-K]
    print(sum(H))