Harryxun/stf_run huggingface dataset:
S = []

try:
    word = raw_input()
    
    while 1:
        if word == "+":
            s1 = S.pop()
            s2 = S.pop()
            S.append(s1 + s2)
        elif word == "-":
            s1 = S.pop()
            s2 = S.pop()
            S.append(s2 - s1)
        elif word == "*":
            s1 = S.pop()
            s2 = S.pop()
            S.append(s2 * s1)
        else:
            S.append(int(word))
        word = raw_input()

except:
    print S.pop()

### FIXED CODE ###

S = []

W = raw_input().split()
    
for word in W:
    if word == "+":
        s1 = S.pop()
        s2 = S.pop()
        S.append(s1 + s2)
    elif word == "-":
        s1 = S.pop()
        s2 = S.pop()
        S.append(s2 - s1)
    elif word == "*":
        s1 = S.pop()
        s2 = S.pop()
        S.append(s2 * s1)
    else:
        S.append(int(word))

print S.pop()
s = input()
t = input()

x = len(s)

if s == t:
  print('Yes')

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[0] = s[x-1]
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u

### FIXED CODE ###

print('Yes' if (input() * 2).find(input()) != -1 else 'No')
n, k = map(int, input().split())
la = list(map(int, input().split()))

count = 0
for i in range(n):
    for j in range(n-i-1):
        jj = j+1+i
        if la[i] > la[jj]:
            count += 1

count2 = 0
laa = sorted(la)
for i in range(n):
    for j in range(n-i-1):
        jj = j+1+i
      
        if laa[i] < laa[jj]:
            count2 += 1

a = count * k
b = count2 * ((1/2)*(k-1)*k)
result = int(a)+int(b)

print(result%(pow(10,9)+7))


### FIXED CODE ###

m, d = map(int, input().split())
ans = 0
for i in range(m):
    m = i+1
    for j in range(d-19):
      d = j+20
      d1 = int(d/10)
      d2 = d%10
      if d2 > 1 and m == d1*d2:
          ans += 1
print(ans)
L,R=list(map(int, input().split()))
M=2019
if R-L=1:
  print(((R%M)*(L%M))%M)
  exit()
L=L%M
if R%M<=L:
  R=(R%M)+M
else:
  R=R%M
ans=M
for i in range(L,R+1):
  for j in range(i+1,R+1):
    ans=min(ans,(i*j)%M)
print(ans)


### FIXED CODE ###

L,R=list(map(int, input().split()))
M=2019
if R-L==1:
  print(((R%M)*(L%M))%M)
  exit()
if L//M!=R//M:
  print(0)
  exit()
L=L%M
R=R%M
ans=M
for i in range(L,R+1):
  for j in range(i+1,R+1):
    ans=min(ans,(i*j)%M)
print(ans)
s = input()

if s < 10:
    print(s)
else:
    print(int(s[0]) - 1 + 9 * (len(s) - 1))


### FIXED CODE ###

s = input()

if int(s) < 10:
    print(int(s))
elif all([x == "9" for x in s[1:]]):
    print(int(s[0]) + 9 * (len(s) - 1))
else:
    print(int(s[0]) - 1 + 9 * (len(s) - 1))
import itertools

n = int(input())
p_list = tuple(map(int, input().split()))
q_list = tuple(map(int, input().split()))

seq = [i for i in range(1,n+1)]
seq_list = list(itertools.permutations(seq))
sorted_seq = sorted(seq_list)

for i in range(1, len(sorted_seq)):
  if p_list == sorted_seq[i]:
    a = i
    print(a)
  if q_list == sorted_seq[i]:
    b = i
    print(b)
print(abs(a - b))

### FIXED CODE ###

import itertools

n = int(input())
p_list = tuple(map(int, input().split()))
q_list = tuple(map(int, input().split()))

seq = [i for i in range(1,n+1)]
seq_list = list(itertools.permutations(seq))
sorted_seq = sorted(seq_list)

for i in range(len(sorted_seq)):
  if p_list == sorted_seq[i]:
    a = i
  if q_list == sorted_seq[i]:
    b = i
print(abs(a - b))
N = int(input())
a = []
for i in range(N):

  a.append(int(input())
           
print(sum(a)-max(a)//2)
     

### FIXED CODE ###

N = int(input())
a = []
for i in range(N):

  a.append(int(input()))
           
print(sum(a)-max(a)//2)
import sys
from collections import deque


   
def resolve():
    
    input = sys.stdin.readline
    N,K=map(int,input().rstrip().split())
    R,S,P=map(int,input().rstrip().split())
    T=list(input().rstrip())

    ans=0
    flag=[0 for _ in range(N)]
    for i in range(N):
        if T[i]==T[i-K] and i>=K and flag[i-K]==True: #足さない条件、K個前が既に制約で足せなくなっていた時は、今回は足せるようになるのでflag管理
            continue
        if T[i]=="r":
            ans+=P
        if T[i]=="s":
            ans+=R
        if T[i]=="p":
            ans+=S
        flag[i]=True
    print(ans)

import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """5 2
8 7 6
rsrpr"""
        output = """27"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """7 1
100 10 1
ssssppr"""
        output = """211"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """30 5
325 234 123
rspsspspsrpspsppprpsprpssprpsr"""
        output = """4996"""
        self.assertIO(input, output)

if __name__ == "__main__":
    #unittest.main()
    resolve()

### FIXED CODE ###

import sys
input = sys.stdin.readline
X=int(input().rstrip())
maxX=10**6

def resolve():
    check,table=sieve(maxX)

    for a in table:
        if a>=X:
            print(a)
            return

def sieve(n):#n以下の素数を返す, is_prime[i]:iが素数ならtrue、table[i]:小さい順に素数入る
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    is_prime=[False]+is_prime ##[False]は勝手につけた、累積和をするときはこの影響で[0]+いらない
    return is_prime, table


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """20"""
        output = """23"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """2"""
        output = """2"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """99992"""
        output = """100003"""
        self.assertIO(input, output)

if __name__ == "__main__":
    #unittest.main()
    resolve()
def compare(a, b):
  	c=0
    for x, y in zip(a, b):
        if x == y:
          c += 1
x = input()
y = input()
compare(x,y)

### FIXED CODE ###

def compare(a, b):
    c=0
    for x, y in zip(a, b):
        if x == y:
          c += 1
    return c
x = input()
y = input()
print(compare(x,y))
import sys
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[2147483647]*(n+1)
h.insert(0,0)
dp[0]=0
dp[1]=0
dp[2]=abs(h[2]-h[1])
for i in range(3,n+1):
    for j in range(i-1,max((i-k-1),0),-1):
        dp[i]=min(dp[i],abs(h[i]-h[j])+dp[j])
print(dp[n])



### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
dp=[0]*(n+1)
h.insert(0,0)
dp[2]=abs(h[2]-h[1])
for i in range(3,n+1):
    dp[i]=min(abs(h[i]-h[i-1])+dp[i-1],abs(h[i]-h[i-2])+dp[i-2])
print(dp[n])
H,W = map(int,input().split())
s = [[] for i in range(H)]
for i in range(H): s[i] = list(input())
l = [[0]*W for i in range(H)]
r = [[0]*W for i in range(H)]
d = [[0]*W for i in range(H)]
u = [[0]*W for i in range(H)]

for h in range(H):
    for w in range(W):
        if s[h][w] == ".":
            l[h][w], d[h][w] = 1,1
            if w != 0: l[h][w] = l[h][w-1] + 1
            if h != 0: d[h][w] = d[h-1][w] + 1
    for w in range(W):
        if s[H-1-h][W-1-w] == ".":
            r[H-1-h][W-1-w] = 1
            if w != 0: r[H-1-h][W-1-w] = r[H-1-h][W-w] + 1

for h in range(H):
    for w in range(W):
        if s[H-1-h][W-1-w] == ".":
            u[H-1-h][W-1-w] = 1
            if h != 0: u[H-1-h][W-1-w] = u[H-h][W-1-w] + 1
ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans, l[h][w]+r[h][w]+u[h][w]+d[h][w]-3)

print(ans)
        

### FIXED CODE ###

P,Q,R = map(int, input().split())
print(min(P+Q,Q+R,R+P))
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(N):
  ans = ans + B[A[i]]
  if i > 0 and A[i] == A[i-1] + 1:
    ans = ans + C[A[i-1]]
print(str(ans))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(N):
  ans = ans + B[A[i] - 1]
  if i > 0 and A[i] == A[i-1] + 1:
    ans = ans + C[A[i-1] - 1]
print(str(ans))
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
S = input()
N = int(input())

for i in S:
  b = a.index(i) + N
  if b<=25:
    print(a[b], end="")
  else:
    print(a[b-26], end="")


### FIXED CODE ###

a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        print(a[b], end="")
    else:
        print(a[b-26], end="")
x1, y1, x2, y2 = map(float, input().split())
print("{0:f}".format(sqrt((x1-x2)**2.0 + (y1-y2)**2.0)))


### FIXED CODE ###

import math
x1, y1, x2, y2 = map(float, input().split())
print("{0:f}".format(math.sqrt((x1-x2)**2.0 + (y1-y2)**2.0)))
C = []
for i in range(2):
  C.append(list(int, input().split()))

if C[0][0] == C[1][2] and C[0][1] == C[1][1] and C[0][2] == C[1][0]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

C = []
for i in range(2):
  C.append(list(input()))
 
if C[0][0] == C[1][2] and C[0][1] == C[1][1] and C[0][2] == C[1][0]:
  print('YES')
else:
  print('NO')
N=input()
a=int(N)
b=list(N)
sum=0
for i in N:
  sum+=i
 
if a%sum==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N=input()
a=int(N)
b=list(N)
sum=0

for i in b:
  sum+=int(i)
 
if a%sum==0:
  print('Yes')
else:
  print('No')
t=a[i-1][j-1]
dp[i][j][k]=(dp[i-1][j][abs(k+t)]
             or dp[i-1][j][abs(k-t)]
             or dp[i][j-1][abs(k+t)]
             or dp[i][j-1][abs(k-t)])

### 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)]
grid = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
  for j in range(w):
    grid[i][j] = abs(a[i][j]-b[i][j])
dp = [[0 for j in range(w)] for k in range(h)]
buf = (h+w)*80
for i in range(h):
  for j in range(w):
      t = grid[i][j]
      if i == j == 0:
        dp[i][j] = 1 << buf+t | 1 << buf-t
      if j > 0:
        dp[i][j] = dp[i][j] | dp[i][j-1] << t | dp[i][j-1] >> t
      if i > 0:
        dp[i][j] = dp[i][j] | dp[i-1][j] << t | dp[i-1][j] >> t
for i in range(buf):
  if (dp[h-1][w-1] & 1 << buf+i) or (dp[h-1][w-1] & 1 << buf-i):
    print(i)
    exit()
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

def check(x):
  dp = [0] * (K + 1)
  dp[0] = 1
  for i in range(N):
    for j in range(K - 1, -1, -1):
      if i == x: continue
      if dp[j]:
        dp[min(K, j + a[i])] = dp[j]
  for j in range(max(0, K - a[x]), K):
    if dp[j]: return True
  return False
#for i in range(N): print(check(i))

if check(0):
  print(0)
  exit(0)
ok = N + 1
ng = 0
while ok - ng > 1:
  m = (ok + ng) // 2
  if check(m): ok = m
  else: ng = m
print(ok)


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
t = 0
res = -1
for i in range(N):
  if t + a[i] < K: t += a[i]
  else: res = i
print(N - res - 1)
k = int(input())

d = deque(list(range(1, 10)))
c = 0
v = 0
while c < k:
    v = d.popleft()
    c += 1
    if v % 10 == 9:
        d.append(v * 10 + 8)
        d.append(v * 10 + 9)
    elif v % 10 == 0:
        d.append(v * 10)
        d.append(v * 10 + 1)
    else:
        t = v % 10
        d.append(v * 10 + t - 1)
        d.append(v * 10 + t)
        d.append(v * 10 + t + 1)
print(v)



### FIXED CODE ###

from collections import deque

k = int(input())

d = deque(list(range(1, 10)))
c = 0
v = 0
while c < k:
    v = d.popleft()
    c += 1
    if v % 10 == 9:
        d.append(v * 10 + 8)
        d.append(v * 10 + 9)
    elif v % 10 == 0:
        d.append(v * 10)
        d.append(v * 10 + 1)
    else:
        t = v % 10
        d.append(v * 10 + t - 1)
        d.append(v * 10 + t)
        d.append(v * 10 + t + 1)
print(v)
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
kyori=[]
if n>=m:
    print(0)
    
else:
    for i in range(m-1):
        kyori.append(a[i+1]-a[i])
    b=0
    kyori.sort()
    for i in range(m-n):
        b+=kyori[i]
    
print(b)

### FIXED CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
kyori=[]
if n>=m:
    print(0)
    
else:
    for i in range(m-1):
        kyori.append(a[i+1]-a[i])
    b=0
    kyori.sort()
    for i in range(m-n):
        b+=kyori[i]
    
    print(b)
i=True

while i:
  
  N,K=map(int,input().split())
  
  if N > K:
  
  	wide = N - K
  
  elif N = K:
    
    wide = 0
    
  else:
    
    wide = 1
    
  print(wide)

### FIXED CODE ###

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

if N > K and K !=1:
	wide = N - K
elif N == K or K==1:
  	wide = 0
else:
    wide = 0
    
print(wide)
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

def lcm(a,b):
	return a*b/gcd(a,b)

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1e9+7
ans=int(0)
for i in a:
	ans=(ans+tmp/i)%mod
print(int(ans))









### FIXED CODE ###

def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

def lcm(a,b):
	return a*b//gcd(a,b)

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1000000007
print(sum(tmp//i for i in a)%mod)
import fractions
n=int(input())
a=list(map(int,input().split()))
x=100000
X=0
a.sort()
flag=False

for i in range(0,n-1):
  if fractions.gcd(a[i],a[i+1])==1 and fractions.gcd(a[i+1],a[i+2])==1:
    a.pop(i+1)
    flag=True
    break
if flag!=True:
  for i in range(n-1):
    if x>=fractions.gcd(a[i],a[i+1]):
      x=fractions.gcd(a[i],a[i+1])
      X=a[i]
  if X in a:
    a.remove(X)

ans = a[0]
for i in range(1,n-1):
  ans = fractions.gcd(ans, a[i])
print(ans)

### FIXED CODE ###

import math
n=int(input())
a = list(map(int,input().split()))
a.sort()
lr=[0]*n
rl=[0]*n

for i in range(n):
  if i==0:
    g=a[0]
    lr[0]=g
  else:
    g=math.gcd(a[i],g)
    lr[i]=g
    
for i in range(n-1,0,-1):
  if n-1==i:
    g=a[n-1]
    rl[n-1]=g
  else:
    g=math.gcd(a[i],g)
    rl[i]=g  
hantei=0
ans=0
#print(lr)
#print(rl)
for i in range(n):
  if i==0:
    hantei=rl[1]
  elif i==n-1:
    hantei=lr[n-2]
  else:
    hantei=math.gcd(lr[i-1],rl[i+1])
  if ans<=hantei:
    ans=hantei
    
print(ans)
import math
x1,y1,x2,y2=map(int,input().split())
print("%.6f"%math.sqrt((x2-x1)**2+(y2-y1**2)))

### FIXED CODE ###

x1,y1,x2,y2=map(float,input().split())
print("%.6f"%((x2-x1)**2+(y2-y1)**2)**0.5)
n=int(input())
if n=1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)

### FIXED CODE ###

n=int(input())
if n==1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
import sys
from math import gcd
def input(): return sys.stdin.readline().strip()

def fast_prime_factorization(A, max_num):
    """
    リストAに現れる自然数全てをO(NlogN)で素因数分解する（NはリストAの長さ）
    max_numはAに現れる自然数の上界。
    """
    # エラトステネスの篩でprimes[i] = (iを割り切る最小の素数)を記録する
    primes = [0] * (max_num + 1)
    for i in range(2, int(max_num**0.5) + 1):
        if primes[i] != 0: continue
        for j in range(i, max_num + 1, i):
            if primes[j] == 0: primes[j] = i

    # factorization[i] = {p1:n1, p2:n2, ...} (A[i] = p1^{n1} * p2^{n2} * ...)
    factorization_list = [{} for _ in range(len(A))]
    for i, a in enumerate(A):
        while a > 1:
            if primes[a] not in factorization_list[i]:
                factorization_list[i][primes[a]] = 1
            else:
                factorization_list[i][primes[a]] += 1
            a //= primes[a]

    return factorization_list


def main():
    N = int(input())
    A =list(map(int, input().split()))

    all_gcd = A[0]
    for a in A:
        all_gcd = gcd(all_gcd, a)
    if all_gcd != 1:
        print("not coprime")
        return

    prime_factor_list = fast_prime_factorization(A, 10**6)
    d = set()
    for factor_dict in prime_factor_list:
        for prime in factor_dict:
            if prime in d:
                print("setwize coprime")
                return
            d.add(prime)
    print("pairwise coprime")




if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from math import gcd
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    A =list(map(int, input().split()))

    all_gcd = A[0]
    max_num = A[0]
    for a in A:
        all_gcd = gcd(all_gcd, a)
        max_num = max(max_num, a)
    if all_gcd != 1:
        print("not coprime")
        return

    # エラトステネスの篩でprimes[i] = (iを割り切る最小の素数)を記録する
    min_prime = [i for i in range(max_num + 1)]
    for p in range(2, int(max_num**0.5) + 1):
        if min_prime[p] != p: continue
        for i in range(2, max_num // p + 1): min_prime[i * p] = p

    used = [0] * (max_num + 1)
    for a in A:
        while a > 1:
            p = min_prime[a]
            if used[p]:
                print("setwise coprime")
                return
            while a % p == 0: a //= p
            used[p] = 1
    print("pairwise coprime")




if __name__ == "__main__":
    main()
from math import trunc
import sys
import copy
from collections import deque
import collections
import itertools
stdin = sys.stdin
import math

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()

s = [0 for _ in range(2000)]
s[0] = 1
s[3] = 1
s[4] = 1
s[5] = 1

if n < 6:
    print(s[n])
    exit(0)

for i in range(6, 2001):
    s[i] = s[i-3] + s[i-1]
    s[i] %= mod
    if i==n:
        break

print(s[n])


### FIXED CODE ###

from math import trunc
import sys
import copy
from collections import deque
import collections
import itertools
stdin = sys.stdin
import math

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()

s = [0 for _ in range(2001)]
s[0] = 1
s[3] = 1
s[4] = 1
s[5] = 1

if n < 6:
    print(s[n])
    exit(0)

for i in range(6, 2001):
    s[i] = s[i-3] + s[i-1]
    s[i] %= mod
    if i==n:
        break

print(s[n])
N, M, K = map(int, input().split)
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a = [0]
b = [0]

for i in range(N):
    a.append(a[i] + A[i])

for j in range(M):
    b.append(b[i] + B[i])

ans = 0
j = M

for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(i + j, ans)

print(ans)

### FIXED CODE ###

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

a = [0]
b = [0]

for i in range(N):
    a.append(a[i] + A[i])

for j in range(M):
    b.append(b[j] + B[j])

ans = 0
j = M

for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(i + j, ans)

print(ans)
print((int(input()) - 1)*(int(input()) - 1))

### FIXED CODE ###

a, b = map(int, input().split())
print((a-1)*(b-1))
N, M = map(int, input().split())
P = [0] * M
Y = [0] * M
for i in range(M):
    P[i], Y[i] = map(int, input().split())

X = [0] * M
for p in set(P):
    I = [i for i in range(M) if P[i] == p]
    Y = [Y[i] for i in I]
    earliest = min(Y)
    latest = max(Y)
    i = 0
    for y in range(earliest, latest + 1):
        if y in Y:
            X[I[i]] = Y.index(y) + 1
            i += 1

for i in range(M):
    print("{:06}{:06}".format(P[i], X[i]))


### FIXED CODE ###

N, M = map(int, input().split())
C = [tuple(map(int, input().split())) for _ in range(M)]
P = {c[0]: [] for c in C}
for c in C:
    P[c[0]].append(c[1])
for p in P:
    P[p].sort()
    P[p] = {P[p][i]: i + 1 for i in range(len(P[p]))}
for c in C:
    print('{:06}{:06}'.format(c[0], P[c[0]][c[1]]))
n, k = map(int, input().split())
h =  list(map(int, input().split()))

s = sum(h)
h = sorted(h, reverse=True)
for i in range(k):
    s -= h[k]
print(s)

### FIXED CODE ###

n, k = map(int, input().split())
h =  list(map(int, input().split()))

def solve():
    global n, k, h
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        s -= h[i]
    return s

print(solve())
n = int(input())
list = []
for a in range(2,n-1):
        sum = 0
        sum1 = 0
        b = n - a
        for j in range(len(str(a))):
                sum += int(str(a)[j])
        for k in range(len(str(b))):
                sum1 += int(str(b)[k])
        list.append(sum + sum1)
print(min(list))

### FIXED CODE ###

n = int(input())
l = []
for a in range(1,n):
        sum = 0
        sum1 = 0
        b = n - a
        for i in range(len(str(a))):
                sum += int(str(a)[i])
        for i in range(len(str(b))):
                sum1 += int(str(b)[i])
        l.append(sum+sum1)
print(min(l))
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)

for cnt in range(m):
    a[0] = a[0] // 2
    if a[0] // 2 < a[1]:
         a.sort(reverse = True)

print(sum(a))

### FIXED CODE ###

import sys
import heapq
input = sys.stdin.readline
 
n, m = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
    a[i] *= -1
heapq.heapify(a)
 
for cnt in range(m):
    temp = heapq.heappop(a)*(-1)
    if temp == 0:
        break
    heapq.heappush(a, (temp//2)*(-1))
    
print(sum(a)*(-1))
import numpy as np
N, W = map(int, input().split())
dp = np.zeros(W+1, dtype=np.int64)
for _ in range(N):
    w,v = map(int, input().split())
    np.maximum(dp[w:], dp[:-w] + v , dp[w:])
print(max(dp))

### FIXED CODE ###

def main():
    N, W = map(int, input().split())
    #dp[v] vとなる最小のＷ
    dp = [10**9+1 for _ in range(10**5+1)]
    for _ in range(N):
        w,v = map(int, input().split())
        for val in range(10**5, 1, -1):
            if val - v < 1:
                break
            dp[val] = min(dp[val], dp[val - v] + w)
        if dp[v] > w:
            dp[v] = w
    ans = 0
    for v, w in enumerate(dp):
        if w <= W:
            ans = max(ans, v)
    print(ans)
if __name__ == '__main__':
    main()
import decimal
n = int(input())
v = list(map(int, input().split()))
v = sorted(v)

temp = 0

for i in range(1,n):
    if i == 1:
        temp += decimal.Decimal((v[0] + v[1])/2)
    else:
        print(temp, v[i])
        sum_ = decimal.Decimal((temp + v[i])/2)

print(sum_)

### FIXED CODE ###

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

temp = 0
sum_ = 0

for i in range(1,n):
    if i == 1:
        temp += decimal.Decimal((v[0] + v[1])/2)
    else:
        temp = decimal.Decimal((temp + v[i])/2)

print(temp)
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]
counter = Counter(s)


for key in output:
  print(f'{key} x {counter[key]}')

### FIXED CODE ###

from collections import Counter

n = int(input())
s = [input() for _ in range(n)]
counter = Counter(s)
output = ['AC', 'WA', 'TLE', 'RE']

for key in output:
    print(f'{key} x {counter[key]}')
_input = input()
k = _input.split()[0]
a = _input.split()[1].split(" ")[0]
b = _input.split()[1].split(" ")[1]

for i in range(1, 1000):
  if a<= (i* k) <= b:
    print("OK")
    break
  elif (i* k) > b:
    break
    print("NG")




### FIXED CODE ###

k = int(input())
a_b = input()
a = int(a_b.split(" ")[0])
b = int(a_b.split(" ")[1])

for i in range(1, 1000):
  if a<= (i* k) <= b:
    print("OK")
    break
  elif (i* k) > b:
    print("NG")
    break
else:
    print("NG")