Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m=list(map(int,input().split()))
t=np.zeros(m)
for i in range(n):
  tmp=list(map(int,input().split()))  
  for j in range(tmp[0]):
    t[tmp[j+1]-1] += 1
  
maxIndex = [i for i, x in enumerate(t) if x == max(t)]
print(len(maxIndex)

Fixed submission:
import numpy as np

n,m=list(map(int,input().split()))
t=np.zeros(m)
for i in range(n):
  tmp=list(map(int,input().split()))  
  for j in range(tmp[0]):
    t[tmp[j+1]-1] += 1
  
maxIndex = [i for i, x in enumerate(t) if x == n]
print(len(maxIndex))

Buggy python submission (verdict: Runtime Error):
n,m=list(map(int,input().split()))
t=np.zeros(m)
for i in range(n):
  tmp=list(map(int,input().split()))  
  for j in range(tmp[0]):
    t[tmp[j+1]-1] += 1
  
maxIndex = [i for i, x in enumerate(a) if x == max(tmp)]
print(len(maxIndex)

Fixed submission:
import numpy as np

n,m=list(map(int,input().split()))
t=np.zeros(m)
for i in range(n):
  tmp=list(map(int,input().split()))  
  for j in range(tmp[0]):
    t[tmp[j+1]-1] += 1
  
maxIndex = [i for i, x in enumerate(t) if x == n]
print(len(maxIndex))
Buggy python submission (verdict: Runtime Error):
a=map(int,input().split())
if a[0]!=2 and a[1]!=2:
  print("Yes")
else:
  print("No)

Fixed submission:
a=list(map(int,input().split()))
if a[0]!=2 and a[1]!=2:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
  a.append(list(map(str,input())))
  
for j in range(1,n):
  if a[j][0]!=a[j-1][-1]:
    print("No")
    break
  elif j==n-1:
    print("Yes")
    break
  for l in range(j-1):
    if a[l]==a[j]:
      print("No")
      sys.exit()
    elif j==n-1 and l==j-2:
      print("Yes")
      sys.exit()
  


Fixed submission:
import sys
n=int(input())
a=[]
for i in range(n):
  a.append(list(map(str,input())))
  
for j in range(1,n):
  if a[j][0]!=a[j-1][-1]:
    print("No")
    sys.exit()
  for l in range(j):
    if a[l]==a[j]:
      print("No")
      sys.exit()
  
print("Yes")
Buggy python submission (verdict: Runtime Error):
str=list(input())

count1=0
count2=0
if str[0]=="A":
  for i in range(len(str)-3):
    if str[i+2]=="C":
      count1 += 1
  for i in range(len(str)):
    if str[i]==str[i].capitalize():
      count2 += 1
  if count1 == 1 && count2 !=0 :
    print("AC")
  else:
    print("WA")
else:
  print("WA")
    
    
  
  

Fixed submission:
str=list(input())

count1=0
count2=0
if str[0]=="A":
  for i in range(len(str)-3):
    if str[i+2]=="C":
      count1 += 1
  for i in range(len(str)):
    if str[i]==str[i].capitalize():
      count2 += 1
  if count1 == 1 and count2 ==2 :
    print("AC")
  else:
    print("WA")
else:
  print("WA")
Buggy python submission (verdict: Runtime Error):
N=int(input())
c=input()
W=[]
R=[]
pw=0
pr=0
for i in range(N):
  if c[i]=="W":
    W+=[i]
    pw+=1

  if c[N-1-i]=="R":
    R+=[i]
    pr+=1

for i in range(200000):
    if min(len(W),len(R))==0:
        result=0
        break
    if W[i]+R[i]>=N:
        result=i
        break
print(result)
result=i


Fixed submission:
N=int(input())
c=input()
W=[]
R=[]
pw=0
pr=0
for i in range(N):
  if c[i]=="W":
    W+=[i]
    pw+=1

  if c[N-1-i]=="R":
    R+=[i]
    pr+=1

for i in range(200000):
    if min(len(W),len(R))==i:
        result=i
        break
    if W[i]+R[i]>=N:
        result=i
        break
print(result)
result=i
Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = [int(i) for i in input().split()]
result = B+1 - A
def lcm(a, b):
    return (a * b) // math.gcd(a, b)
def wareru(min_num, max_num, waru):
    return (max_num)//waru - (min_num-1)//waru
result -= wareru(A, B, C) + wareru(A, B, D) - wareru(A, B, lcm(C,D))
print(result)

Fixed submission:
import fractions
A, B, C, D = [int(i) for i in input().split()]
result = B+1 - A
def lcm(a, b):
    return (a * b) // fractions.gcd(a, b)
def wareru(min_num, max_num, waru):
    return (max_num)//waru - (min_num-1)//waru
result -= wareru(A, B, C) + wareru(A, B, D) - wareru(A, B, lcm(C,D))
print(result)
Buggy python submission (verdict: Runtime Error):
I = int(input())
A = input()
B = input()
C = input()

count = 0
for i in range(I):
  if not (A[i]==B[i]==C[i]):
    count += 1 if A[i]==B[i] or B[i]== C[i] or A[i]==C[i] else 2

print(count)

Fixed submission:
N, A, B = [int(i) for i in input().split()]

X = A if A < B else B
Y = 0 if N > A+B else A+B-N

print("{0} {1}".format(X, Y))
Buggy python submission (verdict: Runtime Error):
str = input().split()

r = int(str[0])
D = int(str[1])
x2000 = int(str[2])

for i in range(10):
  print(x2000 = (r*x2000-D))
  

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

r = int(str[0])
D = int(str[1])
x2000 = int(str[2])

for i in range(10):
  print(r*x2000-D)
  x2000 = r*x2000-D
Buggy python submission (verdict: Runtime Error):
x=input().split()

n=int(x[0])
t=int(x[1])
k=int(x[2])

print(k*ceil(20/12))

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

n=int(x[0])
t=int(x[1])
k=int(x[2])


if n%t==0: print(k*int(n/t))
else: print(k*int(n/t + 1))
Buggy python submission (verdict: Runtime Error):
N=int(input())
#5
A=sorted(map(int,input().split()))
#24 11 8 3 16
B = A.copy()

for i in range(N):
	if A[i] != 0:
		for j in range(i+1,N):
				if A[j] % A[i] == 0:
					A[j] = 0

if A[0] == B[1]:
	A[0] = 0

print(sum([1 for a in A if a != 0]))



Fixed submission:
N=int(input())
#5
A=sorted(map(int,input().split()))
#24 11 8 3 16

dp = [1]*max(A)
l = len(dp)

for a in A:
	if dp[a-1] == 1:
		dp[a-1] = 2
		for i in range(2*a, l+1, a):
			dp[i-1] = 0
	elif dp[a-1] == 2:
		dp[a-1] = 0

print(sum([1 for a in A if dp[a-1] != 0]))
Buggy python submission (verdict: Runtime Error):
A,V = map(int,input().split())
1 2
B,W = map(int,input().split())
3 1
T = int(input())
3

if V <= W:
	print("NO")
else:
	if abs((B-A))/(V-W) <= T:
		print("YES")
	else:
		print("NO")

Fixed submission:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if V <= W:
	print("NO")
else:
	if abs((B-A))/(V-W) <= T:
		print("YES")
	else:
		print("NO")

Buggy python submission (verdict: Runtime Error):
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if V <= W:
	print("NO")
else:
	if (B-A)/(W-T) <= T:
		print("YES")
	else:
		print("NO")

Fixed submission:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if V <= W:
	print("NO")
else:
	if abs((B-A))/(V-W) <= T:
		print("YES")
	else:
		print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import math
import fractions

K = int(input())
sum = 0

def gcd2(x,y,z):
    return math.gcd(math.gcd(x,y),z)

for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            sum += gcd2(i,j,k)

print(sum)





Fixed submission:
import math
import fractions

K = int(input())
sum = 0

def gcd2(x,y,z):
    return math.gcd(math.gcd(x,y),z)

for i in range(1,K+1):
    for j in range(i,K+1):
        for k in range(j,K+1):
            if (i == j == k):
                sum += gcd2(i,j,k)
            elif i != j and j != k:
                sum += gcd2(i,j,k)*6
            else:
                sum += gcd2(i,j,k)*3



print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import fractions

K = int(input())
sum = 0

def gcd(x,y,z):
    a = [x,y,z]
    ans = a[0]
    for i in range(1,len(a)):
        ans = math.gcd(ans,a[i])
    return ans

for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            sum += gcd(i,j,k)


print(sum)


"""
import fractions
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = fractions.gcd(ans, a[i])
print(ans)
"""

Fixed submission:
import math
import fractions

K = int(input())
sum = 0

def gcd2(x,y,z):
    return math.gcd(math.gcd(x,y),z)

for i in range(1,K+1):
    for j in range(i,K+1):
        for k in range(j,K+1):
            if (i == j == k):
                sum += gcd2(i,j,k)
            elif i != j and j != k:
                sum += gcd2(i,j,k)*6
            else:
                sum += gcd2(i,j,k)*3



print(sum)
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C= map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
N = list(map(int, input().split()))

R.sort(reverse=True)
G.sort(reverse=True)
N.sort(reverse=True)

R2 = R[:X]
G2 = G[:Y]

W = sorted(R2 + G2 + N, reverse=True)

print(sum(W[0:X+Y]))

Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N, X, Y = map(int, input().split())

ans = [0] * (N-1)
for i in range(1,N+1):
	for j in range(i, N+1):
		k = min(j-i, abs(X-i) + abs(Y-j) + 1)
		ans[k-1] += 1

for i in range(N):
	print(ans[i])



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

ans = [0] * (N-1)
for i in range(1,N+1):
	for j in range(i+1, N+1):
		k = min(j-i, abs(X-i) + abs(Y-j) + 1)
		ans[k-1] += 1

for i in range(N-1):
	print(ans[i])

Buggy python submission (verdict: Runtime Error):
N, X, Y = map(int, input().split())

and = [0] * (N-1)
for i in range(1,N+1):
	for j in range(i, N+1):
		k = min(j-i, abs(X-i) + abs(Y-j) + 1)
		ans[k-1] += 1

for i in range(N-1):
	print(ans[i])



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

ans = [0] * (N-1)
for i in range(1,N+1):
	for j in range(i+1, N+1):
		k = min(j-i, abs(X-i) + abs(Y-j) + 1)
		ans[k-1] += 1

for i in range(N-1):
	print(ans[i])

Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

#a = cmb(n, r)

N, X, Y = map(int, input().split())
c = cmb(N, 2)
#A = [0 for i in range(c)]
#A = [[0 for i in range(2)] for j in range(c)]
#A[0][1] = 1
A = []
#print(A)


for i in range(N):
	for j in range(N):
		if j > i:
			A.append(j-i)

for i in range(N):
	for j in range(N):
		if range(X,Y) in range(i,j):
			A[i][j] = A[i][j] - (Y-X -1)

for i in range(N):
	for j in range(N):
		print(A[i][j])

"""
for i in range(c):
	for j in range(2):
		if i > j:
			A[i][j] = i - j
"""

"""
for i in range(2):
	for j in range(c):
		if j == (i+1):
			A[i][j] = 1
"""




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

ans = [0] * (N-1)
for i in range(1,N+1):
	for j in range(i+1, N+1):
		k = min(j-i, abs(X-i) + abs(Y-j) + 1)
		ans[k-1] += 1

for i in range(N-1):
	print(ans[i])
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C= map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
N = list(map(int, input().split()))

R.sort()
G.sort()
N.sort(reverse=True)
R2 = R[-X:]
G2 = G[-Y:]

W = sorted(R2 + G2)

for i in range(C):
	if W[i] < N[i]:
		W[i] = N[i]

print(sum(W))

Fixed submission:
X,Y,A,B,C= map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
N = list(map(int, input().split()))

R.sort(reverse=True)
G.sort(reverse=True)
N.sort(reverse=True)

R2 = R[:X]
G2 = G[:Y]

W = sorted(R2 + G2 + N, reverse=True)

print(sum(W[0:X+Y]))

Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C= map(int, input().split())

#R = [0]*(10**6)
#G = [0]*(10**6)
#N = [0]*(10**6)

R = [0]*(6)
G = [0]*(6)
N = [0]*(6)
ans = []

R = list(map(int, input().split()))
G = list(map(int, input().split()))
N = list(map(int, input().split()))

R.sort()
G.sort()
N.sort(reverse=True)

#Rs = sorted(R)
#Gs = sorted(G)
#Ns = sorted(N)

R2 = R[-X:]
G2 = G[-Y:]

W = sorted(R2 + G2)

for i in range(C):
	if W[i] < N[i]:
		W[i] = N[i]



#print(R,G,N)
#print(Rs,Gs,Ns)
#print(R2,G2)
#print(W)

print(sum(W))

Fixed submission:
X,Y,A,B,C= map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
N = list(map(int, input().split()))

R.sort(reverse=True)
G.sort(reverse=True)
N.sort(reverse=True)

R2 = R[:X]
G2 = G[:Y]

W = sorted(R2 + G2 + N, reverse=True)

print(sum(W[0:X+Y]))
Buggy python submission (verdict: Runtime Error):
import math
N,M = map(int, input().split())
def combinations_count(n,r):
	return math.factorial(n) // (math.factorial(n-r)*math.factorial(r))
print(combinations_count(N,2) + combinations_count(M,2))

Fixed submission:
import math
N,M = map(int, input().split())
def combinations_count(n,r):
	if n == 0 or n == 1:
		return 0
	elif n == 2:
		return 1
	else: return math.factorial(n) // (math.factorial(n-r)*math.factorial(r))
print(combinations_count(N,2) + combinations_count(M,2))

Buggy python submission (verdict: Runtime Error):
import math
N,M = map(int, input().split())
def combinations_count(n,r):
	return math.fractorial(n) / (math.fractorial(n-r)*math.fractorial(r))
print(combinations_count(N,2) + combinations_count(M,2))

Fixed submission:
import math
N,M = map(int, input().split())
def combinations_count(n,r):
	if n == 0 or n == 1:
		return 0
	elif n == 2:
		return 1
	else: return math.factorial(n) // (math.factorial(n-r)*math.factorial(r))
print(combinations_count(N,2) + combinations_count(M,2))
Buggy python submission (verdict: Runtime Error):
S = input()
l = len(S)

S1 = S[0:(l-1)//2]
S2 = S[(l+3)//2]

def Kaibun(Str):
	return Str == Str[::-1]:

if Kaibun(S) and Kaibun(S1) and Kaibun(S2):
	print("Yes")
else:
	print("No")

Fixed submission:
def f(x):
  return x==x[::-1]
S=input()
n=(len(S)-1)//2
S1,S2=S[:n],S[n+1:]
if f(S) and f(S1) and f(S2):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
l = len(S)

S1 = S[0:(l-1)//2]
S2 = S[(l+3)//2]

def Kaibun(Str):
	return Str == Str[::-1]:

if Kaibun(S) and Kaibun(S1) and Kaibun(S2):
		print("Yes")
	else:
		print("No")

Fixed submission:
def f(x):
  return x==x[::-1]
S=input()
n=(len(S)-1)//2
S1,S2=S[:n],S[n+1:]
if f(S) and f(S1) and f(S2):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
l = len(S)

S1 = S[0:(l-1)//2]
S2 = S[(l+3)//2]

def Kaibun(Str):
	if Str == Str[::-1]:
		return True
	else:
		return False

if Kaibun(S):
	if Kaibun(S1) and Kaibun(S2):
		print("Yes")
	else:
		print("No")
else: print("No")

Fixed submission:
def f(x):
  return x==x[::-1]
S=input()
n=(len(S)-1)//2
S1,S2=S[:n],S[n+1:]
if f(S) and f(S1) and f(S2):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
l = len(S)

S1 = S[0:(l-1)//2]
S2 = S[(l+3)//2]

def Kaibun(Str):
	if Str == Str[::-1]:
		return True
	else:
		return False

if Kaibun(S) and Kaibun(S1) and Kaibun(S2):
	print("Yes")
else:
	print("No")

Fixed submission:
def f(x):
  return x==x[::-1]
S=input()
n=(len(S)-1)//2
S1,S2=S[:n],S[n+1:]
if f(S) and f(S1) and f(S2):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
l = len(S)

S1 = S[0:(l-1)//2]
S2 = S[(l+3)//2]

def Kaibun(Str):
	if Str == Str[::-1]:
		return True
	else: return False

if Kaibun(S1) and Kaibun(S2):
	print("Yes")
else: print("No")

Fixed submission:
def f(x):
  return x==x[::-1]
S=input()
n=(len(S)-1)//2
S1,S2=S[:n],S[n+1:]
if f(S) and f(S1) and f(S2):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split)
if (H + W) %2 == 0:
  print((H + W) /2)
else:
  preint((H + W -1) /2 +1)

Fixed submission:
H,W = map(int, input().split())

if H == 1 or W == 1:
  print(1)
elif (H*W)%2 == 0:
  print(int((H*W)/2))
else:
  print(int((H*W-1)/2 + 1))
Buggy python submission (verdict: Runtime Error):
N,B,R = map(int,input().split())
k = N % (B + R)
k2 = int(N / (B + R))
s = ("b"*B + "r"*R)
s1 = s[:k]
if k <= B:
	print(k2*(B) + k)
else:
	print(k2*(B) + B)


Fixed submission:
N,B,R = map(int,input().split())
k = N % (B + R)
k2 = int(N / (B + R))
#s = ("b"*B + "r"*R)

#s1 = s[:k]
if k <= B:
	print(k2*(B) + k)
else:
	print(k2*(B) + B)

Buggy python submission (verdict: Runtime Error):
N,B,R = map(int,input().split())
k = N % (B + R)
k2 = int(N / (B + R))
s = ("b"*B + "r"*R)
s1 = s[:(k)]
print(k2*(B) + s1.count("b"))


Fixed submission:
N,B,R = map(int,input().split())
k = N % (B + R)
k2 = int(N / (B + R))
#s = ("b"*B + "r"*R)

#s1 = s[:k]
if k <= B:
	print(k2*(B) + k)
else:
	print(k2*(B) + B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = [int(i) for i in input().split()]

cnt = 1
for i in range(1,N):
	if P[i] < min(P[:i]):
		cnt += 1
print(cnt)

Fixed submission:
N = int(input())
P = [int(i) for i in input().split()]

mi = 1000000
cnt = 0
for i in range(N):
	mi = min(P[i],mi)
	if P[i] <= mi:
		cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
X = input()

ans = "1"
if int(X) < 100:
	ans = "0"


if not int(X[:-2])*5 >= int(X[-2:]):
	ans = "0"

print(ans)




Fixed submission:
X = input()

ans = "1"
if int(X) < 100:
	ans = "0"
elif not int(X[:-2])*5 >= int(X[-2:]):
	ans = "0"

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

ans = float("inf")

for i in range(N):
	ans = min(ans, abs(sum(A[:i])-sum(A[i:])))

print(ans)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

l = sum(A)
ans = float("inf")
t = 0

for i in range(N-1):
	t += A[i]
	ans = min(ans,abs(l-2*t))
	#print("t,ans",t,ans)

print(ans)
Buggy python submission (verdict: Runtime Error):


from itertools import permutations
import math

n=int(input())
a=[list(map(int,input().split()))for _ in range(n)]
d = lambda x1,x2,x3,x4: ((x1-x2)**2 + (x3-x4)**4)**0.5

x = 0
for i in permutations(a):
	for j in range(n-1):
		x += d(i[j][0],i[j][1], i[j+1][0],i[j+1][1])

#for i in range(n): f*=i+1
print(x / math.factorial(N))

Fixed submission:
from itertools import permutations
from math import hypot, factorial

n=int(input())
a=[list(map(int,input().split()))for _ in range(n)]
d = lambda x1,y1,x2,y2: ((x1-x2)**2 + (y1-y2)**2)**0.5

x = 0
for i in permutations(a):
	for j in range(n-1):
		x += d(i[j][0],i[j][1], i[j+1][0],i[j+1][1])

#for i in range(n): f*=i+1
print(x / factorial(n))

Buggy python submission (verdict: Runtime Error):

from itertools import permutations

n=int(input())
a=[list(map(int,input().split()))for _ in range(n)]
d = lambda x1,x2,x3,x4: ((x1-x2)**2 + (x3-x4)**4)**0.5

x = 0
for i in permutations(a):
	for j in range(n-1):
		x += d(i[j][0],i[j][1], i[j+1][0],i[j+1][1])

#for i in range(n): f*=i+1
print(x / factorial(N))

Fixed submission:
from itertools import permutations
from math import hypot, factorial

n=int(input())
a=[list(map(int,input().split()))for _ in range(n)]
d = lambda x1,y1,x2,y2: ((x1-x2)**2 + (y1-y2)**2)**0.5

x = 0
for i in permutations(a):
	for j in range(n-1):
		x += d(i[j][0],i[j][1], i[j+1][0],i[j+1][1])

#for i in range(n): f*=i+1
print(x / factorial(n))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[list(map(int,input().split()))for _ in range(n)]
d = lambda x1,x2,x3,x4: ((x1-x2)**2 + (x3-x4)**4)**0.5

x = 0
for i in permutations(a):
	for j in range(n-1):
		x += d(i[j][0],i[j][1], i[j+1][0],i[j+1][1])

#for i in range(n): f*=i+1
print(x / factorial(N))

Fixed submission:
from itertools import permutations
from math import hypot, factorial

n=int(input())
a=[list(map(int,input().split()))for _ in range(n)]
d = lambda x1,y1,x2,y2: ((x1-x2)**2 + (y1-y2)**2)**0.5

x = 0
for i in permutations(a):
	for j in range(n-1):
		x += d(i[j][0],i[j][1], i[j+1][0],i[j+1][1])

#for i in range(n): f*=i+1
print(x / factorial(n))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

B = []

for i in range(1,N+1):
	idx = A.index(i) + 1
	#print(idx)
	B.append(idx)

print(*B)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

B = [0] * N

for i, a in enumerate(A):
	B[a-1] = i+1
print(*B)
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int, input().split())
#A = [K] * N

A = [0] * N

for i in range(Q):
	a = int(input())
	A[a-1] += 1

sum(A)

for j in range(N):
	if K - (sum(A)-A[j]) > 0:
		print("Yes")
	else:
		print("No")




Fixed submission:
N,K,Q = map(int, input().split())
#A = [K] * N

A = [0] * N

for i in range(Q):
	a = int(input())
	A[a-1] += 1

sm = sum(A)

for j in range(N):
	if K - (sm-A[j]) > 0:
		print("Yes")
	else:
		print("No")

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K,Q = map(int, input().split())
A = [K] * N

A_np = np.array(A)

for i in range(Q):
	a = int(input())
	A_np -= 1
	A_np[a-1] += 1
	#print(A_np)


for j in range(N):
	if A_np[j] > 0:
		print("Yes")
	else:
		print("No")

Fixed submission:
N,K,Q = map(int, input().split())
#A = [K] * N

A = [0] * N

for i in range(Q):
	a = int(input())
	A[a-1] += 1

sm = sum(A)

for j in range(N):
	if K - (sm-A[j]) > 0:
		print("Yes")
	else:
		print("No")

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K,Q = map(int, input().split())
A = [K] * N

A_np = np.array(A)

for i in range(Q):
	a = int(input())
	A_np -= 1
	A_np[a-1] += 1
	#print(A_np)


for j in range(N):
	if A_np[j] > 0:
		print("Yes")
	else:
		print("No")

Fixed submission:
N,K,Q = map(int, input().split())
#A = [K] * N

A = [0] * N

for i in range(Q):
	a = int(input())
	A[a-1] += 1

sm = sum(A)

for j in range(N):
	if K - (sm-A[j]) > 0:
		print("Yes")
	else:
		print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in range(1,N)]
print(N*(N-1)//2)


Fixed submission:
N = int(input())
print(N*(N-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in range(1,N)]
print(sum(A))


Fixed submission:
N = int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
#2
a = [int(i) for i in input().split()]
#3 5 2
b = [int(i) for i in input().split()]
#4 5

sm = sum(b)

for i in range(n):
	c = a.copy()
	#print(a,b)
	#ans += min(c[i],b[i])
	a[i] -= min(c[i],b[i])
	b[i] -= min(c[i],b[i])
	#print(a,b)
	#ans += min(c[i+1],b[i])
	a[i+1] -= min(c[i+1],b[i])
	b[i] -= min(c[i+1],b[i])
	
print(sm-sum(b))

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

sa = sum(a)

for i,b in enumerate(b):
	c = min(a[i],b)
	a[i] -= c
	a[i+1] -= min(a[i+1],b-c)

print(sa-sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
#A = [int(i) for i in input().split()]
A = [int(input()) for _ in range(N)]

for i in range(N):
	tmp = A[i]
	A[i] = 0
	print(max(A))
	A[i] = tmp

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

idx1, ma1 = A.index(max(A)), max(A)

tmp = A[idx1]
A[idx1] = 0
idx2, ma2 = A.index(max(A)), max(A)

A[idx1] = tmp

for i in A:
	if i == ma1:
		print(ma2)
	else:
		print(ma1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
D = [int(i) for i in input().split()]

cnt = 0


for i in range(1,max(D)+1):
	arc = []
	abc = []
	for j in range(len(D)):
		if D[j] > i:
			arc.append(D[j])
		else:
			abc.append(D[j])
		#print(abc, arc)
	if len(arc) == len(abc):
		cnt += 1

print(cnt)

Fixed submission:
N = int(input())
D = [int(i) for i in input().split()]
D.sort()
print(D[N//2] - D[N//2-1])
Buggy python submission (verdict: Runtime Error):
a = []

for i in range(N):
	S,P = input().split()
	P = int(P)
	a.append([S,-P,i])

a.sort()
for aa in a:
	print(aa[2])

Fixed submission:
N = int(input())
a = []

for i in range(N):
	S,P = input().split()
	P = int(P)
	a.append([S,-P,i])

a.sort()
for aa in a:
	print(aa[2]+1)