Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
sum=26
count=0
n = int(input())
k = ord('a')-1
while(sum<n) :
  count+=1
  sum+=26**(count+1)

current=n
mozi=''
mozi1=''
for i in range(count+1) :
  mozi+='z'
if current==sum :
  print(mozi)
else :
  for i in reversed(range(count+1)) :
    c=current//26**i

    mozi1+=chr(c+k)
    current = current % 26 ** i
  print(mozi1)

Fixed submission:
n,k = map(int, input().split())
a_list=list(map(int, input().split()))
a_list=sorted(a_list)
print(sum(a_list[:k]))

Buggy python submission (verdict: Runtime Error):
sum=26
count=0
n = int(input())
k = ord('a')-1
while(sum<n) :
  count+=1
  sum+=26**(count+1)

current=n
mozi=''
mozi1=''
for i in range(count+1) :
  mozi+='z'
if current==sum :
  print(mozi)
else :
  for i in reversed(range(count+1)) :
    c=current//26**i
    
    mozi1+=chr(c+k)
    current = current % 26 ** i
  print(mozi1)

Fixed submission:
n,k = map(int, input().split())
a_list=list(map(int, input().split()))
a_list=sorted(a_list)
print(sum(a_list[:k]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
from collections import deque
k = ord('a')
d = deque()
for i in range(26):
  d.append(chr(k + i))
m = 0
while (m<n):
  V = d.popleft()
  for i in range(26):
    d.append(V + chr(k + i))
  m += 1

print(V)


Fixed submission:
sum=26
count=0
n = int(input())
k = ord('a')-1
while(sum<n) :
  count+=1
  sum+=26**(count+1)

current=n
mozi=''
mozi1=''

list1=[]
for i in reversed(range(count+1)) :
  c=current//26**i
  current = current % 26 ** i
  list1.append(c)

for i in range(1,count+1) :
  if list1[-i]<=0 :
    list1[-i]+=26
    list1[-i-1]-=1

for  i in range(count+1) :
  mozi+=chr(list1[i]+k)
print(mozi)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = list(map(int, input().split()))
q = int(input())
for i in range(q):
  b, c = map(int, input().split())
  a_list = [c if b == i else i for i in a_list]
  print(sum(a_list))
  

Fixed submission:
n = int(input())
b_list = list(map(int, input().split()))
q = int(input())
a_list=[0]*100000
for i in b_list :
  a_list[i-1]+=1
count=sum(b_list)
for i in range(q):

  b, c = map(int, input().split())
  count+=(c-b)*a_list[b-1]
  print(count)

  a_list[c - 1] +=a_list[b-1]
  a_list[b - 1] = 0
Buggy python submission (verdict: Runtime Error):
ab=input().split()
a=int(ab[0])
b=int(ab[1][0]+ab[1][2]+ab[1][3])
 
s=a*b
print(string(s)[:-1])

Fixed submission:
ab=input().split()
a=int(ab[0])
b=int(ab[1][0]+ab[1][2]+ab[1][3])
 
s=a*b
print(s//100)

Buggy python submission (verdict: Runtime Error):
ab=input().split()
a=int(ab[0])
b=int(ab[0]+ab[2]+ab[3])
 
s=a*b
print(int(s/100))

Fixed submission:
ab=input().split()
a=int(ab[0])
b=int(ab[1][0]+ab[1][2]+ab[1][3])
 
s=a*b
print(s//100)

Buggy python submission (verdict: Runtime Error):
ab=input().split()
a=int(ab[0])
b=int(b[0]+b[2]+b[3])

s=a*b
print(int(s/100))

Fixed submission:
ab=input().split()
a=int(ab[0])
b=int(ab[1][0]+ab[1][2]+ab[1][3])
 
s=a*b
print(s//100)
Buggy python submission (verdict: Time Limit Exceeded):
a=input()
s=''
for item in a :
  if item=='?' :
    s+='D'
  else :
    s+=item
print(s)

Fixed submission:
a=input()
a=a.replace('?','D')
print(a)
Buggy python submission (verdict: Runtime Error):
a=int(input())
a=int(input())
b=input()
m=len(b)
if m<=a :
  print(b)
else :
  s=b[:a]+'...'
  
  print(s)

Fixed submission:
a=int(input())
b=input()
m=len(b)
if m<=a :
  print(b)
else :
  s=b[:a]+'...'

  print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int, input().split())
a_list=[]
for i in range(M):
    a_list.append(list(map(int,input().split())))
V_list=[]
for i in range(1,N+1) :
    i_list=[]
    for item in a_list :
        if item[0]==i :
            i_list.append(item[1])
        elif item[1]==i :
            i_list.append(item[0])
    V_list.append(i_list)

from collections import deque
s_list=[0]*N
current_V=deque()
current_V.append(1)

while (current_V!=deque([])) :
    a=current_V.popleft()
    current_list=V_list[a-1]
    for item in current_list :
        if s_list[item-1]==0 :
            current_V.append(item)
            s_list[item-1] =a
print('Yes')
for item in s_list[1:] :
    print(item)

Fixed submission:
N,M=map(int, input().split())
a_list=[]
for i in range(M):
    a_list.append(list(map(int,input().split())))
V_list=[[] for i in range(N)]

for item in a_list :
    V_list[item[0]-1].append(item[1])
    V_list[item[1] - 1].append(item[0])

from collections import deque
s_list=[0]*N
current_V=deque()
current_V.append(1)

while (current_V!=deque([])) :
    a=current_V.popleft()
    current_list=V_list[a-1]
    for item in current_list :
        if s_list[item-1]==0 :
            current_V.append(item)
            s_list[item-1] =a
print('Yes')
for item in s_list[1:] :
    print(item)
Buggy python submission (verdict: Runtime Error):
a=input().split()
N=int(a[0])
M=int(a[1])
X=int(a[2])
list1=[]
for i in range(N) :
  k=input().split()
  k=[int(j) for j in k]
  list1.append(k)
flag1=True
def count(item,i) :
  count=0
  for a in item :
    count+=a[i]
  return count

import itertools
for i in range(1,N+1) :
  c=list(itertools.combinations(list1,i))

  value_list=[]
  for item in c :
    item1=list(item)


    if count(item,1)>=X and count(item,2)>=X and count(item,3)>=X :
      value_list.append(count(item,0))
  if value_list!=[] :
    print(min(value_list))
    flag1=False

    break
if flag1 :
  print('-1')

Fixed submission:
a=input().split()
N=int(a[0])
M=int(a[1])
X=int(a[2])
list1=[]
for i in range(N) :
  k=input().split()
  k=[int(j) for j in k]
  list1.append(k)

flag1=True
def count(item,i) :
  count1=0
  for a in item :
    count1+=a[i]
  return count1

def algo(item,i) :

  for j in range(1,i+1) :
    if count(item,j)<X :
      return False
  return True


import itertools
value_list=[]
for i in range(1,N+1) :
  c=list(itertools.combinations(list1,i))


  for item in c :
    item1=list(item)


    if algo(item1,M) :
      value_list.append(count(item1,0))

if value_list!=[] :
  print(min(value_list))
else :
  print('-1')

Buggy python submission (verdict: Runtime Error):
a=input().split()
N=int(a[0])
M=int(a[1])
X=int(a[2])
list1=[]
for i in range(N) :
  k=input().split()
  k=[int(j) for j in k]
  list1.append(k)
flag1=True
def count(item,i) :
  count=0
  for a in item :
    count+=a[i]
  return count

import itertools
import numpy as np
for i in range(1,N+1) :
  c=list(itertools.combinations(list1,i))

  value_list=[]
  for item in c :
    item1=list(item)


    if count(item,1)>=X and count(item,2)>=X and count(item,3)>=X :
      value_list.append(count(item,0))
  if value_list!=[] :
    print(min(value_list))
    flag1=False

    break
if flag1 :
  print('-1')


Fixed submission:
a=input().split()
N=int(a[0])
M=int(a[1])
X=int(a[2])
list1=[]
for i in range(N) :
  k=input().split()
  k=[int(j) for j in k]
  list1.append(k)

flag1=True
def count(item,i) :
  count1=0
  for a in item :
    count1+=a[i]
  return count1

def algo(item,i) :

  for j in range(1,i+1) :
    if count(item,j)<X :
      return False
  return True


import itertools
value_list=[]
for i in range(1,N+1) :
  c=list(itertools.combinations(list1,i))


  for item in c :
    item1=list(item)


    if algo(item1,M) :
      value_list.append(count(item1,0))

if value_list!=[] :
  print(min(value_list))
else :
  print('-1')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
n_list=input().split()
count=0
for i in range(N) :
  for j in range(i+1,N) :
    if int(n_list[j])+int(n_list[i])==j-i :
      count+=1

print(count)

Fixed submission:
import collections
N=int(input())
n_list=input().split()
count=0
L_list=[]
R_list=[]
for i,item in enumerate(n_list) :
  L_list.append(str(i+int(item)))
  R_list.append(str(i-int(item)))
L_dic=collections.Counter(L_list)
R_dic=collections.Counter(R_list)
count=0
for i in range(N) :
  L_count=L_dic[str(i)]
  R_count=R_dic[str(i)]
  count+=L_count*R_count
print(count)
Buggy python submission (verdict: Runtime Error):
a = input().split()
N = int(a[0])
M = int(a[1])
Q = int(a[2])
current = []
for i in range(Q):
    e = input().split()
    f = [int(i) for i in e]
    current.append(f)
import itertools

c = list(itertools.combinations_with_replacement(range(1, M + 1), N))
value_list = []
for item in c:
    value = 0
    for k in current :
        if item[k[1]]-item[k[0]]==k[2]:
            value+=k[3]
    value_list.append(value)
    
print(max(value_list))

Fixed submission:
a = input().split()
N = int(a[0])
M = int(a[1])
Q = int(a[2])
current = []
for i in range(Q):
    e = input().split()
    f = [int(i) for i in e]
    current.append(f)
import itertools

c = list(itertools.combinations_with_replacement(range(1, M + 1), N))
value_list = []
for item in c:
    value = 0
    for k in current :
        if item[k[1]-1]-item[k[0]-1]==k[2]:
            value+=k[3]
    value_list.append(value)

print(max(value_list))
Buggy python submission (verdict: Runtime Error):
a=int(input())
list1=[]
for i in range(a+1):
  list1.append(input())
  
print(len(list(set(list1))))

Fixed submission:
a=int(input())
list1=[]
for i in range(a):
  list1.append(input())
  
print(len(list(set(list1))))

Buggy python submission (verdict: Runtime Error):
a=int(input())
list1=[]
for i in range(a+1):
  list1.append(input())

print(len(list(set(list1))))

Fixed submission:
a=int(input())
list1=[]
for i in range(a):
  list1.append(input())
  
print(len(list(set(list1))))
Buggy python submission (verdict: Runtime Error):
a=input().split()
N=int(a[0])
M=int(a[1])
M_list=input().split()
Flag=True
item_list=[]
for item in M_list :
	item_list.append(int(item))
    
if N<sum(item_list):
	print('-1')
else :
	for item in item_list :
    	N-=item
    print(N)
	

Fixed submission:
a=input().split()
N=int(a[0])
M=int(a[1])
M_list=input().split()
Flag=True
item_list=[]
for item in M_list :
	item_list.append(int(item))
    
if N<sum(item_list):
	print('-1')
else :
	for item in item_list :
		N-=item
	print(N)
Buggy python submission (verdict: Runtime Error):
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag=True :
  print('Yes')
else :
  print('No')
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag==True :
  print('Yes')
else :
  print('No')


Fixed submission:
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    flag=False
    break
    
if flag==True :
  print('Yes')
else :
  print('No')

Buggy python submission (verdict: Runtime Error):
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    print(youso)
    flag=False
    break
    
if flag=True :
  print('Yes')
else :
  print('No')

Fixed submission:
NM=input().split()
M=int(NM[1])
a=input().split()
a_list=[]
for i in a :
  a_list.append(int(i))
a_list.sort(reverse=True)
sum1=sum(a_list)
 
flag=True
for i,youso in enumerate(a_list) :
  if(youso*4*M<sum1 and i+1<=M) :
    flag=False
    break
    
if flag==True :
  print('Yes')
else :
  print('No')
Buggy python submission (verdict: Runtime Error):
xyabc=input().split()
x=int(xyabc[0])
y=int(xyabc[1])
a=int(xyabc[2])
b=int(xyabc[3])
c=int(xyabc[4])
list1=input().split()
list2=input().split()
list3=input().split()
d=a-x+b-y
an=[]
bn=[]
cn=[]
for num in list1 :
  an.append(int(num))
for num in list2 :
  bn.append(int(num))
for num in list3 :
  cn.append(int(num))

count=0
for i in range(x) :
  k=max(an)
  count+=k
  an.pop(k)
  
for i in range(y) :
  k=max(bn)
  count+=k
  an.pop(k)
  

for i in range(d) :
  k=max(cn)
  count+=k
  an.pop(k)
  
print(count)  


Fixed submission:
xyabc=input().split()
x=int(xyabc[0])
y=int(xyabc[1])
a=int(xyabc[2])
b=int(xyabc[3])
c=int(xyabc[4])
list1=input().split()
list2=input().split()
list3=input().split()
d=a-x+b-y
an=[]
bn=[]
cn=[]
for num in list1 :
  an.append(int(num))
for num in list2 :
  bn.append(int(num))
for num in list3 :
  cn.append(int(num))
an.sort(reverse=True)
bn.sort(reverse=True)

an=an[:x]
bn=bn[:y]

for a in an :
  cn.append(a)
for b in bn :
  cn.append(b)
cn.sort(reverse=True)
count=0
for i in range(x+y) :
  count+=cn[i]

print(count)
Buggy python submission (verdict: Runtime Error):
list1=[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(list1[K])

Fixed submission:
list1=[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(list1[K-1])
Buggy python submission (verdict: Runtime Error):
import math
ABC=input().rstrip('\n').split()

A=math.sqrt(int(ABC[0]))
B=math.sqrt(int(ABC[1]))
C=math.sqrt(int(ABC[2]))
AB=math.sqrt(A*B)
if A+B<C :
    print ("Yes")
else :
    print ("No")

Fixed submission:
HW=input().rstrip('\n').split()
H=int(HW[0])
W=int(HW[1])
if H==1 or W==1 :
    print (1)
elif H%2==1 and W%2==1 :
    print (int((H*W+1)/2))
else :
    print(int(H * W / 2))
Buggy python submission (verdict: Runtime Error):
import math
ABC=input().rstrip('\n').split()

A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])

if a*a+b*b+c*c+a*b-2*a*c-2*b*c>0  :
    print ("Yes")
else :
    print ("No")

Fixed submission:
import math
ABC=input().split()
 
a=int(ABC[0])
b=int(ABC[1])
c=int(ABC[2])
 
if a*a+b*b+c*c-2*a*b-2*a*c-2*b*c>0 and a+b<c  :
    print ("Yes")
else :
    print ("No")

Buggy python submission (verdict: Runtime Error):
A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])
AB=math.sqrt(A*B)
if A+B+AB<C :
    print ("Yes")
else :
    print ("No")

Fixed submission:
import math
ABC=input().split()
 
a=int(ABC[0])
b=int(ABC[1])
c=int(ABC[2])
 
if a*a+b*b+c*c-2*a*b-2*a*c-2*b*c>0 and a+b<c  :
    print ("Yes")
else :
    print ("No")

Buggy python submission (verdict: Runtime Error):
ABC=input().split()

A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])
AB=math.sqrt(AB)
if A+B+AB<C :
    print ("Yes")
else :
    print ("No")

Fixed submission:
import math
ABC=input().split()
 
a=int(ABC[0])
b=int(ABC[1])
c=int(ABC[2])
 
if a*a+b*b+c*c-2*a*b-2*a*c-2*b*c>0 and a+b<c  :
    print ("Yes")
else :
    print ("No")
Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
list1=[]
for i in range(N) :
  list1.append(i)

variety_list=collections.Counter(list1).most_common()
key_list=variety_list.keys()
value_list=variety_list.values()
list2=[]
for i in range(len(value_list)) :
  if i==0 :
    list2.append(key_list[i])
  elif value_list[0]==value_list[i] :
    list2.append(key_list[i])
  else :
    break
    
list2.sort()
for item in list2 :
  print(list2)

Fixed submission:
import collections
N=int(input())
list1=[]
for i in range(N) :
  list1.append(input())
c=collections.Counter(list1)


key_list=list(c.keys())
value_list=list(c.values())
list2=[]

curerent=0
k=max(value_list)
for i,item in enumerate(key_list) :
  if value_list[i]==k :
    list2.append(item)
  

list2.sort()
for item in list2 :
  print(item)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
a = list(map(int, input().split()))
MOD = 10**9+7
ans = 0
for i in range(n-1):
  ans = (ans+(a[i]*sum(a[i+1:])%MOD))%MOD
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
t = sum(a)
MOD = 10**9+7
ans = 0
for i in range(n-1):
  t -= a[i]
  ans = (ans+(a[i]*t%MOD))%MOD
print(ans)

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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
t = sum(a)
MOD = 10**9+7
ans = 0
for i in range(n-1):
  t -= a[i]
  ans = (ans+(a[i]*t%MOD))%MOD
print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools

h,w,k = map(int, input().split())
c = [list(input()) for _ in range(h)]
r = []
s = 0
ans = 0
for i in c:
  s += i.count('#')
if s==k:
  print(1)
  quit()
for i in range(w):
  row = []
  for j in range(h):
    if c[j][i]=='#' and 
    row.append(c[j][i])
  r.append(row)
re = c + r
for i in range(1,len(re)):
  combs = itertools.combinations(re, i)
  for j in list(combs):
    if (s-sum(j))==k:
      ans += 1
print(ans)

Fixed submission:
h,w,k = map(int, input().split())
c = [list(input()) for _ in range(h)]
ans = 0
for pattern_h in range(2**h):
  for pattern_w in range(2**w):
    count = 0
    for i in range(h):
      for j in range(w):
        if (pattern_h>>i)&1==0 and (pattern_w>>j)&1==0:
          if c[i][j]=='#':
            count += 1
    if count == k:
      ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
ans = 1
for a in A:
  ans *= a
print(ans if ans <= 10**18 else -1)

Fixed submission:
def main():
  n = int(input())
  A = list(map(int, input().split()))
  ans = 1
  if 0 in A:
    print(0)
    return
  for a in A:
    ans *= a
    if ans > 10**18:
      print(-1)
      return
  print(ans)

main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(str, input().split()))
A = list(set(a))
ans = ["0"]*n
for ai in A:
  ans[int(ai)-1] = str(a.count(ai))
print("\n".join(ans))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = ["0"]*n
for i in range(n-1):
  ans[a[i]-1] = str(int(ans[a[i]-1])+1)
print("\n".join(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(1, n+1):
  print(a.count(i))

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


Fixed submission:
n,a,b=map(int,input().split())
#x=n//(a+b)
#y=n%(a+b)
if n%(a+b) < a: print(a*(n//(a+b))+(n%(a+b)))
else: print(a*((n//(a+b)+1)))
Buggy python submission (verdict: Runtime Error):
h,n = map(int, input().split())
magics = [tuple(map(int, input().split())) for _ in range(n)]
dp = [0]*(h+1)
for i in range(1, h+1):
  dp[i] = min(dp[i-a]+b for a,b in magics)
print(dp[h])

Fixed submission:
h,n = map(int, input().split())
magics = [tuple(map(int, input().split())) for _ in range(n)]
max_a = sorted(magics, key=lambda x: x[0], reverse=True)[0][0]
dp = [0]*(h+max_a)
for i in range(1, h+max_a):
  dp[i] = min(dp[i-a]+b for a,b in magics)
print(min(dp[h:]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input())
ans = s[0]
for i in range(1, n):
  if s[i] != s[i-1]:
    ans += s[i]
print(len(ans))


Fixed submission:
n = int(input())
s = list(input())
ans = s[0]
for i in range(1, n):
  if s[i] != s[i-1]:
    ans += s[i]
print(len(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  if i==0:
    print(str(a.index(i+1)+1), end="")
  else:
    print(' '+str(a.index(i+1)+1), end="")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for i in range(n):
  ans[a[i]-1] = i + 1
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
  ans.append(str(a.index(i+1)+1))
print(' '.join(ans))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for i in range(n):
  ans[a[i]-1] = i + 1
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
  ans.append(a.index(i+1)+1)
print(' '.join(map(str, ans)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for i in range(n):
  ans[a[i]-1] = i + 1
print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

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

for i in range(m):
  a.sort()
  a[-1]=math.floor(a[-1]/2)

print(sum(a))

Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*-1, input().split()))
heapq.heapify(a)

for i in range(m):
  m = heapq.heappop(a)
  heapq.heappush(a, (-m//2)*-1)

print(-sum(a))
Buggy python submission (verdict: Runtime Error):
num = int(input())
s = ["".join(sorted(input())) for i in range(num)]

d =dict()

for st in s:
    if st in d:
        d[st]+=1
    else:
        d[st]=1

ans=0

for i in d:
    k=d[i]
    ans+=(k*(k-1))//2

print(ans)

Fixed submission:
line = input().split()

a = int(line[0])
b = int(line[1])

print(max(a-b,a+b,a*b))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

num = int(input())
words = []

for i in range(num):
  words.append(Counter(input()))
  

def check_verify(word1,word2):
  return word1 == word2
  
  
count = 0

for i in range(len(words)):
  for j in range(i+1, len(words)):
    if check_verify(words[i],words[j]):
      count += 1
      
      
print(count)

Fixed submission:
num = int(input())
s = ["".join(sorted(input())) for i in range(num)]

d = dict()

for st in s:
    if st in d:
        d[st]+=1
    else:
        d[st]=1

ans=0

for i in d:
    k=d[i]
    ans+=(k*(k-1))//2

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

for i in range(1, n+1):
  if p[i-1] != i:
    count += 1
    
if count == 0 or count == 2:
  print("YES")
else:
  print("No")

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
count = 0

for i in range(1, n+1):
  if p[i-1] != i:
    count += 1
    
if count == 0 or count == 2:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]

for i in range(n):
  memo = a[i]
  a[i] = 0
  print(max(a))
  a[i] = memo

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]

reverse_A = sorted(A, reverse=True)
max1 = reverse_A[0]
max2 = reverse_A[1]

for a in A:
  if a == max1:
    print(max2)
  else:
    print(max1)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
s.replace(s[k], s[k].lower())
print(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: Time Limit Exceeded):
n,q = map(int, input().split())
s = input()
a = [0]*n
for i in range(n):
  a[i] = s[:i+1].count('AC')
for i in range(q):
  l,r = map(int, input().split())
  print(a[r-1]-a[l-1])

Fixed submission:
n,q = map(int, input().split())
s = input()
a = [0]*n
for i in range(n):
  if s[i-1]=="A" and s[i]=="C":
    a[i] = a[i-1]+1
  else:
    a[i] = a[i-1]
for i in range(q):
  l,r = map(int, input().split())
  print(a[r-1]-a[l-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
if n==1: print('Hello World')
else: print(a+b)

Fixed submission:
n = int(input())
if n==1:
  print('Hello World')
else:
  a = int(input())
  b = int(input())
  print(a+b)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int, input().split())
ans = []
for i in range(a,b+1):
  if i < a+k or i > b-k:
    ans.append(i)
  if i==b: ans.sort()
for i in range(len(ans)):
  print(ans[i])

Fixed submission:
a, b, k = map(int, input().split())
for i in range(k):
    if a+i <= b:
        print(a+i)
for i in range(k-1,-1,-1):
    if b-i > a+k-1:
        print(b-i)