Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

count = sys.maxsize

for i in range(N):
    changeNum = S[:i].count("W") + S[i+1:].count("E")
    count = min(count, changeNum)

print(count)

Fixed submission:
import sys

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

count = sys.maxsize
ans = S[1:].count("E")

for i in range(N-1):
    count = min(ans, count)
    if S[i] == "W":
        if S[i+1] == "W":
            ans += 1
    elif S[i] == "E":
        if S[i+1] == "E":
            ans -= 1

count = min(ans, count)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

n = int(input())
d = list(input())

minNum = sys.maxsize

for i in range(n):
    count = 0
    if i == 0:
        count = d[i+1:].count("E")
    elif i == n-1:
        count = d[:i].count("W")
    else:
        count += d[:i].count("W")
        count += d[i+1:].count("E")
    if count < minNum:
        minNum = count

print(minNum)

Fixed submission:
import sys

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

count = sys.maxsize
ans = S[1:].count("E")

for i in range(N-1):
    count = min(ans, count)
    if S[i] == "W":
        if S[i+1] == "W":
            ans += 1
    elif S[i] == "E":
        if S[i+1] == "E":
            ans -= 1

count = min(ans, count)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

n = int(input())
d = list(input())

minNum = sys.maxsize

for i in range(n):
    count = 0
    if i == 0:
        newD = d[i+1:]
        for j in newD:
            if j == "E":
                count += 1
    elif i == n-1:
        newD = d[:i]
        for j in newD:
            if j == "W":
                count += 1
    else:
        left = d[:i]
        right = d[i+1:]
        for p in left:
            if p == "W":
                count += 1
        for q in right:
            if q == "E":
                count += 1
    if count < minNum:
        minNum = count

print(minNum)

Fixed submission:
import sys

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

count = sys.maxsize
ans = S[1:].count("E")

for i in range(N-1):
    count = min(ans, count)
    if S[i] == "W":
        if S[i+1] == "W":
            ans += 1
    elif S[i] == "E":
        if S[i+1] == "E":
            ans -= 1

count = min(ans, count)
print(count)
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [input() for i in range(n)]
l.sort()
total = 0

for i in range(n):
  total += int(l[n-1])
  if x < total:
    print(n)
print(n)

Fixed submission:
s = list(input())
price = 700

for t in s:
    if t == "o":
        price += 100

print(price)
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [input() for i in range(n)]
l.sort()
count, total = 0
while total < x:
    total += int(l[i])
    count += 1
print(count)

Fixed submission:
n, x = map(int, input().split())
l = [int(input()) for i in range(n)]
l.sort()
print((x - sum(l)) // l[0] + n)

Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [input() for i in range(n)]
l.sort()
count = 0
while total < x:
    total += int(l[i])
    count += 1
print(count)

Fixed submission:
n, x = map(int, input().split())
l = [int(input()) for i in range(n)]
l.sort()
print((x - sum(l)) // l[0] + n)
Buggy python submission (verdict: Runtime Error):
s = list(input())

print((s in "a") & (s in "b") & (s in "c"))

Fixed submission:
s = list(input())

if (("a" in s) & ("b" in s) & ("c" in s)):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = list(input())

return (s in "a") & (s in "b") & (s in "c")

Fixed submission:
s = list(input())

if (("a" in s) & ("b" in s) & ("c" in s)):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import collections

n = int(input())
blueCards = [input() for i in range(n)]
blueCards = collections.Counter(blueCards)
m = int(input())
redCards = [input() for i in range(m)]
redCards = collections.Counter(redCards)

diff = blueCards - redCards
print(diff.most_common()[0][1])

Fixed submission:
import collections

n = int(input())
blueCards = [input() for i in range(n)]
blueCards = collections.Counter(blueCards)
m = int(input())
redCards = [input() for i in range(m)]
redCards = collections.Counter(redCards)

diff = blueCards - redCards
print(diff.most_common()[0][1]) if diff else print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input)
a = int(input)
print("Yes") if ((n % 500) <= a) else print("No")

Fixed submission:
n = int(input())
a = int(input())
print("Yes") if n % 500 <= a else print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input)
a = int(input)
print("Yes") if (n % 500) < a else print("No")

Fixed submission:
n = int(input())
a = int(input())
print("Yes") if n % 500 <= a else print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input)
a = int(input)
print("Yes") if n % 500 < a else print("No")

Fixed submission:
n = int(input())
a = int(input())
print("Yes") if n % 500 <= a else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
X, Y = map(int, input().split())

while True:
    if X % Y != 0:
        print(X)
    else:
        print(-1)

Fixed submission:
X, Y = map(int, input().split())


if X % Y != 0:
    print(X)
else:
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
X, Y = map(int, input().split())


if X != Y:       
    for i in range(X, 10**18,X):
        if (i != X) and (i % Y != 0):
            print(i)
            break
else:
    print(-1)

Fixed submission:
X, Y = map(int, input().split())


if X % Y != 0:
    print(X)
else:
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
X, Y = map(int, input().split())


if X != Y:       
    for i in range(max(X,Y)+1, 10**18):
        if (i % X == 0) and (i % Y != 0):
            print(i)
            break
else:
    print(-1)

Fixed submission:
X, Y = map(int, input().split())


if X % Y != 0:
    print(X)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input)
a = int(input)
print("Yes") if ((n % 500) <= a) else print("No")

Fixed submission:
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print("Odd") if a * b % != 0 else print("Even")

Fixed submission:
a, b = map(int, input().split())
print("Odd") if (a * b) % 2 != 0 else print("Even")
Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().split())
count = 0

for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i + j + l == s:
                count += 1

print(count)

Fixed submission:
n, a, b = map(int, input().split())
total = 0


def calc(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n = n // 10
    return sum

for i in range(n+1):
    if a <= calc(i) & calc(i) <= b:
        total += i

print(total)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(math.ceil((a + b) / 2))

Fixed submission:
import math
a, b = map(int, input().split())
print(math.ceil((a + b) / 2))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

def calcLucas(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    return calcLucas(n-1) + calcLucas(n-2)

print(calcLucas(n))

Fixed submission:
n = int(input())

l = [0] * 87
l[0] = 2
l[1] = 1
for i in range(2, n + 1):
    l[i] = l[i-1] + l[i-2]
print(l[n])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

def calcLucas(n):
    if n == 0:
        return 2
    if n == 1:
        return 1
    return calcLucas(n-1) + calcLucas(n-2)

print(calcLucas(n))

Fixed submission:
n = int(input())

l = [0] * 87
l[0] = 2
l[1] = 1
for i in range(2, n + 1):
    l[i] = l[i-1] + l[i-2]
print(l[n])

Buggy python submission (verdict: Runtime Error):
n = int(input())

def calcLucas(n):
    if n == 0:
        return 2
    if n == 1:
        return 1
    return calc(n-1) + calc(n-2)

print(calcLucas(n))

Fixed submission:
n = int(input())

l = [0] * 87
l[0] = 2
l[1] = 1
for i in range(2, n + 1):
    l[i] = l[i-1] + l[i-2]
print(l[n])
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = set()
for i in range(n):
    tmp = int(input())
    l.remove(tmp) if tmp in l else l.add(tmp)
print(len(l))


Fixed submission:
l = list(input())
print("Yes") if "9" in l else print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
#l = [l.remove(int(input())) if int(input()) in l else int(input()) for i in range(n)]
for i in range(n):
    l.remove(int(input())) if int(input()) in l else l.append(int(input()))
print(len(l))

Fixed submission:
l = list(input())
print("Yes") if "9" in l else print("No")

Buggy python submission (verdict: Runtime Error):
l = list(input())
print("Yes") if l in "9" else print("No")

Fixed submission:
l = list(input())
print("Yes") if "9" in l else print("No")

Buggy python submission (verdict: Runtime Error):
l = list(input().split())
print("Yes") if l in "9" else print("No")

Fixed submission:
l = list(input())
print("Yes") if "9" in l else print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
#l = [l.remove(int(input())) if int(input()) in l else int(input()) for i in range(n)]
for i in range(n):
    l.remove(int(input())) if int(input()) in l else l.append(int(input()))
print(len(l))

Fixed submission:
n = int(input())
l = set()
for i in range(n):
    tmp = int(input())
    l.remove(tmp) if tmp in l else l.add(tmp)
print(len(l))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    tmp = int(input())
    l.remove(tmp) if tmp in l else l.append(tmp)
print(len(l))


Fixed submission:
n = int(input())
l = set()
for i in range(n):
    tmp = int(input())
    l.remove(tmp) if tmp in l else l.add(tmp)
print(len(l))
Buggy python submission (verdict: Runtime Error):
n = int(input())
print("Yes") if n[0] == n[2] else print("No")

Fixed submission:
n = input()
print("Yes") if n[0] == n[2] else print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
count = 0
currCount = 0
ans = 0
for i in range(n+1):
    currCount = 0
    currNum = i
    while (i % 2) == 0:
        if i == 0:
            break
        i = int(i / 2)
        currCount += 1
    if count < caurrCount:
        count = currCount
        ans = currNum
print(ans)

Fixed submission:
n = int(input())
count = 0
currCount = 0
ans = 0
for i in range(n+1):
    currCount = 0
    currNum = i
    while (i % 2) == 0:
        if i == 0:
            break
        i = int(i / 2)
        currCount += 1
    if count <= currCount:
        count = currCount
        ans = currNum
print(ans)
Buggy python submission (verdict: Runtime Error):
x, a, b = int(input().split())
if a >= b:
    print("delicious")
elif (b - a) <= x:
    print("safe")
else:
    print("dangerous")

Fixed submission:
x, a, b = map(int, input().split())
if a >= b:
    print("delicious")
elif (b - a) <= x:
    print("safe")
else:
    print("dangerous")
Buggy python submission (verdict: Runtime Error):
from collections import deque

N = int(input())
S = input()
ans = deque(S)
S += " "

ind = 0
for _ in range(N):
    if S[ind] == "(" and S[ind+1] == ")":
        ind += 2
        continue
    elif S[ind] == ")":
        ans.appendleft("(")
    elif S[ind] == "(":
        ans.append(")")
    ind += 1

print("".join(ans))

Fixed submission:
from collections import deque

N = int(input())
S = input()
ans = deque(S)


while S.find("()") != -1:
    S = S.replace("()","")

for i in range(len(S)):
    if S[i] == ")":
        ans.appendleft("(")
    elif S[i] == "(":
        ans.append(")")
print("".join(ans))

Buggy python submission (verdict: Runtime Error):
from collections import deque

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

ans = deque(S)

ind = 0
for _ in range(N-1):
    if S[ind] == "(" and S[ind+1] == ")":
        ind += 2
        continue
    elif S[ind] == ")":
        ans.appendleft("(")
    elif S[ind] == "(":
        ans.append(")")
    ind += 1

print("".join(ans))

Fixed submission:
from collections import deque

N = int(input())
S = input()
ans = deque(S)


while S.find("()") != -1:
    S = S.replace("()","")

for i in range(len(S)):
    if S[i] == ")":
        ans.appendleft("(")
    elif S[i] == "(":
        ans.append(")")
print("".join(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for i in range(n)]
total = sum(l)
i = 0
while total % 10 == 0:
    if i = n:
        break
    total = total - l[i]
    i += 1
print(total)


Fixed submission:
a, b = map(int, input().split())
print(a + b) if (a + b) < 10 else print("error")

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for i in range(n)]
total = sum(l)
i = 0
while total % 10 == 0:
    total = total - l[i]
    i + 1
print(total)


Fixed submission:
a, b = map(int, input().split())
print(a + b) if (a + b) < 10 else print("error")

Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
print(a + b) if a + b  < 10 else print("error")

Fixed submission:
a, b = map(int, input().split())
print(a + b) if (a + b) < 10 else print("error")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
l.sort()
power = 0
for i in range(len(l)//3):
    power += l[-2]
    l = l[1:-2]
print(power)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
power = 0
for i in range(1,len(l)//3+1):
    power += l[-2*i]
print(power)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
l.sort()


def calc(l):
    if len(l) == 3:
        return l[1]
    power = l[-2]
    l = l[1:-2]
    return calc(l) + power

print(calc(l))


Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
power = 0
for i in range(1,len(l)//3+1):
    power += l[-2*i]
print(power)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map (int, input().split()))
l.sort()

def calc(l):
    if len(l) == 3:
        return l[1]
    power = l[-2]
    l = l[1:-2]
    return calc(l) + power

print(calc(l))

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
power = 0
for i in range(1,len(l)//3+1):
    power += l[-2*i]
print(power)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map (int, input().split()))
l.sort()

def calc(l):
    if len(l) == 3:
        return l[1]
    power = l[-2]
    l = l[1:-2]
    return calc(l) + power

print(calc(l))

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
power = 0
for i in range(1,len(l)//3+1):
    power += l[-2*i]
print(power)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map (int, input().split()))
l.sort()

def calc(l):
    if len(l) == 3:
        return l[1]
    l = l[1:-2]
    return calc(l) + l[-2]

print(calc(l))

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
power = 0
for i in range(1,len(l)//3+1):
    power += l[-2*i]
print(power)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(1, n+1):
    if n % i == 0:
        l.append([i, n // i])
    if i == n // i:
        break
print(max(len(str(l[-1][0])), len(str(l[-1][1]))))

Fixed submission:
n = int(input())
l = [[i, n//i] for i in range(1, int(n**0.5)+1) if n % i == 0]
print(max(len(str(l[-1][0])), len(str(l[-1][1]))))
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count = 0

for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i + j + l == s:
                count += 1

print(count)

Fixed submission:
k, s = map(int, input().split())
count = 0

for x in range(k+1):
    for y in range(k+1):
        z =  s - x - y
        if 0 <= z & z <= k:
            count +=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count = 0

for i in range(k+1):
    for j in range(k+1):
        for k in range(k+1):
            if i + j + k == s:
                count += 1

print(count)

Fixed submission:
k, s = map(int, input().split())
count = 0

for x in range(k+1):
    for y in range(k+1):
        z =  s - x - y
        if 0 <= z & z <= k:
            count +=1
print(count)
Buggy python submission (verdict: Runtime Error):
a, op, b = input().split()

if op == "+":
    print(a + b)
else:
    print(a - b)

Fixed submission:
a, op, b = input().split()

if op == "+":
    print(int(a) + int(b))
if op == "-":
    print(int(a) - int(b))

Buggy python submission (verdict: Runtime Error):
a , op, b = input().split()
if op == "+":
    print(a + b)
elif op == "-":
    print(a - b)

Fixed submission:
a, op, b = input().split()

if op == "+":
    print(int(a) + int(b))
if op == "-":
    print(int(a) - int(b))
Buggy python submission (verdict: Runtime Error):
a, b, x = map(int, input().split())


def count(a, n):
    return a // n

print(count(b, x) - count(a-1, x))


Fixed submission:
import sys
input = sys.stdin.readline

l = input().split()
print("A" + l[1][0] + "C")
Buggy python submission (verdict: Runtime Error):
import collections
w = list(input())
c = collections.Counter(w)
print("Yes") if all([i % 2 == 0 for i in list(c)]) else print("No")

Fixed submission:
import collections
w = list(input())
c = collections.Counter(w)
print("Yes") if all([i % 2 == 0 for i in c.values()]) else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N, K = map(int, input().split())
dic = {}
count = 0
for a in range(K, N+2):
    for i in itertools.combinations(range(1, N+2), a):
        length = len(i)
        sum_ = sum(i)
        if sum_ in dic.keys():
            if length == dic[sum_]:
                continue
            else:
                count += 1
                count %= 10000000007
        else:
            dic[sum_] = length
            count += 1
            count %= 10000000007

print(count)

Fixed submission:
import itertools

N, K = map(int, input().split())
# dic = {}
# count = 0
# for a in range(K, N+2):
#     for i in itertools.combinations(range(1, N+2), a):
#         length = len(i)
#         sum_ = sum(i)
#         if sum_ in dic.keys():
#             if length == dic[sum_]:
#                 continue
#             else:
#                 count += 1
#                 count %= 10000000007
#         else:
#             dic[sum_] = length
#             count += 1
#             count %= 10000000007
#
# print(count)
result = 0
for i in range(K, N+2):
    a = (i-1) * i/2
    b = (2*N-i+1) * i/2
    result += b - a + 1
    result %= 1000000007

print(int(result))
Buggy python submission (verdict: Time Limit Exceeded):
K, N = map(int, input().split())
lists = list(map(int, input().split()))

# a = 1000000
# for i in range(len(lists)):
#     if abs(K - lists[i]) == 0:
#         continue
#     elif abs(K - lists[i]) < a:
#         a = abs(K - lists[i])
# b = 1000000
# for i in range(len(lists)):
#     for j in range(len(lists)):
#         if abs(lists[i] - lists[j]) == 0:
#             continue
#         elif abs(lists[i] - lists[j]) < b:
#             b = abs(lists[i] - lists[j])

a = []
for i in range(len(lists)):
    if abs(K - lists[i]) == 0:
        continue
    else:
        a.append(abs(K - lists[i]))
b = []
for i in range(len(lists)):
    for j in range(len(lists)):
        if abs(lists[i] - lists[j]) == 0:
            continue
        else:
            b.append(abs(lists[i] - lists[j]))
a = min(a)
b = min(b)

c = a+b
print(c)

Fixed submission:
K, N = map(int, input().split())
lists = list(map(int, input().split()))

lists_slic = lists[1:] + lists[0:1]

# print(lists_slic)
a = 0
for i in range(len(lists)):
    if lists_slic[i] - lists[i] < 0:
        b = lists_slic[i] - lists[i] + K
        if b > a:
            a = b
    else:
        if (lists_slic[i] - lists[i])>a:
            a = lists_slic[i] - lists[i]

c = K - a

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
K, N = map(int, input().split())
lists = list(map(int, input().split()))

a = []
a = 1000000
for i in range(len(lists)):
    if abs(K - lists[i]) == 0:
        continue
    elif abs(K - lists[i]) < a:
        a = abs(K - lists[i])
b = 1000000
for i in range(len(lists)):
    for j in range(len(lists)):
        if abs(lists[i] - lists[j]) == 0:
            continue
        elif abs(lists[i] - lists[j]) < b:
            b = abs(lists[i] - lists[j])

# print(a)
# print(b)
c = a+b
print(c)

Fixed submission:
K, N = map(int, input().split())
lists = list(map(int, input().split()))

lists_slic = lists[1:] + lists[0:1]

# print(lists_slic)
a = 0
for i in range(len(lists)):
    if lists_slic[i] - lists[i] < 0:
        b = lists_slic[i] - lists[i] + K
        if b > a:
            a = b
    else:
        if (lists_slic[i] - lists[i])>a:
            a = lists_slic[i] - lists[i]

c = K - a

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())

num = 0
blue = 0
red = 0
for i in range(10**18):
    if i % 2 == 0 and N >= num:
        num += A
        blue += 1
    elif i % 2 == 1 and N >= num:
        num += B
        red += 1

    else:
        break
# print(num)
# print(blue)
# print(red)

if blue > red:
    aa = N - A * blue - B * red
    ans_b = A * blue + aa
else:
    aa = N - A * blue - B * red
    ans = B * red + aa
    ans_b = N - ans

print(ans_b)

Fixed submission:
N, A, B = map(int, input().split())

A_amari = A % 2
B_amari = B % 2

# print(A_amari)
# print(B_amari)

if A+B == 0:
    print(0)
    exit()
else:
    cnt = N // (A+B)
    amari = N % (A+B)

# print(cnt)
# print(amari)
if amari <= A:
    print(A*cnt+amari)
else:
    if amari <= B or amari > A:
        print(A*(cnt+1))

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())

num = 0
blue = 0
red = 0
for i in range(10**18):
    if i % 2 == 0 and N >= num:
        num += A
        blue += 1
    elif i % 2 == 1 and N >= num:
        num += B
        red += 1

    else:
        break
# print(num)
# print(blue)
# print(red)

if blue > red:
    aa = N - A * blue - B * red
    ans_b = A * blue + aa
else:
    aa = N - A * blue - B * red
    ans = B * red + aa
    ans_b = N - ans

print(ans_b)

Fixed submission:
N, A, B = map(int, input().split())

A_amari = A % 2
B_amari = B % 2

# print(A_amari)
# print(B_amari)

if A+B == 0:
    print(0)
    exit()
else:
    cnt = N // (A+B)
    amari = N % (A+B)

# print(cnt)
# print(amari)
if amari <= A:
    print(A*cnt+amari)
else:
    if amari <= B or amari > A:
        print(A*(cnt+1))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
lists = list(map(int, input().split()))
if K == 0:
    print(sum(lists))
    exit()

if K <= len(lists):
    for i in range(K):
        max_lists = lists.remove(max(lists))
else:
    print(0)
    exit()

# print(lists)

print(sum(lists))

Fixed submission:
N, K = map(int, input().split())
lists = list(map(int, input().split()))
if K == 0:
    print(sum(lists))
    exit()

if K <= len(lists):
    # for i in range(K):
    #     max_lists = lists.remove(max(lists))
    lists = sorted(lists)[:N - K]
    print(sum(lists))
    exit()
else:
    print(0)
    exit()

# print(lists)