Harryxun/stf_run huggingface dataset:
import math

class SegmentTree():
    def __init__(self, n):
        self.n = n
        self.height = math.ceil(math.log2(n))
        self.nodes = [0 for i in range(pow(2, self.height+1)-1)]
        self.leaf_start = pow(2, self.height)-1

    def update(self, i, x):
        pntr = self.leaf_start + i
        self.nodes[pntr] += x
        while True:
            pntr = (pntr-1)//2
            if pntr == -1: break
            self.nodes[pntr] += x

    def __query(self, s, t, k, l, r):
        if t - s <= 0: return 0
        if r <= s or t <= l: return 0
        if l == s and t == r: return self.nodes[k]
        else:
            m = (l+r)//2
            if t <= m:
                return self.__query(s, t, k*2+1, l, m)
            elif m <= s:
                return self.__query(s, t, k*2+2, m, r)
            else:
                vl = self.__query(s, m, k*2+1, l, m)
                vr = self.__query(m, t, k*2+2, m, r)
                return vl + vr

    def find(self, s, t):
        return self.__query(s, t+1, 0, 0, pow(2, self.height))

n, q = list(map(int, input().split(' ')))
st = SegmentTree(n)
for i in range(q):
    com, x, y = list(map(int, input().split(' ')))
    if com == 0:
        st.update(x, y)
    elif com == 1:
        print(st.find(x, y))




### FIXED CODE ###

import math

class SegmentTree():
    def __init__(self, n):
        self.n = n
        self.height = math.ceil(math.log2(n))
        self.nodes = [0 for i in range(pow(2, self.height+1)-1)]
        self.leaf_start = pow(2, self.height)-1

    def update(self, i, x):
        pntr = self.leaf_start + i
        self.nodes[pntr] += x
        while True:
            pntr = (pntr-1)//2
            if pntr == -1: break
            self.nodes[pntr] += x

    def __query(self, s, t, k, l, r):
        if t - s <= 0: return 0
        if r <= s or t <= l: return 0
        if l == s and t == r: return self.nodes[k]
        else:
            m = (l+r)//2
            if t <= m:
                return self.__query(s, t, k*2+1, l, m)
            elif m <= s:
                return self.__query(s, t, k*2+2, m, r)
            else:
                vl = self.__query(s, m, k*2+1, l, m)
                vr = self.__query(m, t, k*2+2, m, r)
                return vl + vr

    def find(self, s, t):
        return self.__query(s, t+1, 0, 0, pow(2, self.height))

n, q = list(map(int, input().split(' ')))
st = SegmentTree(n)
for i in range(q):
    com, x, y = list(map(int, input().split(' ')))
    if com == 0:
        st.update(x-1, y)
    elif com == 1:
        print(st.find(x-1, y-1))
N=int(input())
List=list(map(int,input().split()))
List.sort(reverse=True)
ans=0
for i in range(N-1):
  k = List[i]/(2**(i+1))
  ans += k
l = List[N]/(2**(N-1))
ans += l
print(ans)
          
  

### FIXED CODE ###

N = int(input())
v = list(map(int, input().split()))
v.sort()
v.reverse()
result = 0

for i, x in enumerate(v):
    if i == N - 1:
        i = N - 2
    result += x / pow(2, i + 1)

print(result)
s=str(input())
n=len(s)-1
#print(s,n)
#print(xy)
bit=[]#1が正直0が嘘
ans=0
def bit_search(bit):
    global ans
    count=[]
    c=0
    if len(bit)==n:#2**n文の組み合わせを調べる加圧10を交互に入れるためのif
        for i in range(n):
            if bit[i]==1:
                count.append(int(s[c:i]))
                c=i
        count.append(int(s[c:n]))
        ans+=sum(count)
    else:
       #再起化することによって最初にbitの配列を作る必要性をなくした
        bit_search(bit+[0])
        bit_search(bit+[1])
bit_search(bit)
print(ans)

### FIXED CODE ###

s=str(input())
n=len(s)-1#間間なので-1
#print(s,n)
#print(xy)
bit=[]#1が＋入れる0がいれない
ans=0
c=0
count=[]
def bit_search(bit):
    #print("DFGHNM")
    count=[]#分けたやつを補完するやつ
    global ans
    c=0
    if len(bit)==n:#2**n文の組み合わせを調べる加圧10を交互に入れるためのif
        for i in range(n):
            if bit[i]==1:
                #print(int(s[c:i+1]))
                count.append(int(s[c:i+1]))
                c=i+1#ここの＋１大事
        #print(int(s[c:n+1]))
        count.append(int(s[c:n+1]))
        ans+=sum(count)
        #print(ans,sum(count),bit,c)
        return 
    else:
       #再起化することによって最初にbitの配列を作る必要性をなくした
        #print(bit)
        bit_search(bit+[0])
        bit_search(bit+[1])

bit_search(bit)
print(ans)
import numpy as np
n, k = list(map(int, input().rstrip().split()))
p = list(map(int, input().rstrip().splist()))
p = np.sort(np.array(p))

print(np.sum(p[:k]))

### FIXED CODE ###

import numpy as np
n, k = list(map(int, input().rstrip().split()))
p = list(map(int, input().rstrip().split()))
p = np.sort(np.array(p))
 
print(np.sum(p[:k]))
def main():
    n = int(input())
    A = list(map(int, input().split()))

    filled = [0]*(n+1)
    ans = []
    for i in range(n-1, -1, -1):
        if sum(filled[::i+1][1:]) % 2 != A[i]:
            filled[i+1] = 1
            ans.append(i+1)
    print(len(ans))
    print(' '.join(map(str, ans)))


if __name__ == '__main__':
    main()

### FIXED CODE ###

import math

def main():
    N, D = map(int, input().split())
    points = []
    for i in range(N):
        p = [int(c) for c in input().split()]
        points.append(p)

    count = 0
    for i in range(N-1):
        for j in range(i+1, N):
            v = 0
            for k in range(D):
                v += pow(points[i][k]-points[j][k], 2)
            vsqrt = math.sqrt(v)
            if int(vsqrt) == vsqrt:
                count += 1
    return count

if __name__ == '__main__':
    print(main())
n = int(input())
a = map(int, input().split())
b = sum(map(int, input().split()))
c = map(int, input().split())
s = 0
for i in range(n-1):
  if a[i+1] - a[i] == 1:
    s += c[a[i] - 1]
print(b + s)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = sum(map(int, input().split()))
c = list(map(int, input().split()))
s = 0
for i in range(n-1):
  if a[i+1] - a[i] == 1:
    s += c[a[i] - 1]
print(b + s)
s = range(1,14)
h = range(1,14)
c = range(1,14)
d = range(1,14)

n = int(input())
while n > 0:
    x = input().split(' ')
    if x[0] == 'S':
        s[x[1]-1] = 0
    elif x[0] == 'H':
        h[x[1]-1] = 0
    elif x[0] == 'C':
        c[x[1]-1] = 0
    elif x[0] == 'D':
        d[x[1]-1] = 0
    n -= 1

for t in s:
    if t != 0: print("S %d" % t)
for t in h:
    if t != 0: print("H %d" % t)
for t in c:
    if t != 0: print("C %d" % t)
for t in d:
    if t != 0: print("D %d" % t)

### FIXED CODE ###

s = list(range(1,14))
h = list(range(1,14))
c = list(range(1,14))
d = list(range(1,14))

n = int(input())
while n > 0:
    x = input().split(' ')
    x[1] = int(x[1])
    if x[0] == 'S':
        s[x[1]-1] = 0
    elif x[0] == 'H':
        h[x[1]-1] = 0
    elif x[0] == 'C':
        c[x[1]-1] = 0
    elif x[0] == 'D':
        d[x[1]-1] = 0
    n -= 1

for t in s:
    if t != 0: print("S %d" % t)
for t in h:
    if t != 0: print("H %d" % t)
for t in c:
    if t != 0: print("C %d" % t)
for t in d:
    if t != 0: print("D %d" % t)
N, M, K = map(int, input().split())
times_a = list(map(int, input().split()))
times_b = list(map(int, input().split()))
read_time = 0
read_time_a = [0]
read_time_b = [0]
for i in range(len(times_a)):
    read_time_a.append(read_time_a[i]+times_a[i])
for i in range(len(times_b)):
    read_time_b.append(read_time_b[i]+times_b[i])
count = 0
for i in range(N+1):
    t = read_time_a[i]
    l = 0
    r = len(read_time_b)
    while l + 1 < r:
        c = (l + r) // 2
        if t + read_time_b[c] <= K:
            l = c
        else:
            r = c
    if read_time_a[i] + read_time_b[l] <= K:
        ans = max(ans, i + l)
print(ans)


### FIXED CODE ###

N, M, K = map(int, input().split())
times_a = list(map(int, input().split()))
times_b = list(map(int, input().split()))
read_time = 0
read_time_a = [0]
read_time_b = [0]
for i in range(N):
    read_time_a.append(read_time_a[i]+times_a[i])
for i in range(M):
    read_time_b.append(read_time_b[i]+times_b[i])

ans = 0
for i in range(N+1):
    t = read_time_a[i]
    l = 0
    r = len(read_time_b)
    while l + 1 < r:
        c = (l + r) // 2
        if t + read_time_b[c] <= K:
            l = c
        else:
            r = c
    if read_time_a[i] + read_time_b[l] <= K:
        ans = max(ans, i + l)
print(ans)
n,m=map(int,input().split())
r={}
for _ in range(m):
  a,b=map(int,input().split())
  a,b=a-1,b-1
  if a not in r: r[a]=[]
  r[a].append(b)
  if b not in r: r[b]=[]
  r[b].append(a)

ans = {0:0}
steps = [-1]*n
steps[0]=0
def setroot(i,step):
  newroom = [v for v in r[i] if steps[v]<0 or steps[v]>step]
  #print(i,newroom)
  if len(newroom)>0:
    for v in newroom:ans[v]=i;steps[v]=step
    for v in newroom:setroot(v,step+1)
setroot(0,0)
#print(r)
#print(steps)
if len(ans) == n:
  print('Yes')
  for i in range(1,n):
    if i in ans:
      print(ans[i]+1)
else:
  print('No')

### FIXED CODE ###

f=lambda:map(int,input().split())
n,m=f()
g=[[] for _ in range(n)]
for _ in range(m):
  a,b=f()
  g[a-1]+=[b-1]
  g[b-1]+=[a-1]
p=[0]*n
from collections import*
q=deque([0])
while q:
  v=q.popleft()
  for c in g[v]:
    if p[c]<1: p[c]=v+1; q.append(c)
if 0 in p: print('No')
else: print('Yes',*p[1:],sep='\n')
n = int(input())


def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))


### FIXED CODE ###

n = int(input())


def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))
A, B = map(int, input().split())

    price = (int)(
        B   if A >= 13 else
        B/2 if A >= 6 else
        0)

    print(price) 

### FIXED CODE ###

A, B = map(int, input().split())

price = (int)(
    B   if A >= 13 else
    B/2 if A >= 6 else
    0)

print(price)
n = int(input())
ans = pow(10,n,mod)
ans -= pow(9,n,mod)*2
ans += pow(8,n,mod)
print(ans%mod)


### FIXED CODE ###

import numpy as np

n = int(input())
MOD = 1000000007
ans = 10**n - 9**n -9**n + 8**n
ans = ans % MOD
print(ans)
(lambda x, y: print(max(a+b, a-b, a*b)))(map(int,input().split()))

### FIXED CODE ###

(lambda x, y: print(max(x+y, x-y, x*y)))(*map(int,input().split()))
z

### FIXED CODE ###

x = int(input())

m = 1

for i in range(1, 32):
    for j in range(2, 10):
        p = pow(i, j)
        if p > x:
            break
        if p > m:
            m = p

print(m)
print(int(input()) + int(input())//2)


### FIXED CODE ###

x, y = map(int, input().split())
print(x + y//2)
N=int(input())
T=list(map(int, input().split()))
M=int(input())
for i in range(M):
  P,X=map(int, input().split())
  print(sum(T)-(T[P]-X))

### FIXED CODE ###

N=int(input())
T=list(map(int, input().split()))
M=int(input())
for i in range(M):
  P,X=map(int, input().split())
  print(sum(T)-T[P-1]+X)
a = input()
if a[1] == '7' or a[2] == '7' or a[3] == '7' :
  print("Yes")
else :
  print("No")

### FIXED CODE ###

a = input()
if a[0] == '7' or a[1] == '7' or a[2] == '7' :
  print("Yes")
else :
  print("No")
def solve(x):
    if(x==0):
        return 0
    k=1
    s=0
    while True:
        if(x%k==0):
            i=(x//k)-1
            if (x//i==x%i):
                s+=i
        k+=1
        if k*k>x:
            break
    return s
        

x=int(input())
print(solve(x))


### FIXED CODE ###

def solve(x):
    if(x<2):
        return 0
    k=1
    s=0
    while True:
        if(x%k==0):
            i=(x//k)-1
            if (x//i==x%i):
                s+=i
        k+=1
        if k*k>x:
            break
    return s
        

x=int(input())
print(solve(x))
n=int(input())
t,a=[int(i) for i in input().split()]
h=[t-int(i)*0.006 for i in input().split()]
ans=0
for i in range(n):
  if abs(A-h[i])<abs(A-h[ans]):
    ans=i
print(ans+1)

### FIXED CODE ###

n=int(input())
t,a=[int(i) for i in input().split()]
h=[t-int(i)*0.006 for i in input().split()]
ans=0
for i in range(n):
  if abs(a-h[i])<abs(a-h[ans]):
    ans=i
print(ans+1)
from scipy.special import comb
N,P=map(int,input().split())
A=list(map(int,input().split()))
A=[i%2 for i in A]
A0,A1=A.count(0),A.count(1)
if P==1:
    if not A1:
        print(0)
        exit()
value0=0
for i in range(0,A0+1):
    value0+=comb(A0, i, exact=True)
value1=0
for i in range(2-P,A1+1,2):
    value1+=comb(A1, i, exact=True)
print(value0*value1+(1 if not P else 0))


### FIXED CODE ###

from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N,P=map(int,input().split())
A=list(map(lambda x:int(x)%2,input().split()))
A0,A1=A.count(0),A.count(1)
if P==1:
    if not A1:
        print(0)
        exit()
value0=0
for i in range(0,A0+1):
    value0+=comb(A0, i)
value1=(1 if not P else 0)
for i in range(2-P,A1+1,2):
    value1+=comb(A1, i)
print(value0*value1)
N=int(input())
W=list(map(int,input().split()))

res=0
s=sum(W)
ans=100000000000
for i in range(N):
  res+=W[i]
  ans=min(abs(s-res*2))
print(ans)
          

### FIXED CODE ###

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

res=0
s=sum(W)
ans=100000000000
for i in range(N):
  res+=W[i]
  ans=min(ans,abs(s-res*2))
print(ans)
S = input()
T = input()
N = len(S)
M = len(T)

dp = [[0]*(M+1) for i in range(N+1)]

for i in range(N):
    for j in range(M):
        if S[i] == T[j]:
            dp[i+1][j+1] = dp[i][j] + 1
        else:
            dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])

ans = ''
def rec(i,j):
    print(i,j)
    if i==0 or j==0: return
    if S[i-1] == T[j-1]:
        global ans
        ans += S[i-1]
        rec(i-1,j-1)
    elif dp[i-1][j] >= dp[i][j-1]:
        rec(i-1,j)
    else:
        rec(i,j-1)

rec(N,M)
print(ans[::-1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)

S = input()
T = input()
N = len(S)
M = len(T)

dp = [[0]*(M+1) for i in range(N+1)]

for i in range(N):
    for j in range(M):
        if S[i] == T[j]:
            dp[i+1][j+1] = dp[i][j] + 1
        else:
            dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])

ans = ''
def rec(i,j):
    if i==0 or j==0: return
    if S[i-1] == T[j-1]:
        global ans
        ans += S[i-1]
        rec(i-1,j-1)
    elif dp[i-1][j] >= dp[i][j-1]:
        rec(i-1,j)
    else:
        rec(i,j-1)

rec(N,M)
print(ans[::-1])
s = input()
n = len(s)
k = int(input())
substr = []
for j in range(1, k+1):
    for i in range(n-j):
        sub = s[i:i+j]
        if sub not in substr:
            substr.append(sub)
substr.sort()
print(substr[k-1])


### FIXED CODE ###


s = input()
n = len(s)
k = int(input())
substr = []
for j in range(k):
    for i in range(n-j):
        sub = s[i:i+j+1]
        if sub not in substr:
            substr.append(sub)
substr.sort()
print(substr[k-1])
a,b = map(int,input())

print(a-b+1)

### FIXED CODE ###

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

print(a-b+1)
S = int(input())

a = S//3600 #h
b = S%3600//60 #m
c = (S%3600)//60

print(":".join[(a),(b),(c)])

### FIXED CODE ###

S = int(input())

a = S//3600 #h
b = (S%3600)//60 #m
c = (S%3600)%60 # s

print('{0}:{1}:{2}'.format(a,b,c))
N = int(input())
A = list(map(int,input().split()))
ans = 0
l = [0]*(2*10**5+10)
for i in range(1,len(A)):
  x = i-A[i]
  if x<0:
    continue
  else:
    l[x]+=1

ans+=l[A[0]]
for i in range(1,N):
  x = i+A[i]
  if x<0:
    continue
  if x>2*10**5:
    continue
  
  l[i-A[i]]-=1
  ans+=l[x]
  
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
dic = {}
for i in range(1,N):
  x = i-A[i]
  if x<0:
    continue
  else:
    if x in dic:
      dic[x]+=1
    else:
      dic[x]=1
if A[0] in dic:
  ans+=dic[A[0]]
for i in range(1,N):
  x = i+A[i]
  
  if i-A[i] in dic:
    dic[i-A[i]]-=1
    
  if x in dic:
    ans+=dic[x]
  
print(ans)
k,a,b = map(int,input().split())
n=1
e=0
for i in range(k):
    if (k-i)%2==0:
        
        if e=1:
            n=n+b
            continue
        if n>=a:
            e=1
            n=n-a
            continue
    else
        n=n+1
        continue
print(n)
    


### FIXED CODE ###

k, a, b = map(int, input().split())
x=k+1
y=0
if b>a:
    c=b-a
    k-=a-1
    y=c*(k//2-1)+b+(k%2)
print(max(x,y))
import sys
input = sys.stfin.readline
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a)
for a in a:print(b[(a<b[-1])-2])


### FIXED CODE ###

print(3*int(input())**2)
n = int(input())
nn = int(pow(n,1/5)) + 1
p = sorted(range(nn),reverse = True)
for i in p:
    b = pow(n - i, 1/5)
    if float.is_integer(b):
        break

print(i,int(-b))

### FIXED CODE ###

n = str(input())

if n == "ABC":
    print("ARC")
else:
    print("ABC")
import math
import collections
import sys

h, w, m = map(int, input().split())
x = []
y = []
bomb = []
for i in range(m):
  tmp_x, tmp_y = map(int, input().split())
  x.append(tmp_x)
  y.append(tmp_y)
  bomb.append([tmp_x, tmp_y])

c_x = collections.Counter(x)
c_y = collections.Counter(y)
_max_x = c_x.most_common()[0][1]
_max_y = c_y.most_common()[0][1]
ys = c_y.most_common()
count = _max_x + _max_y - 1
      
tansaku_x = []
tansaku_y = []
for x, x_num in c_x.most_common():
  if x_num != _max_x:
    break
  tansaku_x.append(x)
for y, y_num in c_y.most_common():
  if y_num != _max_y:
    break
  tansaku_y.append(y)

for x in tansaku_x:
  for y in tansaku_y:
    if [x, y] not in bomb:
      print(count+1)
      sys.exit()
      
print(_max_bomb)

### FIXED CODE ###

h,w,n=map(int,input().split())
H=[0]*h
W=[0]*w
L=[(0,0)]*n
for i in range(n):
    a,b=map(int,input().split())
    L[i]=(a,b)
    H[a-1]+=1
    W[b-1]+=1
h_max=max(H)
w_max=max(W)
ans=h_max+w_max
cnt=0
for l in L:
    if H[l[0]-1]==h_max and W[l[1]-1]==w_max:
        cnt+=1
if H.count(h_max)*W.count(w_max)==cnt:
    ans-=1
print(ans)
p,g,r=map(int,input().split())
print(min(p+q,q+r,r+p))

### FIXED CODE ###

a,b,c=map(int,input().split())
print(min(a+b,a+c,b+c))
n=int(input())
a=[list(input()) for i in range(n)]
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        p=[col for col  in a[i] if col not in a[j]]
        if len(lst)==0:
            count+=1
print(count)

### FIXED CODE ###

import math
import collections

n=int(input())
a=[list(input()) for i in range(n)]
b=[str(sorted(list(i))) for i in a]
count=list(collections.Counter(b).values())
count=[i for i in count if i>1]
print(int(sum([math.factorial(x)/(math.factorial(x-2)*2) for x in count])))
import sys

def Forbidden_List(x,n,p):
  k = [abs(s - x) for s in p]
  for i in range(n):
    if i not in k: 
      return 10 - i
  return 10 - n

if __name__ == '__main__':
    input = sys.stdin.readline
    
    inp1 = input().rstrip().split()
    x,n = int(inp1[0]),int(inp1[1])
    if n == 0:
        print(x)
    else: 
     	inp2 = input().rstrip().split()
       	p = list(map(int,inp2))

        print(Forbidden_List(x,n,p))

### FIXED CODE ###

import sys

def Forbidden_List(x,n,p):
  for i in range(n):
    if x - i not in p: 
        return x - i
    if x + i not in p:
        return x + i
  return x - n

if __name__ == '__main__':
    input = sys.stdin.readline
    
    inp1 = input().rstrip().split()
    x,n = int(inp1[0]),int(inp1[1])
    if n == 0:
        print(x)
    else: 
        inp2 = input().rstrip().split()
        p = list(map(int,inp2))
        print(Forbidden_List(x,n,p))
from math import gcd

N = int(input())
A = list(map(int, input().split()))
MAX = 10**6


def prime_factor_sieve(n):
    """
    エラトステネスの篩で、
    2 ~ Nの各数に対して、その整数のもつ最小の素因数
    (その整数を篩落とした最小の素因数)を記録して返す
    O(nloglog(n))
    """
    res = [i for i in range(n+1)]
    for i in range(2, int(n**0.5)+1):
        if res[i] < i:
            continue
        for j in range(i*i, n+1, i):
            if res[j] == j:
                res[j] = i
    return res

def factorization(n, min_factor):
    """
    エラトステネスの篩で手に入れた、各整数の最小素因数のリスト
    からO(log(n))で素因数分解する
    """
    res = set()
    while n > 1:
        res.add(min_factor[n])
        n //= min_factor[n]
        # 割った後の素因数についてもO(1)で参照できる
    return res

# 素因数が重複しているかを調べる
min_factor = prime_factor_sieve(MAX)
res = set()
is_ok = 1
A = [a for a in A if a != 1]
for a in A:
    tmp = factorization(a, min_factor)
    if res & tmp:
        is_ok = 0
        break
    res = factorization(a, min_factor)
if is_ok:
    print("pairwise coprime")
else:
    g = A[0]
    for i in range(1, N):
        g = gcd(g, A[i])
    if g == 1:
        print("setwise coprime")
    else:
        print("not coprime")

### FIXED CODE ###

from math import gcd

N = int(input())
A = list(map(int, input().split()))
MAX = 10**6 + 1

def prime_factor_sieve(n):
    """
    エラトステネスの篩で、
    2 ~ Nの各数に対して、その整数のもつ最小の素因数
    (その整数を篩落とした最小の素因数)を記録して返す
    O(nloglog(n))
    """
    res = [i for i in range(n+1)]
    for i in range(2, int(n**0.5)+1):
        if res[i] < i:
            continue
        for j in range(i*i, n+1, i):
            if res[j] == j:
                res[j] = i
    return res

def factorization(n, min_factor, used_factor, cnt):
    """
    エラトステネスの篩で手に入れた、各整数の最小素因数のリスト
    からO(log(n))で素因数分解する
    """
    
    while n > 1:
        if used_factor[min_factor[n]] == 0:
            used_factor[min_factor[n]] = cnt
        elif used_factor[min_factor[n]] != cnt:
            return False
        n //= min_factor[n]
        # 割った後の素因数についてもO(1)で参照できる
    return True


# 素因数が重複しているかを調べる
min_factor = prime_factor_sieve(MAX)
res = set()
is_ok = 1
used_factor = [0]*(MAX+1)
cnt = 1
for a in A:
    if a == 1:
        continue
    is_ok = factorization(a, min_factor, used_factor, cnt)
    cnt += 1
    if not is_ok:
        break

if is_ok:
    print("pairwise coprime")
else:
    g = A[0]
    for i in range(1, N):
        g = gcd(g, A[i])
    if g == 1:
        print("setwise coprime")
    else:
        print("not coprime")
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	vector<int> a(5);
	int max = 0;
	int kazu = 0;
	rep(i,5){
		cin >> a[i];
		int amari;
		if(a[i]%10 == 0) amari = 0;
		else amari = 10-(a[i]%10);
		if(amari >= max){
			max = amari;
			kazu = i;
		}
	}
	int ans = 0;
	rep(i,5){
		if(i == kazu) continue;
		else{
			if(a[i]%10 == 0) ans+=a[i];
			else ans+= ((a[i]/10)*10 + 10);
		}
	}
	cout << ans+a[kazu] << endl;
	return 0;
}

### FIXED CODE ###

a = [int(input()) for i in range(5)]
max = 0
kazu = 0
ans = 0
for i in range(5):
    if a[i]%10 == 0: amari = 0
    else: amari = 10-(a[i]%10)
    if amari >= max:
        max = amari
        kazu = i
for i in range(5):
    if i == kazu: pass
    else:
        if a[i]%10 == 0:
            ans+=a[i]
        else:
            ans+=((int(a[i]/10))*10 +10)
print(ans+a[kazu])
def main():
    n = int(input())
    res = ''
    d = 1
    base = []
    alp = 'abcdefghijklmnopqrstuvwxyz'
    for i in range(12):
        d *= 26
        base.append(d)
    for b in base:
        if b > n:
            break
        mod = n % b
        n = n - mod
        res = alp[mod-1] + res
    print(res)




if __name__ == '__main__':
    main()



### FIXED CODE ###

def main():
    n = int(input())
    res = ''
    d = 1
    base = []
    alp = 'abcdefghijklmnopqrstuvwxyz'
    for b in range(12):
        mod = n % 26
        if mod == 0:
            mod = 26
        res = alp[mod-1] + res
        if n - mod == 0:
            break
        else:
            n = int((n - mod) / 26)
            
    print(res)




if __name__ == '__main__':
    main()
N = int(input()) 
A=list(map(int,input().split())) 
i=0 
s=[] 
for i in range(N): 
    s.append(0)  
    s[i]=A.count(i+1) 
    print(s[i])

### FIXED CODE ###

import math
a = int(input())
print(2*a*math.pi)
if a*b % 2 == 0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

a,b=map(int,input().split())
print('Even' if a*b%2==0 else 'Odd')
trash = input()
input_1 = map(int,input().split(' '))
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')

### FIXED CODE ###

trash = input()
input_1 = list(map(int,input().split(' ')))
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')