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

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

for i in range(n):
    x_median = x[0:i] + x[i+1:]
    print(median(x_median))

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
xsort = sorted(x)
x1, x2 = xsort[n//2-1], xsort[n//2]

for i in range(n):
    if x[i] <= x1:
        print(x2)
    else:
        print(x1)

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

n = int(input())
x = deque(map(int, input().split()))

for i in range(0, len(x)):
    x_copy = x.copy()
    del x_copy[i]
    print(median(x_copy))

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
xsort = sorted(x)
x1, x2 = xsort[n//2-1], xsort[n//2]

for i in range(n):
    if x[i] <= x1:
        print(x2)
    else:
        print(x1)

Buggy python submission (verdict: Time Limit Exceeded):
from statistics import median

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

for i in range(0, len(x)):
    x_copy = x[:]
    x_copy.pop(i)
    print(median(x_copy))

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
xsort = sorted(x)
x1, x2 = xsort[n//2-1], xsort[n//2]

for i in range(n):
    if x[i] <= x1:
        print(x2)
    else:
        print(x1)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

for i in range(a, b+1):
    if i - a < k or b - i < k:
        print(i)

Fixed submission:
a, b, k = map(int, input().split())
if b - a < 2 * k:
    for i in range(a, b+1):
        print(i)
else:
    for i in range(a, a+k):
        print(i)
    for i in range(b-k+1, b+1):
        print(i)
Buggy python submission (verdict: Runtime Error):
N,D=map(int(),input().split())
print(N//(2D+1))

Fixed submission:
import math
N,D=map(int,input().split())
print(math.ceil(N/(2*D+1)))
Buggy python submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
lll=L//673
rrr=R//673
if l<r or ll==0:
  print(0)
elif lll>=1 and R-L>=3:
  print(0)
else:
  print(ll*(ll+1))


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

Buggy python submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
if l<r or ll==0:
  print(0)
else:
  print(ll*(ll+1))


Fixed submission:
N,A,B=map(int,input().split())
print(min(N*A,B))
Buggy python submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
rr=R%2019
Ans=[]
if R-L>=2019:
  print(0)
else:
  if R==L+1:
    Ans.append(R*L%2019)
  else:
    for i in range(R,L+1):
      for j in range(R+1,L+1):
        Ans.append(i*j%2019)
print(min(Ans))


Fixed submission:
L, R = map(int, input().split())
if R - L >= 2018:
	print(0)
else:
	ans = 2019
	for i in range(L, R):
		for j in range(i + 1, R + 1):
			ans = min(ans, i * j % 2019)
	print(ans)

Buggy python submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
if l<r or ll==0 or :
  print(0)
else:
  print(ll*(ll+1))

Fixed submission:
L, R = map(int, input().split())
if R - L >= 2018:
	print(0)
else:
	ans = 2019
	for i in range(L, R):
		for j in range(i + 1, R + 1):
			ans = min(ans, i * j % 2019)
	print(ans)
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
LL=[L+i for i in range(N)]
LLL=[abs(L+i) for i in range(N)]

if N+L<0:
  print(sum(LL)+min(LLL))
elif N+L=0:
  print(sum(LL))
else:
  print(sum(LL)-min(LLL))

Fixed submission:
S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
  print("Bad")
else:
  print("Good")

Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
LL=[L+i for i in range(N)]
LLL=[abs(L+i) for i in range(N)]

if N+L<0:
  print(sum(LL)+min(LLL))
else:
  print(sum(LL)-min(LLL))

Fixed submission:
S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
  print("Bad")
else:
  print("Good")
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
LL=[L+i for i in range(N)]
LLL=[abs(L+i) for i in range(N)]

if N+L<0:
  print(sum(LL)+min(LLL))
elif N+L=0:
  print(sum(LL))
else:
  print(sum(LL)-min(LLL))

Fixed submission:
N,L=map(int,input().split()) 
LL=[L+i for i in range(N)]
if L>=1:
  print(sum(LL)-min(LL))
elif N+L>0:
  print(sum(LL))
else:
  print(sum(LL)-max(LL))
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
L.append(0)
L.sort()
for i in range(N+1):
  if sum(L[:i+1]) > X:
    print(i)
    break
  elif sum(L) =<X:
    print(N)
    break

Fixed submission:
X,A=map(int,input().split())
if X < A:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
print((int(input()-1)*90)

Fixed submission:
a=int(input())
print(a*180-360)
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
s=list(input())
print([l.replace(s[int(b)],str.lower(s[int(b)])) for l in s])

Fixed submission:
N,k=map(int,input().split())
S=input()
print(S[:k-1] + S[k-1].lower() + S[k:])
Buggy python submission (verdict: Runtime Error):
a=(input())
b=int(a[0:2])
c=int(a[2:4])
if b==0 or c==o:
  print("NA")
elif b => 12 and c=>12:
  print("NA")
elif b =>12:
  print("YYMM")
elif c=>12:
  print("MMYY")
else:
  print("AMBIGUOUS")

Fixed submission:
A=input()
B=int(A[:2])
C=int(A[2:4])
  
if(1<=B<=12):
    if(1<=C<=12):
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif(1<=C<=12):
    print('YYMM')    
else:
    print('NA')
Buggy python submission (verdict: Time Limit Exceeded):
X,Y,Z,K=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
z=list(map(int,input().split()))

L=[xx+yy for xx in x for yy in y ]
L=sorted(L,reverse=True)

if K > X*Y:
  LL=[l+zz for l in L for zz in z]
  [print(i) for i in sorted(LL,reverse=True)]   
else:
  LL=[l+zz for l in L[:K] for zz in z]
  LL=sorted(LL,reverse=True)
  [print(ll) for k,ll in zip(range(K),LL)]

Fixed submission:
X,Y,Z,K=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
z=list(map(int,input().split()))

L=[xx+yy for xx in x for yy in y ]
L=sorted(L,reverse=True)

if K > X*Y:
  LL=[l+zz for l in L for zz in z]
  [print(i) for i in sorted(LL,reverse=True)]   
else:
  LL=[l+zz for l in L[:K] for zz in z]
  LL=sorted(LL,reverse=True)
  [print(ll) for k,ll in zip(range(K),LL)]

Buggy python submission (verdict: Time Limit Exceeded):
X,Y,Z,K=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
z=list(map(int,input().split()))

L=[]
for xx in x:
  for yy in y:
    L.append(yy+xx)
L=sorted(L,reverse=True)

if K > X*Y:
  LL=[]
  for l in L:
    for zz in z:
      LL.append(l+zz)
  [print(i) for i in sorted(LL,reverse=True)]   
else:
  LL=[]
  for l in L[:K]:
    for zz in z:
      LL.append(l+zz)
  LL=sorted(LL,reverse=True)
  for k,ll in zip(range(K),LL):
    print(ll)
    

Fixed submission:
X,Y,Z,K=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
z=list(map(int,input().split()))

L=[xx+yy for xx in x for yy in y ]
L=sorted(L,reverse=True)

if K > X*Y:
  LL=[l+zz for l in L for zz in z]
  [print(i) for i in sorted(LL,reverse=True)]   
else:
  LL=[l+zz for l in L[:K] for zz in z]
  LL=sorted(LL,reverse=True)
  [print(ll) for k,ll in zip(range(K),LL)]
Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
t = [0] * (N + 1)
for i in range(N):
  t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for q in range(Q):
  l,r=map(int,input().split())
  s=S[l-1:r]
  print(t[r-1] - t[l-1])

Fixed submission:
n, q = map(int, input().split())
s = input()
 
t = [0] * (n + 1)
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i:i+2] == 'AC' else 0)
 
for i in range(q):
    l, r = map(int, input().split())
    print(t[r - 1] - t[l - 1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
for q in range(Q):
  l,r=map(int,input().split())
  s=S[l-1:r]
  print(s.count("AC"))

Fixed submission:
n, q = map(int, input().split())
s = input()
 
t = [0] * (n + 1)
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i:i+2] == 'AC' else 0)
 
for i in range(q):
    l, r = map(int, input().split())
    print(t[r - 1] - t[l - 1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
for q in range(Q):
  l,r=map(int,input().split())
  s=S[l-1:r]
  print(s.count("AC"))

Fixed submission:
n, q = map(int, input().split())
s = input()
 
t = [0] * (n + 1)
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i:i+2] == 'AC' else 0)
 
for i in range(q):
    l, r = map(int, input().split())
    print(t[r - 1] - t[l - 1])
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
a=[]
b=[]
for i in range(A):
  if A%(i+1) == 0:
    a.append(i+1)
for ii in range(B):
  if B%(ii+1) == 0:
    b.append(ii+1)
s=set(a)&set(b)
print(sorted(list(s))[K])

Fixed submission:
A,B,K=map(int,input().split())
a=[]
b=[]
for i in range(A):
  if A%(i+1) == 0:
    a.append(i+1)
for ii in range(B):
  if B%(ii+1) == 0:
    b.append(ii+1)
s=set(a)&set(b)
print(sorted(list(s))[-K])
Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(N):
  l=list(input().split)
print(l)

Fixed submission:
N=int(input())
l=[]
for i in range(N):
  d,t=input().split()
  l.append([d,t])
m=0
for i in l:
  if i[1] == "JPY":
    m=m+int(i[0])
  else:
    m=m+380000.0*float(i[0])
print(m)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+1-i]-h[i]
  ans.append(b)
print(min(b))


Fixed submission:
print("Christmas"+" Eve"*(25-int(input())))

Buggy python submission (verdict: Runtime Error):
import itertools
N,K=map(int,input().split())
L=[]
for l in range(N):
  L.append(int(input()))
ans=[]
for r in list(itertools.combinations(L,K)):
  ans.append(max(r)-min(r))
print(min(ans))

Fixed submission:
print("Christmas"+" Eve"*(25-int(input())))

Buggy python submission (verdict: Runtime Error):
print("Christmas"+25-int(input())*" Eve")

Fixed submission:
print("Christmas"+" Eve"*(25-int(input())))
Buggy python submission (verdict: Runtime Error):
N=int(input())
l=[]
for i in N:
  l.append(int(input()))
print(sum(l)-max(l)//2)

Fixed submission:
N=int(input())
l=[]
for i in range(N):
  l.append(int(input()))
print(sum(l)-max(l)//2)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+1-i]-h[i]
  ans.append(b)
print(min(b))

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+i-1]-h[i]
  ans.append(b)
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N,K=map(int,input().split())
L=[]
n=0
while n<N:
  L.append(int(input()))
  n=n+1
ans=[]
for r in list(itertools.combinations(L,K)):
  ans.append(max(r)-min(r))
print(min(ans))

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+i-1]-h[i]
  ans.append(b)
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N,K=map(int,input().split())
L=[]
n=0
while n<N:
  L.append(int(input()))
  n=n+1
ans=[]
for r in list(itertools.combinations(L,K)):
  ans.append(max(r)-min(r))
print(min(ans))

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+i-1]-h[i]
  ans.append(b)
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N,K=map(int,input().split())
L=[]
n=0
while n<N:
  L.append(int(input()))
  n=n+1
ans=[]
for r in list(itertools.combinations(L,K)):
  ans.append(max(r)-min(r))
print(min(ans))

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+i-1]-h[i]
  ans.append(b)
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N,K=map(int,input().split())
L=[]
for l in range(N):
  L.append(int(input()))
ans=[]
for r in list(itertools.combinations(L,K)):
  ans.append(max(r)-min(r))
print(min(ans))

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+i-1]-h[i]
  ans.append(b)
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N,K=map(int,input().split())
L=[]
for l in range(N):
  L.append(int(input()))
R=list(itertools.combinations(L,K))
ans=[]
for r in R:
  ans.append(max(r)-min(r))
print(min(ans))

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+i-1]-h[i]
  ans.append(b)
print(min(ans))
Buggy python submission (verdict: Runtime Error):
if input() == "7" or input() == "5" or input() == "3":
  print("YES")
else:
  print("NO")

Fixed submission:
a=int(input())
if(a==7 or a==5 or a==3):
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
if input() == 7 or input() == 5 or input() == 3:
  print("YES")
else:
  print("NO")

Fixed submission:
a=int(input())
if(a==7 or a==5 or a==3):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
if input()=="1":
  print("Hello World")
else:
  print(int(input)+int(input))

Fixed submission:
if input()=="1":
  print("Hello World")
else:
  a=input()
  b=input()
  print(int(a)+int(b))
Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = N - e[1][1] - o[0][1]
        b = N - e[0][1] - o[1][1]
        print(min(a, b))

Fixed submission:
print(1110-int(input()))

Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E)
o = collections.Counter(O)
e1=e.most_common()[0][1]
e2=e.most_common()[-1][1]
o1=o.most_common()[0][1]
o2=o.most_common()[-1][1]

Ans=[N-e1-o2,N-e2-o1,N-e2-o2,N-o1-e1]

if len(set(L))==1:
  print(N//2)
else:
  print(min(Ans))

Fixed submission:
print(1110-int(input()))
Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = n - e[1][1] - o[0][1]
        b = n - e[0][1] - o[1][1]
        print(min(a, b))

Fixed submission:
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = N - e[1][1] - o[0][1]
        b = N - e[0][1] - o[1][1]
        print(min(a, b))

Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(n - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = n - e[1][1] - o[0][1]
        b = n - e[0][1] - o[1][1]
        print(min(a, b))

Fixed submission:
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = N - e[1][1] - o[0][1]
        b = N - e[0][1] - o[1][1]
        print(min(a, b))

Buggy python submission (verdict: Runtime Error):
import itertools
N=int(input())
L=list(map(int,input().split()))
data=list(set(L))
S=list(itertools.permutations(data, 2))
ans=[]
for s in S:
  p=0
  for i in range(N):
    if i%2==0:
      if s[0]==L[i]:
        p=p
      else:
        p=p+1
    else:
      if s[1]==L[i]:
        p=p
      else:
        p=p+1
  ans.append(p)
print(min(ans))
        
  

Fixed submission:
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = N - e[1][1] - o[0][1]
        b = N - e[0][1] - o[1][1]
        print(min(a, b))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2==0 or b%==0:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b=map(int,input().split())
if a%2==1 and b%2==1:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().splite())
if a%2==0 or b%==0:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b=map(int,input().split())
if a%2==1 and b%2==1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
L=[]
for i in range(N):
  L.append(input())
if not len(L)==len(set(L)):
  print("NO")
n=0
while n<=N:
  if n==N-1:
    print("Yes")
    break
  elif L[n][-1]==L[n+1][0]:
    n=n+1
  else:
    print("NO")
    break

Fixed submission:
N=int(input())
L=[]
for i in range(N):
  L.append(input())
if not len(set(L))==len(L):
  print("No")
else:
  for n in range(N):
    if n==(N-1):
      print("Yes")
    elif L[n][-1] == L[n+1][0]:
      continue
    else:
      print("No")
      break
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input.split))
print(max(A)-min(A))


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
print(max(A)-min(A))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>8 or b8:
  print(":(")
else:
  print("Yay!")

Fixed submission:
a,b=map(int,input().split())
if a>8 or b>8:
  print(":(")
else:
  print("Yay!")
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if c-a > 2d:
  print("No")
else:
  print("Yes")

Fixed submission:
a,b,c,d=map(int,input().split())
if abs(c-a)>d:
  if abs(a-b)>d or abs(b-c)>d:
    print("No")
  else:
    print("Yes")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
if a >= x:
  print("NO")
elif a+b <= x:
  print("NO")
else:
  print(YES)

Fixed submission:
A,B,X=map(int,input().split())
if A>X:
  print("NO")
elif A+B<X:
  print("NO")
else:
  print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=list(map(int,input().split()))
[print(sorted(L[:i]+L[i+1:])[N//2-1]) for i in range(N)]

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
LL=sorted(L)
M1=LL[N//2-1]
M2=LL[N//2]
for i in L:
  if i>=M2:
    print(M1)
  else:
    print(M2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=list(map(int,input().split()))
for i in range(N):
  if i==0:
    print(sorted(L[i+1:])[N//2-1])
  else:
    print(sorted(L[:i]+L[i+1:])[N//2-1])

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
LL=sorted(L)
M1=LL[N//2-1]
M2=LL[N//2]
for i in L:
  if i>=M2:
    print(M1)
  else:
    print(M2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=list(map(int,input().split()))
for i in range(N):
  if i==0:
    print(sorted(L[i+1:])[N//2-1])
  else:
    print(sorted(L[:i]+L[i+1:])[N//2-1])

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
LL=sorted(L)
M1=LL[N//2-1]
M2=LL[N//2]
for i in L:
  if i>=M2:
    print(M1)
  else:
    print(M2)
Buggy python submission (verdict: Runtime Error):
if sort.(input()) =="abc":
  print("yes")

Fixed submission:
S=input()
S=set(S)
if len(S)==3:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
a=list(range(A,B+1))
e=a[:K]
f=a[:-K-1:-1]
g=list(set(e+f))
g.sort()
for i in g :
  print(i)

Fixed submission:
A, B, K = map(int, input().split())
 
X = list(range(A, min(A+K, B+1)))
Y = list(range(max(A+K, B-K+1), B+1))
for v in X + Y:
    print(v)

Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
a=list(range(A,B))
b=set(a[:K]+(a[:K:-1]))
for i in b:
  print(i)

Fixed submission:
A, B, K = map(int, input().split())
 
X = list(range(A, min(A+K, B+1)))
Y = list(range(max(A+K, B-K+1), B+1))
for v in X + Y:
    print(v)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().splite())
if a+b < c:
  print("No")
else:
  print("Yes")

Fixed submission:
a,b,c=map(int,input().split())
if a+b < c:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
a=""
for i in range(3):
  l=input().split()
  a=a+l[i]
print(a)

Fixed submission:
a=""
for i in range(3):
  l=input().split()
  a=a+l[0][i]
print(a)
Buggy python submission (verdict: Runtime Error):
N,A,B=map(input().split())
if A-B%2==0:
  print("Alice")
else:
  print("Borys")

Fixed submission:
N,A,B=map(int,input().split())
if (A-B)%2==0:
  print("Alice")
else:
  print("Borys")
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,T=map(int,input().split())
D=[ [x,y,z,x+y+z,10000*x+5000*y+1000*z] for x in range(N+1) for y in range(N+1)for z in range(N+1)]
D=np.array(D)
index = np.where(D[:, -1] == T)
DD=D[index]
ans = np.where(DD[:, -2] == N)
if len(DD[ans])==0:
  print("-1 -1 -1")
else:
  print(str(DD[ans][0][0])+" "+str(DD[ans][0][1])+" "+str(DD[ans][0][2]))

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

L=[[h,i,N-h-i]for h in range(N+1) for i in range(N+1) if h*1000+i*5000+(N-h-i)*10000==Y and (N-h-i)>=0]

if len(L)>0:
  print(L[0][2],end=" ")
  print(L[0][1],end=" ")  
  print(L[0][0])
else:
  print("-1 -1 -1")

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,T=map(int,input().split())
D=[ [x,y,z,x+y+z,10000*x+5000*y+1000*z] for x in range(N+1) for y in range(N+1)for z in range(N+1)]
D=np.array(D)
index = np.where(D[:, -1] == T)
DD=D[index]
ans = np.where(DD[:, -2] == N)
if len(DD[ans])==0:
  print("-1 -1 -1")
else:
  print(str(DD[ans][0][0])+" "+str(DD[ans][0][1])+" "+str(DD[ans][0][2]))

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

L=[[h,i,N-h-i]for h in range(N+1) for i in range(N+1) if h*1000+i*5000+(N-h-i)*10000==Y and (N-h-i)>=0]

if len(L)>0:
  print(L[0][2],end=" ")
  print(L[0][1],end=" ")  
  print(L[0][0])
else:
  print("-1 -1 -1")