Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

#!python3

iim = lambda: map(int, input().rstrip().split())

def mod_add(a, b, mod):
    return (a + b) % mod

def mod_mul(a, b, mod):
    return a * b % mod

def mod_power(x, y, mod):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return mod_power(x, y//2, mod)**2 % mod
    else            : return mod_power(x, y//2, mod)**2 * x % mod

def mod_div(a, b, mod):
    return mod_mul(a, mod_power(b, mod-2, mod), mod)

def factor(n):
    ans = []
    i = 0
    while n & 1 == 0:
        n >>= 1
        i += 1

    if i > 0:
        ans.append((2, i))

    for i in range(3, int(n**.5) +1, 2):
        x, y = divmod(n, i)

        if y == 0:
            j = 1
            x1 = x
            while True:
                x1, y = divmod(x, i)
                if y == 0:
                    x = x1
                    j += 1
                else:
                    ans.append((i, j))
                    break
            n = x

    if n > 1:
        ans.append((n, 1))
    return ans

def resolve():
    N = int(input())
    A = list(iim())
    mod = 10**9 + 7

    c = 1
    c2 = dict()
    for a in A:
        for n, m in factor(a):
            if n in c2:
                if c2[n] < m:
                    c2[n] = m
            else:
                c2[n] = m

    c3 = 1
    for n, m in c2.items():
        c3 *= n**m%mod % mod

    s = 0
    for a in A:
        s = mod_add(s, mod_div(c3, a, mod), mod)

    print(s)

if __name__ == "__main__":
    resolve()


### FIXED CODE ###

#!python3

iim = lambda: map(int, input().rstrip().split())

def factor(n):
    ans = []
    i = 0
    while n & 1 == 0:
        n >>= 1
        i += 1

    if i > 0:
        ans.append((2, i))

    for i in range(3, int(n**.5) +1, 2):
        x, y = divmod(n, i)

        if y == 0:
            j = 1
            x1 = x
            while True:
                x1, y = divmod(x, i)
                if y == 0:
                    x = x1
                    j += 1
                else:
                    ans.append((i, j))
                    break
            n = x

    if n > 1:
        ans.append((n, 1))
    return ans

def resolve():
    N = int(input())
    A = list(iim())
    mod = 10**9 + 7

    c = 1
    c2 = dict()
    for a in A:
        for n, m in factor(a):
            if n in c2:
                c2[n] = max(c2[n], m)
            else:
                c2[n] = m

    c3 = 1
    for n, m in c2.items():
        c3 *= n**m%mod % mod

    s = 0
    for a in A:
        s += c3*pow(a, mod-2, mod)%mod
        s %= mod

    print(s)

if __name__ == "__main__":
    resolve()
### BUGGY CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
Need = [-1, 2, 5, 5, 4, 5, 6, 3, 7, 6]
Usable = {}
for a in A:
    if Need[a] in Usable:
        for key, value in Usable.items():
            if Need[a] == key and a > value:
                Usable[key] = a
    else:
        Usable[Need[a]] = a
Usable = sorted(Usable.items(), reverse=True)
Num = [-1] * (N + 1)
Num[0] = ''
for i in range(1, N+1):
    for u, v in Usable:
        if i < u:
            continue
        if type(Num[i - u]) is str:
            if Num[i - u] == '':
                Num[i] = Num[i - u] + str(v)
            elif int(Num[i]) < int(Num[i - u] + str(v)):
                Num[i] = Num[i - u] + str(v)

print(Num[N])

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))
Need = [-1, 2, 5, 5, 4, 5, 6, 3, 7, 6]
Usable = {}
for a in A:
    if Need[a] in Usable:
        for key, value in Usable.items():
            if Need[a] == key and a > value:
                Usable[key] = a
    else:
        Usable[Need[a]] = a
Num = [-1] * (N + 1)
Num[0] = 0
for i in range(1, N+1):
    for u, v in Usable.items():
        if i < u:
            continue
        if Num[i - u] >= 0:
            if Num[i - u] == 0:
                Num[i] = max(v, Num[i])
            elif Num[i] < Num[i - u] * 10 + v:
                Num[i] = Num[i - u] * 10 + v

print(Num[N])
### BUGGY CODE ###

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

def heihou_hantei(n):
    m = int(n**0.5)
    return m if abs(m*m - n) < 1e-6 else 0

def kouyaku(n,p):
    for i in range(round((p**(1/n)+1)),0,-1):        
        if p%i==0:
            if p%(i**n)==0:
                return i
            
print(kouyaku(n,p))

### FIXED CODE ###

N, P = map(int, input().split())
ans = 1
 
if N >= 45:
  print(ans)
elif N == 1:
  print(P)
  
 
  
else:
  i = 1
  while(i**N <= P):
    if P % (i**N) == 0:
      ans = i
    i += 1
  print(ans)
### BUGGY CODE ###

N = int(input())
s = list(input() for _ in range(N))
d = [0]*N
for i in range(N):
    d[i] = {}
    for j in range(10):
        if s[i][j] in d[i].keys():
            d[i][s[i][j]] += 1
        else:
            d[i][s[i][j]] = 1
ans = 0

for i in range(N):
    for j in range(i+1, N):
        if d[i] == d[j]:
            ans+=1
print(ans)

### FIXED CODE ###

N = int(input())
s = list(input() for _ in range(N))
d = {}
ans = 0
for i in range(N):
    temp = str(sorted(s[i]))
    if temp in d.keys():
        ans += d[temp]
        d[temp] += 1
    else:
        d[temp] = 1
print(ans)
### BUGGY CODE ###

N,M=map(int,input().split())
L,R=map(int,input().split())
A=range(L,R+1)
for i in range(1,M):
  L,R=map(int,input().split())
  A=set(A)&set(range(L,R+1))
print(len(A))

### FIXED CODE ###

N,M=map(int,input().split())
L,R=map(int,input().split())
a,b=L,R
for i in range(1,M):
  L,R=map(int,input().split())
  a=max(a,L)
  b=min(b,R)
if a>b:
  print(0)
else:
  print(b-a+1)
### BUGGY CODE ###

# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

#x,y = [int(i) for i in readline().split()]
MOD = 998244353
n = int(input())
s = input()

R = B = G = 0
ans = 1
for i in s:
    m = sorted([R,G,B])
    if eval(i) == m[-1]:
        ans *= n-m[-1]
        ans %= MOD
    elif eval(i) == m[1]:
        ans *= m[2]-m[1]
        ans %= MOD
    else:
        ans *= m[1]-m[0]
        ans %= MOD
    if i == "R":
        R += 1
    elif i == "G":
        G += 1
    elif i == "B":
        B += 1

print(ans)


### FIXED CODE ###

# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

#x,y = [int(i) for i in readline().split()]
MOD = 998244353
n = int(input())
s = input()

R = B = G = 0
ans = 1
for i in s:
    m = sorted([R,G,B])
    if i == "R":
        c = R
        R += 1
    elif i == "G":
        c = G
        G += 1
    elif i == "B":
        c = B
        B += 1
    if c == m[-1]:
        ans *= n-m[-1]
    elif c == m[1]:
        ans *= m[2]-m[1]
    else:
        ans *= m[1]-m[0]
    
    ans %= MOD

print(ans)
### BUGGY CODE ###

#D in [S_i-X_i,T_i-X_i) → Xiで止まる
import sys
input = sys.stdin.readline
from heapq import heappush,heappop

N,Q = map(int,input().split())
q = []

STX = [[int(x) for x in input().split()] for _ in range(N)]
for s,t,x in STX:
  heappush(q,(s-x,1,x)) # xで死ぬ
  heappush(q,(t-x,0,x)) # xで死ななくなる

for i in range(Q):
  d = int(input())
  heappush(q,(d,2,i))
answer = [-1]*Q

se = set() # 引っかかってる場所
min_se = 10**18
flag = False # min_seが正しい値である

while q:
  a,c,b = heappop(q)
  if not c:
    se.remove(b)
    if b == min_se:
      flag = False
  elif c&1:
    se.add(b)
    if b < min_se:
      min_se = b
      flag = True
  else:
    if se:
      if not flag:
        min_se = min(se)
        flag = True
      answer[b] = min_se

print('\n'.join(map(str,answer)))


### FIXED CODE ###

#D in [S_i-X_i,T_i-X_i) → Xiで止まる
import sys
input = sys.stdin.readline

N,Q = map(int,input().split())
q = []

STX = [[int(x) for x in input().split()] for _ in range(N)]
for s,t,x in STX:
  q.append((s-x,1,x)) # xで死ぬ
  q.append((t-x,0,x)) # xで死ななくなる

for i in range(Q):
  d = int(input())
  q.append((d,2,i))
answer = [-1]*Q

se = set() # 引っかかってる場所

q.sort()

min_se = 10**18
flag = False # min_seが正しい

for a,c,b in q:
  if not c:
    se.remove(b)
    if min_se == b:
      flag = False
  elif c&1:
    se.add(b)
    if b < min_se:
      min_se = b
      flag = True
  else:
    if se:
      if not flag:
        min_se = min(se)
        flag = True
      answer[b] = min_se

print('\n'.join(map(str,answer)))
### BUGGY CODE ###

n,q = [int(i) for i in input().split()]

def find(x):
    if par[x][0] < 0:
        return x
    else:
        px = find(par[x][0])
        par[x][0] = px
        return px

def unite(x,y):      
    x = find(x)
    y = find(y)
    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x][0] > par[y][0]:
            x,y = y,x
        par[x][0] += par[y][0]
        par[y][0] = x
        return True

memo = [True]*n
par = [[-1,0,i] for i in range(n)]
for i in range(n-1):
  a,b = [int(i) for i in input().split()]
  unite(a-1,b-1)
  if memo[a-1] and memo[b-1]:
      par[b-1][1] += 1
  elif memo[b-1] and not memo[a-1]:
    par[b-1][1] += 1+par[a-1][1]
  elif memo[a-1] and not memo[b-1]:
    par[a-1][1] += 1+par[b-1][1]
  memo[a-1] = False
  memo[b-1] = False
  
chk = [0]*n
for i in range(q):
  p,x = [int(i) for i in input().split()]
  chk[p-1] += x

from operator import itemgetter
par = sorted(par,key=itemgetter(1))
par = sorted(par,key=itemgetter(0))
#print(par)
cnt = 0
for i in range(1,n):
  if par[i][0] >= 0 and par[i][1]==1:
    chk[par[i][2]] += chk[par[i][0]]
    cnt = 0
  if par[i][0] >= 0 and par[i][1]>=2:
    if par[i][0] == par[i-1][0] and par[i][1] > par[i-1][1]:
      chk[par[i][2]] += chk[par[i-1][2]]
      cnt = 0
    if par[i][0] == par[i-1][0] and par[i][1] == par[i-1][1]:
      cnt += 1
      chk[par[i][2]] += chk[par[i-1-cnt][2]]
      
chk = list(map(str,chk))
print(' '.join(chk))

### FIXED CODE ###

import sys
input = sys.stdin.readline
import sys
sys.setrecursionlimit(1000000)

n, q = map(int, input().split())
g = [[] * n for i in range(n)]

par = [-1]*n
for i in range(n-1):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)

chk = [0]*n
for i in range(q):
    x, y = map(int, input().split())
    chk[x-1] += y

def dfs(now, prev):
    # リストはglobal宣言の必要がない？
    # 今いる頂点から行ける頂点を順に next に入れてループ
    for next in g[now]:
        if next != prev:
            chk[next] += chk[now]
            dfs(next, now)

dfs(0,-1)
print(*chk)
### BUGGY CODE ###

import sys
import heapq

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

def removeWalls(wallPointH,wallPointW):
  if maze[wallPointH][wallPointW]=="#":
    maze[wallPointH][wallPointW]="."
    if wallPointH+1 <= H-1:
      removeWalls(wallPointH+1,wallPointW)
    if wallPointW+1 <= W-1:
      removeWalls(wallPointH,wallPointW+1)

que = [[0,0,0]]
heapq.heapify(que)
count = 0
      
while que:
  qu = heapq.heappop(que)
  #print(que)
  if qu[0]==1:
    heapq.heappush(que, qu)
    count += 1
    for q in que:#いったん"#"の撤去作業を行う
      q[0]=0
      removeWalls(q[1],q[2])
  else:#queの中身にまだTrueがあるなら
    now = qu
    nowH = now[1]
    nowW = now[2]
    if maze[nowH][nowW]=="#":#行き止まりの場合
      heapq.heappush(que, [1,nowH,nowW])
      continue
    elif nowH==H-1 and nowW==W-1:#ゴールの場合
      print(count)
      sys.exit()
    else:#それ以外の場合
      #右近傍と下近傍、それぞれマップの中ならqueに格納。
      if nowH+1 <= H-1:
        heapq.heappush(que, [0,nowH+1,nowW])
      if nowW+1 <= W-1:
        heapq.heappush(que, [0,nowH,nowW+1])
        



### FIXED CODE ###

import sys
import heapq

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

def removeWalls(wallPointH,wallPointW):
  if maze[wallPointH][wallPointW]=="#":
    changeTo = "."
  elif maze[wallPointH][wallPointW]=="1":
    changeTo = "0"
  if maze[wallPointH][wallPointW]=="#" or maze[wallPointH][wallPointW]=="1":
    maze[wallPointH][wallPointW]=changeTo
    if wallPointH+1 <= H-1:
      removeWalls(wallPointH+1,wallPointW)
    if wallPointW+1 <= W-1:
      removeWalls(wallPointH,wallPointW+1)

if maze[0][0]=="#":
  flag=1
else:
  flag=0
      
que = [[flag,0,0]]
heapq.heapify(que)
count = 0
      
while que:
  qu = heapq.heappop(que)
  if qu[0]==1:
    heapq.heappush(que, qu)
    count += 1
    for q in que:#いったん"#"の撤去作業を行う
      q[0]=0
      removeWalls(q[1],q[2])
  else:#queの中身にまだ進める場所があるなら
    nowH = qu[1]
    nowW = qu[2]
    if nowH==H-1 and nowW==W-1:#ゴールの場合
      print(count)
      sys.exit()
    else:#それ以外の場合
      #右近傍と下近傍、それぞれマップの中ならqueに格納。
      if nowH+1 <= H-1:
        if maze[nowH+1][nowW]=="#":
          maze[nowH+1][nowW]="1"
          heapq.heappush(que, [1,nowH+1,nowW])
        elif maze[nowH+1][nowW]==".":
          maze[nowH+1][nowW]="0"
          heapq.heappush(que, [0,nowH+1,nowW])
      if nowW+1 <= W-1:
        if maze[nowH][nowW+1]=="#":
          maze[nowH][nowW+1]="1"
          heapq.heappush(que, [1,nowH,nowW+1])
        elif maze[nowH][nowW+1]==".":
          maze[nowH][nowW+1]="0"
          heapq.heappush(que, [0,nowH,nowW+1])
### BUGGY CODE ###

N, M= map(int, input().split())
B=[]
for i in range(N):
    B.append([None]*2)
    l=input().split()
    B[i][0]=int(l[1])
    B[i][1]=int(l[0])
B.sort(reverse=True)
h=[False]*(M+1)
a=0
d=M+1
for i in range(N):
    if d>B[i][1]:
      for j in range(B[i][1],d):
        if h[j]==False:
            h[j]=True
            a+=B[i][0]
            break
      else:
        d=B[i][1]
print(a)

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
N,M=map(int,input().split())
l=[[] for i in range(10**5)]
for i in range(N):
    a,b=map(int,input().split())
    l[a-1].append(b)
h=[]
import heapq
a=0
for i in range(M):
    for j in l[i]:
        heapq.heappush(h,-j)
    if h:
        a-=heapq.heappop(h)
print(a)
### BUGGY CODE ###

#!/mnt/c/Users/moiki/bash/env/bin/python
N,K = list(map(int, input().split()))
h = list(map(int, input().split()))

suml = [1e9 for i in range(N)]
suml[0] = 0
# print(suml)

for e in range(1,N):
    # print("min: ", min([e, K+1]))
    # print("range: ", 1, min(e,K+1))

    for k in range(1, min([e, K])+1):
        # print("\tk: ", k)
        # print("\te-k:", e-k)
        # print("\te: ", e)
        suml[e] = min(suml[e],
                abs(h[e]-h[e-k]) + suml[e-k]
        )
        # print("suml[e] : ", 
        #         abs(h[e]-h[e-k]) + suml[e-k] ) 

print(suml[N-1])
        



### FIXED CODE ###

#!/mnt/c/Users/moiki/bash/env/bin/python
# N,K = list(map(int, input().split()))
# h = list(map(int, input().split()))

# (N,K), h = map(int, input().split()), list(map(int, input().split()))
N,K,*h = map(int, "\n".join([input(), input()]).split())

# suml = [1e9 for i in range(N)]
# suml[0] = 0


suml = [0]*N

# for i in range(1,N):
for i,e_h in enumerate(h):
    if i == 0:
        continue

    start = max(0, i-K)
    cost  = min(cst + abs( e_h - hgh) for cst, hgh in 
                   zip(suml[start:i], h[start:i]))
    # cost  = min(cst + abs( h[i] - hgh ) for cst, hgh in 
    #               zip(suml[start:i], h[start:i]))
    suml[i] = cost

print(suml[-1])
### BUGGY CODE ###

import sys
n ,k = map(int, input().split())


if n == k or k == 1:
    print(0)
    sys.exit()
    
def min_N(n, k):
    a = n
    while True:
        b = abs(a-k)
        if a < b:
            break
        elif b == 1:
            print(1)
            sys.exit()
        a = b
    print(a)
    sys.exit()
    
min_N(n, k)

### FIXED CODE ###

import sys
n ,k = map(int, input().split())
if n == k or k == 1:
    print(0)
    sys.exit()
else:
    n %= k
print(min(n, abs(n-k)))
### BUGGY CODE ###

K=int(input())
num=7
i=1
d=[]
while 1:
  num=num%K
  if num==0:
    print(i)
    break
  if num in d:
    print(-1)
    break
  d.append(num)
  num = 10*num + 7
  i+=1


### FIXED CODE ###

K=int(input())
num=7

#10と互いに素ではない数は必ずあまりが出る
if K%2==0 or K%5==0:
  print(-1)
  exit()

i=1
while 1:
  num=num%K
  if num==0:
    print(i)
    break
  num = 10*num + 7
  i+=1
### BUGGY CODE ###

from itertools import accumulate

N,P = map(int,input().split())
i = 2
res = []
while P>=i**N:
  if P % i ** N == 0:
    P /= i**N
    res.append(i)
    i += 1
  
res = list(accumulate(res))
if res == []:
  res.append(1)
print(res[-1])

### FIXED CODE ###

N,P = map(int,input().split())
i = round(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,0,-1):
    if P%i**N==0:
      print(i)
      break
### BUGGY CODE ###

s = list(input())
K = int(input())

res = []
for n in range(1,len(s) + 1):
    charGram = [''.join(s[i:i + n]) for i in range(len(s) + 1 - n)]
    res += charGram

res = sorted(set(res))
print(res[K - 1])


### FIXED CODE ###

s = list(input())
K = int(input())

res = []
charGram = [[''.join(s[i:i + n]) for i in range(len(s) + 1 - n)] for n in range(1,K + 1)]

for i in range(len(charGram)):
    res += charGram[i]

res = sorted(set(res))
print(res[K - 1])
### BUGGY CODE ###

import bisect
N = int(input())
*A, = map(int, input().split())
A.sort()
a = []
b = []
last = 0
for i in range(N):
    if last != A[i]:
        a.append([A[i], 0])
        b.append(A[i])
        last = A[i]
    a[-1][1] += 1


def factorList(n):
    # [素因数]=数を出力
    f = {}
    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:
            f[i] = c
            c = 0
    if n != 1:
        f[n] = 1
    return f


def cmb(a, i, h, t):
    if i >= len(a):
        return h[t]
    for j in range(a[i][1]+1):
        d = cmb(a, i+1, h, t*pow(a[i][0], j))
        if d:
            return True
    return False


h = [False]*(10**6+1)
ans = 0
for n, c in a:
    if c == 1:
        fl = [[k, v] for k, v in factorList(n).items()]
        if not cmb(fl, 0, h, 1):
            ans += 1
    h[n] = True

print(ans)


### FIXED CODE ###

from collections import Counter
N = int(input())
*A, = map(int, input().split())
A.sort()
c = Counter(A)
ans = 0
d = [0]*(10**6+1)
for i in range(N):
    if d[A[i]] == 0:
        if c[A[i]] == 1:
            ans += 1
        j = A[i]
        while j <= (10**6):
            d[j] += 1
            j += A[i]
print(ans)
### BUGGY CODE ###

n =int(input())
ss = []
ans = []
for i in range(n):
    s = input()
    if s in ss:
        ans[ss.index(s)] += 1
    else:
        ss.append(s)
        ans.append(1)
    
m = max(ans)
for i in range(len(ans)):
    if ans[i] != m:
        ss[i] = ""
ss = sorted([i for i in ss if i != ""])
for i in ss:
    print(i)


### FIXED CODE ###

import collections
n =int(input())
ss = []
ans = []
for i in range(n):
    ss.append(input())
a = collections.Counter(ss)

m = max(a.values())

for i,s in a.items():

    if s == m:
        ans.append(i)
ans = sorted(ans)

for i in ans:
    print(i)
### BUGGY CODE ###

import numpy as np

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

def expect(x):
    prob = 1 / float(x)
    return sum(np.arange(1, x+1)) * prob

p_mapped = [expect(i) for i in p]

max = 0
for i in range(len(p_mapped)-K+1):
    answer = np.sum(p_mapped[i:i+K])
    if answer >= max:
        max = answer
print(max)

### FIXED CODE ###

import numpy as np

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

p_mapped = [(i + 1) / 2 for i in p]
p_m_cumsum = np.cumsum(p_mapped)

max = 0
for i in range(len(p_m_cumsum)-K+1):
    if i != 0:
        answer = p_m_cumsum[i+K-1] - p_m_cumsum[i-1]
    else:
        answer = p_m_cumsum[i+K-1]
    if answer >= max:
        max = answer
print(max)
### BUGGY CODE ###

import sys
H,W,m = map(int,input().split())
h_ls = [0] * H
w_ls = [0] * W
bombers = [[0,0] for _ in range(m)]
for i in range(m):
    h,w = map(int,input().split())
    h_ls[h-1] += 1
    w_ls[w-1] += 1
    bombers[i] = [h-1,w-1]
h_max = 0
h_max_args = []
for i in range(H):
    if h_max == h_ls[i]:
        h_max_args.append(i)
    elif h_max < h_ls[i]:
        h_max = h_ls[i]
        h_max_args = [i]

w_max = 0
w_max_args = []
for i in range(W):
    if w_max == w_ls[i]:
        w_max_args.append(i)
    elif w_max < w_ls[i]:
        w_max = w_ls[i]
        w_max_args = [i]

for h in h_max_args:
    for w in w_max_args:
        if not [h,w] in bombers:
            print(w_max+h_max)
            sys.exit()

print(w_max+h_max-1)

### FIXED CODE ###

import sys
from collections import Counter
H,W,m = map(int,input().split())
h_ls = [0] * H
w_ls = [0] * W
bombers = [(0,0) for _ in range(m)]
for i in range(m):
    h,w = map(int,input().split())
    h_ls[h-1] += 1
    w_ls[w-1] += 1
    bombers[i] = (h-1,w-1)

h_max = max(h_ls)
h_counter = Counter(h_ls)
# Couter使ってみる
h_max_args = [0]*h_counter[h_max]
next_ind = 0
for i in range(H):
    if h_ls[i] == h_max:
        h_max_args[next_ind] = i
        next_ind += 1

w_max = max(w_ls)
w_counter = Counter(w_ls)
w_max_args = [0]*w_counter[w_max]
next_ind = 0
for i in range(W):
    if w_ls[i] == w_max:
        w_max_args[next_ind] = i
        next_ind += 1

bombers = set(bombers)
for h in h_max_args:
    for w in w_max_args:
        if not (h,w) in bombers:
            print(w_max+h_max)
            sys.exit()

print(w_max+h_max-1)
### BUGGY CODE ###

h,w=map(int,input().split())
a=[list(map(int,input().split()))for i in range(h)]
b=[list(map(int,input().split()))for i in range(h)]
c=[[abs(a[i][j]-b[i][j])for j in range(w)]for i in range(h)]
d=[[set()for i in range(w+1)]for j in range(h+1)]
d[1][1]=set([c[0][0]])
for x in range(1,h+1):
    for y in range(1,w+1):
        if not (x==1 and y==1):
            a=d[x-1][y]|d[x][y-1]
            for i in a:
                d[x][y].add(abs(i-c[x-1][y-1]))
                d[x][y].add(i+c[x-1][y-1])
print(min(d[h][w]))

### FIXED CODE ###

h,w=map(int,input().split())
a=[list(map(int,input().split()))for i in range(h)]
b=[list(map(int,input().split()))for i in range(h)]
s=[0]*w
s[0]=p=1<<6400
for i in range(h):
    for j in range(w):
        d=abs(a[i][j]-b[i][j])
        if j>0:
            s[j]|=s[j-1]
        s[j]=(s[j]<<d)|(s[j]>>d)
t=s[-1]
for i in range(6401):
    if t&(p<<i) or t&(p>>i):
        print(i)
        break
### BUGGY CODE ###

[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = ""
for i in range(N-L+1) : ans += str(min(A[i:i+L])) + " "
print(ans[:-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

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

cnt = 0
for i in range(n):
    s = 0
    x = 0
    for j in range(i, n):
        s += A[j]
        x ^= A[j]
        if s == x:
            cnt += 1
        else:
            break
print(cnt)


### FIXED CODE ###

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

cnt, su, r = 0, 0, 0
for l in range(n):
    while r < n and su + a[r] == su ^ a[r]:
        su += a[r]
        r += 1
    cnt += r - l
    if l == r:
        r += 1
    else:
        su -= a[l]
print(cnt)
### BUGGY CODE ###

import math
X=int(input())
def make_divisors(n):
    divisors=[]
    for i in range(1,int(n**0.5)+1):
        if n%1==0:
            divisors.append(i)
            if i!=n//i:
                divisors.append(n//i)
    return divisors

M=make_divisors(X)

p=math.sqrt(X)
p=int(p)
for i in M:
    for k in range(p+1):
        A=k
        B=A-i
        if A**5-B**5==X:
            print(A,B)
            break

### FIXED CODE ###

import sys
X=int(input())
for A in range(-120,120):
    for B in range(-120,120):
        if A**5-B**5==X:
            print(A,B)
            sys.exit()