Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
lA = list(str(N))
flag = 0
for _ in range(3):
  lA[i] == '7':
    flag += 1
if flag != 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
lA = list(str(N))
flag = 0
for i in range(3):
    if lA[i] == '7':
        flag += 1
if flag != 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
ln = [i for i in range(1,N+1)]
for i in range(N):
  if ln[i] % 3 == 0:
    nl.pop(i)
  elif ln[i] % 5 == 0:
    nl.pop(i)
  elif ln[i] % 15 == 0:
    nl.pop(i)
print(sum(nl))

Fixed submission:
N = int(input())
ln = [i for i in range(1,N+1)]

for i in range(N):
  if ln[i] % 3 == 0:
    ln[i] = 0
  elif ln[i] % 5 == 0:
    ln[i] = 0
  elif ln[i] % 15 == 0:
    ln[i] = 0
print(sum(ln))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
ls = list(S)
count = 0
for k in range(2,N):
  for j in range(1,k):
    for i in range(0,j):
      if ls[i] != ls[j] and ls[j] != ls[k] and ls[k] != ls[i] and 2 * j  != k + i:
        count += 1
print(count)

Fixed submission:
import itertools
N = int(input())
S = input()
ls = list(S)

nr = len([r for r in S if r == 'R'])
nb = len([b for b in S if b == 'B'])
ng = len([g for g in S if g == 'G'])

ALL = nr * nb * ng
count = 0

RGBs = list(itertools.permutations(['R', 'G', 'B'], 3))

for i in range(N):
  for j in range(N-i*2):
    if (S[j], S[j+i], S[j+i*2]) in RGBs:
      count += 1
      
print(ALL - count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
ls = list(S)
count = 0
for k in range(2,N):
  for j in range(1,k):
    for i in range(0,j):
      if ls[i] != ls[j] and ls[j] != ls[k] and ls[k] != ls[i] and j - i != k - j:
        count += 1
print(count)

Fixed submission:
import itertools
N = int(input())
S = input()
ls = list(S)

nr = len([r for r in S if r == 'R'])
nb = len([b for b in S if b == 'B'])
ng = len([g for g in S if g == 'G'])

ALL = nr * nb * ng
count = 0

RGBs = list(itertools.permutations(['R', 'G', 'B'], 3))

for i in range(N):
  for j in range(N-i*2):
    if (S[j], S[j+i], S[j+i*2]) in RGBs:
      count += 1
      
print(ALL - count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
ls = list(S)
count = 0
for k in range(2,N):
  for j in range(1,k):
    for i in range(0,j):
      if ls[i] != ls[j] and ls[j] != ls[k] and ls[k] != ls[i] and j - i != k - j:
        count += 1
print(count)

Fixed submission:
import itertools
N = int(input())
S = input()
ls = list(S)

nr = len([r for r in S if r == 'R'])
nb = len([b for b in S if b == 'B'])
ng = len([g for g in S if g == 'G'])

ALL = nr * nb * ng
count = 0

RGBs = list(itertools.permutations(['R', 'G', 'B'], 3))

for i in range(N):
  for j in range(N-i*2):
    if (S[j], S[j+i], S[j+i*2]) in RGBs:
      count += 1
      
print(ALL - count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
ls = list(S)
count = 0
for k in range(2,N):
  for j in range(1,k):
    for i in range(0,j):
      if ls[i] != ls[j] and ls[j] != ls[k] and ls[k] != ls[i] and j - i != k - j:
        count += 1
print(count)

Fixed submission:
import itertools
N = int(input())
S = input()
ls = list(S)

nr = len([r for r in S if r == 'R'])
nb = len([b for b in S if b == 'B'])
ng = len([g for g in S if g == 'G'])

ALL = nr * nb * ng
count = 0

RGBs = list(itertools.permutations(['R', 'G', 'B'], 3))

for i in range(N):
  for j in range(N-i*2):
    if (S[j], S[j+i], S[j+i*2]) in RGBs:
      count += 1
      
print(ALL - count)
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
d = [A[i+1]-A[i] for i in range(N-1)]
de = K - A[N-1] + A[0]
dis = 0
for i in range(N-2):
  dis += d[i]
if d[N-2] <= de:
  dis += d[N-2]
else:
  dis += de
print(dis)

Fixed submission:
K, N = list(map(int,input().split()))
A = list(map(int,input().split()))
d = [A[i+1]-A[i] for i in range(N-1)]
de = K - A[N-1] + A[0]
d.append(de)
D = sorted(d)
dis = 0
for i in range(N-1):
  dis += D[i]
print(dis)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N, M = map(int, readlines().split())
x = M * (M - 1) // 2
x += N * (N - 1) // 2
print(x)

Fixed submission:
N, M = map(int,input().split())
a = N * (N - 1) / 2 + M * (M - 1) / 2
print(int(a))
Buggy python submission (verdict: Runtime Error):
S = input()
sl = list(S)
N = len(sl)
flag = 0
a = int((N-1)/2)
b = int((N+3)/2)
slr = list(reversed(sl))
asl = sl[0:a]
aslr = list(reversed(asl))
bsl = sl[b:N]
bslr = list(reversed(bsl))
for i in range(N-1):
  if sl[i] != slr[i]:
    flag += 1
for i in range(0,a-1):
  if asl[i] != aslr[i]:
    flag += 1
for i in range(b-1,N-3):
  if bsl[i] != bslr[i]:
    flag += 1
if flag == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = input()
n = len(s)
m = (n-1) // 2
k = (n+3) // 2
flag = 1
for i in range(0, n//2):
    if s[i] != s[n-i-1]:
        flag = 0
        break
for i in range(0, m//2):
    if s[i] != s[m-i-1]:
        flag = 0
        break
for i in range(0, (n-k)//2+1):
    if s[i+k-1] != s[n-i-1]:
        flag = 0
        break
if flag == 1:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
flag = 0
a = (N-1)/2
b = (N+3)/2
sl = list(S)
slr = reversed(sl)
asl = sl[0:a]
aslr = reversed(asl)
bsl = sl[b:N]
bslr = reversed(bsl)
for i in range(N):
  if sl[i] != slr[i]:
    flag += 1
for i in range(0,a-1):
  if asl[i] != aslr[i]:
    flag += 1
for i in range(b-1,N):
  if bsl[i] != bslr[i]:
    flag += 1
if flag == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = input()
n = len(s)
m = (n-1) // 2
k = (n+3) // 2
flag = 1
for i in range(0, n//2):
    if s[i] != s[n-i-1]:
        flag = 0
        break
for i in range(0, m//2):
    if s[i] != s[m-i-1]:
        flag = 0
        break
for i in range(0, (n-k)//2+1):
    if s[i+k-1] != s[n-i-1]:
        flag = 0
        break
if flag == 1:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
judg = 0
n = N - 1 
for i in range(0,n):
  if S[i] == S[n - i]:
    judg += 0
  else:
    judg += 1

for i in range(0,n/2-1):
  if S[i] == S[n/2 - i]:
    judg += 0
  else:
    judg += 1

for i in range(n/2+1,n):
  if S[i] == S[n - i]:
    judg += 0
  else:
    judg += 1
    
if judg == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = input()
n = len(s)
m = (n-1) // 2
k = (n+3) // 2
flag = 1
for i in range(0, n//2):
    if s[i] != s[n-i-1]:
        flag = 0
        break
for i in range(0, m//2):
    if s[i] != s[m-i-1]:
        flag = 0
        break
for i in range(0, (n-k)//2+1):
    if s[i+k-1] != s[n-i-1]:
        flag = 0
        break
if flag == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import collections as cl
N = int(input())
A = list(map(int,inpput().split()))
cn = cl.Counter(A)
sumC = sum([n*(n-1)//2 for n in cl.values()])
for k in range(N):
  print(sumC - cn[A[k]] +1)

Fixed submission:
import collections
N = int(input())
li = list(map(int, input().split()))
cn = collections.Counter(li)
sumC = sum([n*(n-1)//2 for n in cn.values()])
for k in range(N):
    print(sumC-cn[li[k]] + 1)

Buggy python submission (verdict: Runtime Error):
import collections as cl
N = int(input())
A = list(map(int,inpput().split()))
cn = cl.Counter(A)
sumC = sum([n*(n-1)//2 for n in cl.values()])
for k in range(N):
  print(sumC - cn[k] +1)

Fixed submission:
import collections
N = int(input())
li = list(map(int, input().split()))
cn = collections.Counter(li)
sumC = sum([n*(n-1)//2 for n in cn.values()])
for k in range(N):
    print(sumC-cn[li[k]] + 1)
Buggy python submission (verdict: Runtime Error):
k = input()
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(int(A[k-1]))

Fixed submission:
lists = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(int(lists[k-1]))

Buggy python submission (verdict: Runtime Error):
k = input()
A = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}
print(int(A[k-1]))

Fixed submission:
lists = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(int(lists[k-1]))

Buggy python submission (verdict: Runtime Error):
k = input()
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(A[k-1])

Fixed submission:
lists = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(int(lists[k-1]))

Buggy python submission (verdict: Runtime Error):
lists = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(lists(k+1))

Fixed submission:
lists = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(int(lists[k-1]))

Buggy python submission (verdict: Runtime Error):
lists = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(lists(k))

Fixed submission:
lists = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(int(lists[k-1]))

Buggy python submission (verdict: Runtime Error):
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
print(A[K+1])

Fixed submission:
lists = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(int(lists[k-1]))
Buggy python submission (verdict: Runtime Error):
a, b, c = list(map(int, input().split()))
if a > 0 and b > 0 and c > 0:
  if 4*a*b < (c-a-b)**2:
  print('Yes')
  else:
  print('No')
else:
  print('')

Fixed submission:
import math
a,b,c = map(int,input().split())
l = 4*a*b
r = (c-a-b)**2
if (a+b >= c):
    print("No")
else:
    if(l < r):
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
import math as mat
a, b, c = int(input().split())
if mat.sqrt(a) + mat.sqrt(b) < mat.sqrt(c):
  print('Yes')
else:
  print('No')

Fixed submission:
import math
a,b,c = map(int,input().split())
l = 4*a*b
r = (c-a-b)**2
if (a+b >= c):
    print("No")
else:
    if(l < r):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
if S = 'AAA' or S == 'BBB':
  print('No')
else:
  print('Yes')

Fixed submission:
s = input()
if s.count('B') == 3 or s.count('A') == 3:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
S = input()
if S = 'AAA' or 'BBB':
  print('No')
else:
  print('Yes')

Fixed submission:
s = input()
if s.count('B') == 3 or s.count('A') == 3:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
S=input()
  if S=='AAA':
    print('No')
  elif S=='BBB':
    print('No')
  else:
    print('Yes')

Fixed submission:
s = input()
if s.count('B') == 3 or s.count('A') == 3:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
N, A, B = list(map(int,input().split()))
if A = 0:
  print(0)
elif A >= N:
  print(N)
elif A + B >= N:
  print(A)
else:
  print(N - B)

Fixed submission:
N, A, B = list(map(int,input().split()))
if A == 0:
  print(0)
elif A >= N:
  print(N)
elif A + B >= N:
  print(A)
else:
  print((N//(A+B))*A + min(A,N % (A+B)))

Buggy python submission (verdict: Runtime Error):
n, a, b = (int(x) for x in input().split())
if a > n:
  print(n)
else:
  if a + b > n:
    print(a)
  else:
    print(a + (n % a))

Fixed submission:
N, A, B = list(map(int,input().split()))
if A == 0:
  print(0)
elif A >= N:
  print(N)
elif A + B >= N:
  print(A)
else:
  print((N//(A+B))*A + min(A,N % (A+B)))

Buggy python submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split()))
if int(a) > int(n):
  print(int(n))
else:
  if int(a) + int(b) > int(n):
    print(int(a))
  else:
    print(int(a) + (int(n) % int(a)))

Fixed submission:
N, A, B = list(map(int,input().split()))
if A == 0:
  print(0)
elif A >= N:
  print(N)
elif A + B >= N:
  print(A)
else:
  print((N//(A+B))*A + min(A,N % (A+B)))
Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import deque

S = deque(readline().rstrip().decode())
Q = int(readline())
query = int(readlines())
rev = False
for q in query:
  if q[0] == ord('1'):
        rev = not rev
    else:
        _, f, c = q.decode().split()
        f = int(f)
        if rev ^ (f == 1):
            S.appendleft(c)
        else:
            S.append(c)
 
T = ''.join(S)
if rev:
    T = T[::-1]
print(T)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque
 
S = deque(readline().rstrip().decode())
Q = int(readline())
query = readlines()
 
rev = False
for q in query:
    if q[0] == ord('1'):
        rev = not rev
    else:
        _, f, c = q.decode().split()
        f = int(f)
        if rev ^ (f == 1):
            S.appendleft(c)
        else:
            S.append(c)
 
T = ''.join(S)
if rev:
    T = T[::-1]
print(T)
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))

for i in range(N):
  for j in range(1,101):
    print(min(sum(j-x[i])**2))

Fixed submission:
N = int(input())
X = list(map(int,input().split()))
s = sum(X)
l = len(X)
ave = s/l
if ave - float(int(ave)) <= 0.5:
  avei = int(s/l)
else:
  avei = int(s/l) + 1
ans = 0
for i in range(N):
  ans += (X[i] - avei)**2
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
B = [0 for _ in range(N)]
count = 0
for i in range(N):
  if A[i] % 2 == 0:
    B[i] = A[i]
    count += 1
B.remove(0)
flag = 0
for i in range(count):
  if B[i] % 3 != 0 and B[i] % 5 != 0:
    flag += 1
if flag == 0:
  print('APPROVED')
else:
  print('DENIED')

Fixed submission:
#入力
N = int(input())
A = list(map(int,input().split()))
#2で割り切れるものいれるリスト,要素として0は入らないのでとりあえず0
B = [0 for _ in range(N)]
#2で割り切れるリストの数カウント
count = 0
#2で割り切れるリストに偶数要素を代入&要素数カウント
for i in range(N):
  if A[i] % 2 == 0:
    B[i] = A[i]
    count += 1
#0は後からいれた要素ではありえないので削除
C = [i for i in B if i != 0]
#3と5のどちらでも割り切れない場合はだめ
flag = 0
for i in range(count):
  if C[i] % 3 != 0 and C[i] % 5 != 0:
    flag += 1
if flag == 0:
  print('APPROVED')
else:
  print('DENIED')

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = (input().split())
i_count = 0
test = []
 for i in A:
  num = int(i) % 2
  if num == 0 :
    test.append(i)
 
 for i in test:
  num3 = int(i) % 3
  num5 = int(i) % 5
  if num3 == 0 or num5 ==0:
    i_count += 1
 
 if i_count == len(test):
  print("APPROVED")
else:
  print("DENIED")

Fixed submission:
#入力
N = int(input())
A = list(map(int,input().split()))
#2で割り切れるものいれるリスト,要素として0は入らないのでとりあえず0
B = [0 for _ in range(N)]
#2で割り切れるリストの数カウント
count = 0
#2で割り切れるリストに偶数要素を代入&要素数カウント
for i in range(N):
  if A[i] % 2 == 0:
    B[i] = A[i]
    count += 1
#0は後からいれた要素ではありえないので削除
C = [i for i in B if i != 0]
#3と5のどちらでも割り切れない場合はだめ
flag = 0
for i in range(count):
  if C[i] % 3 != 0 and C[i] % 5 != 0:
    flag += 1
if flag == 0:
  print('APPROVED')
else:
  print('DENIED')

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for i in N:
  if A[i] % 2 == 0:
    if A[i] % 3 == 0 or A[i] % 5 == 0:
print('APPROVED')
    else:
print('DENIED')
  else:
print('DENIED')

Fixed submission:
#入力
N = int(input())
A = list(map(int,input().split()))
#2で割り切れるものいれるリスト,要素として0は入らないのでとりあえず0
B = [0 for _ in range(N)]
#2で割り切れるリストの数カウント
count = 0
#2で割り切れるリストに偶数要素を代入&要素数カウント
for i in range(N):
  if A[i] % 2 == 0:
    B[i] = A[i]
    count += 1
#0は後からいれた要素ではありえないので削除
C = [i for i in B if i != 0]
#3と5のどちらでも割り切れない場合はだめ
flag = 0
for i in range(count):
  if C[i] % 3 != 0 and C[i] % 5 != 0:
    flag += 1
if flag == 0:
  print('APPROVED')
else:
  print('DENIED')
Buggy python submission (verdict: Runtime Error):
S, T = input().split()
a, b = int(input.split())
U = input()
if str(S) == str(U):
  print(a-1)
else:
  print(b-1)

Fixed submission:
S, T = input().split(" ")
A, B = [int(i) for i in input().split(" ")]
U = input()
 
if S==U :
  print("{} {}".format(A-1,B))
else:
  print("{} {}".format(A,B-1))

Buggy python submission (verdict: Runtime Error):
S, T = input().split()
a, b = int(input.split())
U = input()
if list(S) == list(U):
  print(a-1)
else:
  print(b-1)

Fixed submission:
S, T = input().split(" ")
A, B = [int(i) for i in input().split(" ")]
U = input()
 
if S==U :
  print("{} {}".format(A-1,B))
else:
  print("{} {}".format(A,B-1))

Buggy python submission (verdict: Runtime Error):
S, T = input().split()
a, b = int(input.split())
U = input()
if S == U:
  print(a-1)
else:
  print(b-1)

Fixed submission:
S, T = input().split(" ")
A, B = [int(i) for i in input().split(" ")]
U = input()
 
if S==U :
  print("{} {}".format(A-1,B))
else:
  print("{} {}".format(A,B-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = kist(map(int,input().split()))
a.sorted
i for i in range(n):
  if a[i-1] == a[i] or a[i] == a[i+1]:
print('No')
  else:
print('Yes')

Fixed submission:
n=int(input())
if len(set(map(int,input().split())))==n:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
p = list(map(int,input().split()))
P = sorted(p,reverse = True)
Sum = [0 for _ in range(N-1)]
exp = [0 for _ in range(N-1)]
Exp = 0
for i in range(N-1):
  for j in range(P[i]+1):
    Sum[i] += j
  exp[i] = Sum[i]/P[i]
for i in range(0,K):
  Exp += exp[i] 
print(Exp)

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

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
k = K + 1
hp = 0
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
for i in range(0,K):
  Hs[i] = 0
for i in range(k,N):
  hp += Hs[i]

Fixed submission:
N, K = list(map(int,input().split()))
k = K - 1
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
if K <= N:
  for i in range(0,K):
    Hs[i] = 0
  print(sum(Hs))
if K > N:
  print(0)

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int64_t,input().split()))
k = K - 1
H = list(map(int64_t,input().split()))
Hs = sorted(H,reverse = True)
for i in range(0,K):
  Hs[i] = 0
print(sum(Hs))

Fixed submission:
N, K = list(map(int,input().split()))
k = K - 1
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
if K <= N:
  for i in range(0,K):
    Hs[i] = 0
  print(sum(Hs))
if K > N:
  print(0)

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
k = K - 1
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
for i in range(0,K):
  Hs[i] = 0
print(sum(Hs))

Fixed submission:
N, K = list(map(int,input().split()))
k = K - 1
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
if K <= N:
  for i in range(0,K):
    Hs[i] = 0
  print(sum(Hs))
if K > N:
  print(0)
Buggy python submission (verdict: Runtime Error):
A = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
C = input()
for i in range(len(A)):
  elif C == A[i]:
  break
print(A[i+1])

Fixed submission:
A = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
C = input()
for i in range(len(A)):
  if C == A[i]:
    break
print(A[i+1])
Buggy python submission (verdict: Runtime Error):
K, X = int(input())
if 500*K >= X:
  print('Yes')
else:
  print('No')

Fixed submission:
K, X = list(map(int,input().split()))
if 500*K >= X:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
from itertools import permutations

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

i = 0
a = 0
b = 0

for s in permutaions(range(1,n + 1)):
  for j in range(n):
    if p[j] != s[j]:
      break
  else:
    a = i
  for j in range(n):
    if q[j] != s[j]:
      break
  else:
    b = i
    i += 1
    
print(abs(a-b))

Fixed submission:
from itertools import permutations
 
n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
 
i = 0
a = 0
b = 0
for s in permutations(range(1, n+1)):
    for j in range(n):
        if p[j] != s[j]:
            break
    else:
        a = i
    for j in range(n):
        if q[j] != s[j]:
            break
    else:
        b = i
    i += 1
 
print(abs(a-b))
Buggy python submission (verdict: Runtime Error):
A, B, X = list(map(int,input().split()))
if A > X:
  print(A-X, B)
elif A <= x and B > X - A:
  print(0, B-(X-A))
elif A == 0 and B == 0:
  print(0,0)
else:
  print(0,0)

Fixed submission:
A, B, X = list(map(int,input().split()))
if A > X:
  print(A-X, B)
elif A <= X and B > X - A:
  print(0, B-(X-A))
elif A == 0 and B == 0:
  print(0,0)
else:
  print(0,0)
Buggy python submission (verdict: Runtime Error):
N, A, B = list(map(int.input().split()))
if abs(A-B) % 2 == 0:
  print(abs(A-B)//2)
else:
  print(max(A-1,B-1))

Fixed submission:
N,A,B = map(int,input().split())
if (B-A) % 2 == 0:
  print((B-A)//2)
else:
  print(min(A-1,N-B)+1+(B-A-1)//2)
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int,input().split()))
if A % B == 0:
  print(A)
elif B % A = 0:
  print(B)
else:
  print(A * B)

Fixed submission:
import fractions

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

def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)
 
print(lcm(A, B))
Buggy python submission (verdict: Runtime Error):
X = int(input())
flag = 0
for c in range(X):
  if 100*C <= X and 105*C >= X:
    flag += 1
print(flag)

Fixed submission:
X = int(input())
flag = 0
for C in range(X+1):
  if 100*C <= X and 105*C >= X:
    flag += 1
    break
print(flag)

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
flag = 0
for a in range(0,1001):
  for b in range(0,1001):
    for c in range(0,1001):
      for d in range(0,1001):
        for e in range(0,1001):
          for f in range(0,1001):
            if 100*a+101*b+102*c+103*d+104*e+105*f == X:
              flag += 1
print(flag)

Fixed submission:
X = int(input())
flag = 0
for C in range(X+1):
  if 100*C <= X and 105*C >= X:
    flag += 1
    break
print(flag)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = []
for j in range(1,N+1):
  for i in range(N):
    if A[i] == j:
      B.append(i+1)
for i in range(N):
  B[i] = str(B[i])
print(' '.join(B))

Fixed submission:
#入力 人数N 入った順番A[i]
N = int(input())
A = list(map(int, input().split()))
#[入った順番 出席番号]のリストを作製
B = [[] for i in range(N)]
for i in range(N):
    B[i] = [A[i], i+1]
#入った順番(=最初の要素)早い順に並べる
B.sort()
#出席番号だけのリストを作製
ans = [0 for i in range(N)]
for i in range(N):
    ans[i] = B[i][1]
#リストの要素をスベース付きで全て表示
print(*ans)