Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
ans=0
for i in range(n):
    x=int(input())
    try:
        del a[a.index(x)]
    except:
        a.append(x)
print(len(a))


Fixed submission:
n=int(input())
d={}
ans=0
for i in range(n):
    a=int(input())
    try:
        if d[a]%2==0:
            ans+=1
            d[a]+=1
        else:
            ans-=1
            d[a]+=1
    except:
        d[a]=1
        ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
ans=0
for i in range(n):
    x=int(input())
    if a.count(x)==0:
        a.append(x)
    else:
        del a[a.index(x)]
print(len(a))


Fixed submission:
n=int(input())
d={}
ans=0
for i in range(n):
    a=int(input())
    try:
        if d[a]%2==0:
            ans+=1
            d[a]+=1
        else:
            ans-=1
            d[a]+=1
    except:
        d[a]=1
        ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
ans=0
for i in range(n):
    x=int(input())
    if a.count(x)%2==0:
        ans+=1
        a.append(x)
    else:
        ans-=1
        a.append(x)
print(ans)


Fixed submission:
n=int(input())
d={}
ans=0
for i in range(n):
    a=int(input())
    try:
        if d[a]%2==0:
            ans+=1
            d[a]+=1
        else:
            ans-=1
            d[a]+=1
    except:
        d[a]=1
        ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=input().split()
b=[]

for i in range(n):
    b.append(a[i])
    b.reverse()
print(' '.join(b))


Fixed submission:
n=int(input())
a=input().split()
a_even=[a[i] for i in range(0,n,2)]
a_odd=[a[i] for i in range(1,n,2)]

if n%2==1:
    a_even.reverse()
    ans=' '.join(a_even) +' ' + ' '.join(a_odd)
    print(ans)
else:
    a_odd.reverse()
    ans=' '.join(a_odd)+' '+' '.join(a_even)
    print(ans)
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
if x==1 or x==3 or x==5 or x== 7 or ==8 or x==12 or x==!0:
    if y==1 or y==3 or y==5 or y==7 or y==8 or y==10 or y==12:
        print('Yes')
    else:
        print('No')
elif x==4 or x==6 or x==9 or x==11:
    if y==4 or y==6 or y==9 or y==12:
        print('Yes')
    else:
        print('No')
else:
    print('No')


Fixed submission:
x,y=map(int,input().split())
if x==1 or x==3 or x==5 or x== 7 or x==8 or x==12 or x==10:
    if y==1 or y==3 or y==5 or y==7 or y==8 or y==10 or y==12:
        print('Yes')
    else:
        print('No')
elif x==4 or x==6 or x==9 or x==11:
    if y==4 or y==6 or y==9 or y==11:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=1
if n<=1000:
    for i in range(1,n+1):
        p*=i
    print(p%(10**9+7))
else:
    p=641419708
    for i in range(1001,n+1):
        p*=i
    print(p%(10**9+7))


Fixed submission:
n=int(input())
p=1
if n<=1000:
    for i in range(1,n+1):
        p*=i
        p=p%(10**9+7)
    print(p)
else:
    p=641419708
    for i in range(1001,n+1):
        p*=i
        p=p%(10**9+7)
    print(p)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=1
for i in range(1,n+1):
    p*=i
print(p%(10**9+7))


Fixed submission:
n=int(input())
p=1
if n<=1000:
    for i in range(1,n+1):
        p*=i
        p=p%(10**9+7)
    print(p)
else:
    p=641419708
    for i in range(1001,n+1):
        p*=i
        p=p%(10**9+7)
    print(p)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[input() for i in range(n)]
b=[input() for i in range(m)]

for i in range(n-m):
    for j in range(n-m):
        flag=True
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l]!=b[k][l]:
                    flag=False
                    break
            if not flag:
                break
        if flag:
            print('Yes')
            break

if not flag:
    print('No')


Fixed submission:
n,m=map(int,input().split())
a=[input() for i in range(n)]
b=[input() for i in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        flag=True
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l]!=b[k][l]:
                    flag=False
                    break
            if not flag:
                break
        if flag:
            print('Yes')
            break
    if flag:
        break

if not flag:
    print('No')
Buggy python submission (verdict: Runtime Error):
li=input().spl;it(',')
print(li[0]+' '+li[1]+' ' + li[2])


Fixed submission:
li=input().split(',')
print(li[0]+' '+li[1]+' ' + li[2])
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
a=0
for x in range(k+1):
  for y in range (x+1):
    for z in range (y+1):
      if x + y + z == s and x!=y and y!=z and z!=x:
          a+=6
      elif x+y+z==s and x==y and x!=z:
          a+=3
      elif x+y+z==s and y==z and x!=y:
          a+=3
      elif x+y+z==s and x==z and x!=y:
          a+=3
      elif x+y+z==s and x==y and y==z:
          a+=1
          break
print(a)


Fixed submission:
k,s = map(int,input().split())
a=0
for x in range(k+1):
    for y in range(k+1):
        if 0<=s-x-y<=k:
            a+=1
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
a=0
for x in range(k+1):
  for y in range (k+1):
    for z in range (k+1):
      if x + y + z == s:
        a+=1
        break

print(a)


Fixed submission:
k,s = map(int,input().split())
a=0
for x in range(k+1):
    for y in range(k+1):
        if 0<=s-x-y<=k:
            a+=1
print(a)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b==C:
    print(1)
elif a==b or b==c or c==a:
    print(2)
else:
    print(3)


Fixed submission:
a,b,c=map(int,input().split())
li=[a,b,c]
li.sort()

if a==b==c:
    print(1)

elif li[0]==li[1] or li[1]==li[2]:
    print(2)
else:
    print(3)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b==C:
    print(1)
elif a==b or b==c or c==a:
    print(2)
else:
    print(3)


Fixed submission:
a,b,c=map(int,input().split())
li=[a,b,c]
li.sort()

if a==b==c:
    print(1)

elif li[0]==li[1] or li[1]==li[2]:
    print(2)
else:
    print(3)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = n

x = 1

for i in range(1, n - 1):
    for j in range(1, n):
        n = m
        n -= i
        if n % j == 0:
            x += 1
        else:
            x = x

print(x)

Fixed submission:
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
k = list(map(int, input().split()))

x = 0

for i in range(0, n - 1):
    for j in range(i + 1, n):

        x += (k[i] * k[j]) % (10 ** 9 + 7)

        if x < 10 ** 9 + 7:
            continue
        else:
            x = x % (10 ** 9 + 7)

print(x)

Fixed submission:
mod = 10 ** 9 + 7

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

s = sum(a) 

ans = 0

for i in a:
    s -= i
    s %= mod
    ans += i * s
    ans %= mod

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = [ int(x) for x in input().split() ]
S = input()
lr = []
for i in range(Q):
    lr.append([ int(x) for x in input().split() ])

aclist = []
target = 'AC'
index = -1
while True:
    index = S.find(target, index + 1)
    if index == -1:
        break
    aclist.append(index+1)

for i in range(Q):
    matched = [ x for x in aclist if x >= lr[i][0] and x+1 <= lr[i][1] ]
    print(len(matched))


Fixed submission:
import bisect

N, Q = [int(x) for x in input().split()]
S = input()
lr = []
for i in range(Q):
    lr.append([int(x)-1 for x in input().split()])

aclist = []
target = "AC"
index = -1
while True:
    index = S.find(target, index + 1)
    if index == -1:
        break
    aclist.append(index)

for [l, r] in lr:
    min_ac = bisect.bisect_left(aclist, l)
    max_ac = bisect.bisect_right(aclist, r-1)
    print(max_ac - min_ac)
Buggy python submission (verdict: Runtime Error):
import collections

n = int(input())
a = [ int(x) for x in input().split() ]

def count_elem(x):
    coll = collections.Counter(x)
    return coll.most_common()

b = count_elem(a[::2])
c = count_elem(a[1::2])

if b[0][0] != c[0][0]:
    print(len(a) - b[0][1] - c[0][1])
else:
    if b[0][1] > c[0][1]:
        if len(c) > 1:
            print(len(a) - b[0][1] - c[1][1])
        else:
            print(len(a) - b[0][1])
    elif b[0][1] < c[0][1]:
        if len(b) > 1:
            print(len(a) - b[1][1] - c[0][1])
        else:
            print(len(a) - c[0][1])
    elif b[0][1] == c[0][1]:
        if b[1][1] >= c[1][1]:
            print(len(a) - b[1][1] - c[0][1])
        else:
            print(len(a) - b[0][1] - c[1][1])


Fixed submission:
import collections

n = int(input())
a = [ int(x) for x in input().split() ]

def count_elem(x):
    coll = collections.Counter(x)
    return coll.most_common()

b = count_elem(a[::2])
c = count_elem(a[1::2])

if b[0][0] != c[0][0]:
    print(len(a) - b[0][1] - c[0][1])
else:
    if b[0][1] > c[0][1]:
        if len(c) > 1:
            print(len(a) - b[0][1] - c[1][1])
        else:
            print(len(a) - b[0][1])
    elif b[0][1] < c[0][1]:
        if len(b) > 1:
            print(len(a) - b[1][1] - c[0][1])
        else:
            print(len(a) - c[0][1])
    elif b[0][1] == c[0][1]:
        if len(a)/2 == b[0][1]:
            print(int(len(a)/2))
        else:
            if b[1][1] >= c[1][1]:
                print(len(a) - b[1][1] - c[0][1])
            else:
                print(len(a) - b[0][1] - c[1][1])
Buggy python submission (verdict: Runtime Error):
in = input()
plus = in.count("+")
print(plus*2-4)


Fixed submission:
i = input()
p = i.count("+")
print(2*p-4)
Buggy python submission (verdict: Time Limit Exceeded):
import copy

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

class Node:
    def __init__(self, id):
        self.id = id
        self.path = []
        self.passed = False
    def __str__(self):
        return "id: " + str(self.id) + " path: " + str(self.path) + " passed: " + str(self.passed)

nodes = []
for i in range(N):
    nodes.append(Node(i))

for i in range(M):
    from_id, to_id = [ int(x) - 1 for x in input().split()]
    nodes[from_id].path.append(to_id)
    nodes[to_id].path.append(from_id)

def if_all_passed(nodes_current):
    for node in nodes_current:
        if not node.passed:
            return False
    return True

def go_child(id_new, nodes_current):
    nodes_current[id_new].passed = True
    if if_all_passed(nodes_current):
        return 1

    count = 0
    for i in nodes[id_new].path:
        if not nodes_current[i].passed:
            count += go_child(i, copy.deepcopy(nodes_current))
    return count

count = go_child(0, nodes)
print(count)


Fixed submission:
import copy

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

class Node:
    def __init__(self, id):
        self.id = id
        self.path = []
    def __str__(self):
        return "id: " + str(self.id) + " path: " + str(self.path)

nodes = []
for i in range(N):
    nodes.append(Node(i))

for i in range(M):
    from_id, to_id = [ int(x) - 1 for x in input().split() ]
    nodes[from_id].path.append(to_id)
    nodes[to_id].path.append(from_id)

def if_all_passed(passed_nodes):
    if len(passed_nodes) == N:
        return True
    else:
        return False

def go_child(id_new, passed_nodes):
    passed_nodes.append(id_new)
    if if_all_passed(passed_nodes):
        return 1

    count = 0
    for i in nodes[id_new].path:
        if not i in passed_nodes:
            count += go_child(i, copy.deepcopy(passed_nodes))
    return count

count = go_child(0, [])
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 0
mod = 1000000007

for i in range(N):
    for j in range(i+1,N):
        ans += A[i]*A[j]
        ans %= mod

print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = 0
mod = 1000000007

a = sum(A)

for i in range(N):
    a -= A[i]
    ans += A[i]*a
    ans %= mod

print(ans)
Buggy python submission (verdict: Runtime Error):
s = list(str(input()))
t = list(str(input()))
l = []
count = 0
for i in range(len(s)-len(t)):
    for j in range(len(t)):
        if s[i+j] != t[j]:
            count += 1

    l.append(count)
    count = 0
print(min(l))

Fixed submission:
s = list(str(input()))
t = list(str(input()))
l = []
count = 0
for i in range(len(s)-len(t) + 1):
    for j in range(len(t)):
        if s[i+j] != t[j]:
            count += 1

    l.append(count)
    count = 0
print(min(l))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
import itertools
ans = 0
result = []


for i in range(len(a)):
    for j in range(i+1,len(a)):
        if i < j:
            ans += a[i] * a[j]
        
print(ans%(10 ** 9 + 7))

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

ans = 0

sum_a = sum(a)


for i in range(n):
    ans += a[i] * (sum_a - a[i])
    sum_a -= a[i]

print(ans%(10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
import itertools
ans = 0
result = []


for i in range(len(a)):
    for j in range(len(a)):
        if i < j:
            ans += a[i] * a[j]
print(ans%(10 ** 9 + 7))

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

ans = 0

sum_a = sum(a)


for i in range(n):
    ans += a[i] * (sum_a - a[i])
    sum_a -= a[i]

print(ans%(10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
import itertools
ans = 0
result = []


def listExcludedIndices(data, indices=[]):
  return [x for i, x in enumerate(data) if i not in indices]

for i in range(len(a)):
  for j in range(i, len(a) - 1):
      jData = listExcludedIndices(a, [i])
      #result.append([a[i], jData[j]])
      ans += a[i] * jData[j]

print(ans%(10 ** 9 + 7))

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

ans = 0

sum_a = sum(a)


for i in range(n):
    ans += a[i] * (sum_a - a[i])
    sum_a -= a[i]

print(ans%(10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
import itertools
ans = 0
for v in itertools.combinations(a, 2):
    ans += v[0]*v[1]
print(ans%(10 ** 9 + 7))

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

ans = 0

sum_a = sum(a)


for i in range(n):
    ans += a[i] * (sum_a - a[i])
    sum_a -= a[i]

print(ans%(10 ** 9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))

f = 0
d = 1
e = 1
for i in range(n-k):
    for j in range(k):
        d *= a[i+j]
        e *= a[i+j+1]

    if d < e:
        print("Yes")
        d,e = 1,1
    else:
        print("No")
        d,e = 1,1

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))

f = 0
d = 1
e = 1
for i in range(n-k):


    if a[i] < a[i+k]:
        print("Yes")

    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
o = n // 3
a = [0]* n * 2
for i in range(1,o):
    for j in range(1,o):
        for k in range(1,o):
            num = i * i + j * j + k * k + i * j + j * k + k * i
            if  num > n:
                break
            a[num-1] +=1
            #print("#" + str(num)+" "+str(i) + " " + str(j) + " "+ str(k))
for  i in range(n*2):
    if i >= n:
        break
    print(a[i])

Fixed submission:
n = int(input())
o = n // 5
if n > 1000:
    o =n //100
a = [0]* n * 2
for i in range(1,o):
    for j in range(1,o):
        for k in range(1,o):
            num = i * i + j * j + k * k + i * j + j * k + k * i
            if  num > n:
                break
            a[num-1] +=1
           # print("#" + str(num)+" "+str(i) + " " + str(j) + " "+ str(k))
for  i in range(n*2):
    if i >= n:
        break
    print(a[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range (n):
    a = input()
    if a not in s:
        s.append(a)
print(len(s))

Fixed submission:
n = int(input())
s = []
for i in range (n):
    s.append(input())
ss = sorted(s)
count = 1
for i in range(n-1):
    if ss[i] != ss[i + 1]:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
def gcd_3(i,j,k):
    return gcd(gcd(i,j),k)
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans += gcd_3(i,j,k)
print(ans)

Fixed submission:
n = int(input())
import math
l = []
for i in range(1,n +1):
    for j in range(1,n+1):
        l.append(math.gcd(i,j))
ans = 0
for i in range(1, n+1):
    for j in l:
        ans += math.gcd(j,i)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
def gcd(i,j,k):
    return math.gcd(math.gcd(i,j),k)
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans += gcd(i,j,k)
print(ans)

Fixed submission:
n = int(input())
import math
l = []
for i in range(1,n +1):
    for j in range(1,n+1):
        l.append(math.gcd(i,j))
ans = 0
for i in range(1, n+1):
    for j in l:
        ans += math.gcd(j,i)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

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

k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            ans += gcd(i,j,l)
print(ans)

Fixed submission:
n = int(input())
import math
l = []
for i in range(1,n +1):
    for j in range(1,n+1):
        l.append(math.gcd(i,j))
ans = 0
for i in range(1, n+1):
    for j in l:
        ans += math.gcd(j,i)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
def judg(x):
    list_x = list(str(x))
    flag = 0
    for i in range(len(list_x) - 1):
        if abs(int(list_x[i]) - int(list_x[i + 1])) <= 1:
            flag = 0
        else:
            flag = 1
            break
    if flag == 0:
        return True
    else:
        return False
ans = 1
if k == 1:
    print("1")
else:
    i = 1 #回数
    list_a = []
    ans = 1
    while(i != k or judg(ans) == False):
        if i == k:
            ans += 1
        if judg(ans) == True:
            i += 1
            ans += 1
            list_a.append(ans)
        else:
            ans += 1
    print(ans)


Fixed submission:
k = int(input())
a = list()
old = list()
for i in range(1,10):
    a.append(i)
while(True):
    if k <= len(a):
        print(a[k - 1])
        break
    k -= len(a)
    old.clear()
    a,old = old,a
    for i in old:
        for d in range(-1,2):
            last_num = i % 10 + d
            if (last_num >= 0) and (last_num <= 9):
                new = 10 * i + last_num
                a.append(new)

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
def runrun(x):
    run = x + 1
    while(judg(run) == True):
        run += 1
    return run
def judg(x):
    list_x = list(str(x))
    flag = 0
    for i in range(len(list_x) - 1):
        if abs(int(list_x[i]) - int(list_x[i + 1])) <= 1:
            flag = 0
        else:
            flag = 1
            break
    if flag == 1:
        return True
    else:
        return False
ans = 1
if k == 1:
    print("1")
else:
    for i in range(k - 1):
        x = runrun(ans)
        ans = x
    print(x)

Fixed submission:
k = int(input())
a = list()
old = list()
for i in range(1,10):
    a.append(i)
while(True):
    if k <= len(a):
        print(a[k - 1])
        break
    k -= len(a)
    old.clear()
    a,old = old,a
    for i in old:
        for d in range(-1,2):
            last_num = i % 10 + d
            if (last_num >= 0) and (last_num <= 9):
                new = 10 * i + last_num
                a.append(new)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
p = list(map(int,input().split()))
sum_p = []
for i in p:
    sum_p.append((1 + i) / 2)

ans=[]
for i in range(n - k + 1):
    ans.append(sum(sum_p[i:i + k]))

print(max(ans))

Fixed submission:
n, k = map(int,input().split())
p = list(map(int,input().split()))
sum_p = []
for i in p:
    sum_p.append((1 + i) / 2)

ans = sum(sum_p[0:k])
check = sum(sum_p[0:k])
p = 0
for i in range(k,n):
    check = check + sum_p[i] - sum_p[i - k]
    if check > ans:
        ans = check
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
p = list(map(int,input().split()))
sum_p = []
for i in p:
    sum_p.append((1 + i) / 2)
ans = sum(sum_p[0:k])
for i in range(n - k + 1):
    if ans < sum(sum_p[i:i + k]):
        ans = sum(sum_p[i:i + k])
print(ans)

Fixed submission:
n, k = map(int,input().split())
p = list(map(int,input().split()))
sum_p = []
for i in p:
    sum_p.append((1 + i) / 2)

ans = sum(sum_p[0:k])
check = sum(sum_p[0:k])
p = 0
for i in range(k,n):
    check = check + sum_p[i] - sum_p[i - k]
    if check > ans:
        ans = check
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
p = list(map(int,input().split()))
sum_p = []
for i in p:
    sum_p.append((1 + i) / 2)
ans = sum(sum_p[0:k])
for i in range(n - k + 1):
    if ans < sum(sum_p[i:i + k]):
        ans = sum(sum_p[i:i + k])
print(ans)


Fixed submission:
n, k = map(int,input().split())
p = list(map(int,input().split()))
sum_p = []
for i in p:
    sum_p.append((1 + i) / 2)

ans = sum(sum_p[0:k])
check = sum(sum_p[0:k])
p = 0
for i in range(k,n):
    check = check + sum_p[i] - sum_p[i - k]
    if check > ans:
        ans = check
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n ,k = map(int,input().split())
h = list(map(int,input().split()))
flag = 0
ans = 0
for i in range(k):
  if n <= k:
    break
  re = max(h)
  h.remove(re)
  flag += 1
for i in range(n - flag):
  if n <= k:
    ans = 0
  else:
    ans += h[i]
print(ans)

Fixed submission:
n, k = map(int,input().split())
h = list(map(int,input().split()))
ans = 0
sort = sorted(h)
for i in range(n-k):
  ans += sort[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())
if (a + b) <= k:
  print("0 0")
else:
  for i in range (k):
    if a > 0:
      a -= 1
    elif b > 0:
      b -= 1
    else:
      break
  print(str(a) + " " + str(b))

Fixed submission:
a,b,k = map(int,input().split())
if (a + b) <= k:
  a = 0
  b = 0
elif a >= k:
  a = a - k
else:
  b = b - (k - a)
  a = 0 
print(str(a) + " " + str(b))
Buggy python submission (verdict: Runtime Error):
n , k = map(int ,input().split())
h = list(map(int,input().split()))
ans = 0
for i in range(n):
if h[i] >= k:
ans += 1

print(ans)


Fixed submission:
n , k = map(int ,input().split())
h = list(map(int,input().split()))
ans = 0
for i in range(n):
  if h[i] >= k:
    ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n = map(int,input().split())
ans = n * n * n
print(ans)

Fixed submission:
n = int(input())
ans = n * n * n
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
b = list(map(int,input().split()))

a = list()
ans = 0
a.append(b[0])

for i in range(n-2):
  a.append(b[i])
  if(b[i+1]<b[i]):
    a.pop(i+1)
    a.append(b[i+2])

j = max(b[-1],b[-2])
a.append(j)

for i in range(n):
  ans += a[i]

print(ans)


Fixed submission:
n = int(input())
b = list(map(int,input().split()))

a = list()
ans = 0
a.append(b[0])

for i in range(n-2):
  j = min(b[i],b[i+1])
  a.append(j)

a.append(b[-1])

for i in range(n):
  ans += a[i]

print(ans)