Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
  
for j in range(101):
  for k in range(101):
    for i in range(n):
      H=abs(j-lst[i][0])+abs(k-lst[i][1])+lst[i][2]
      if H>0:
        if all(max(H-abs(j-lst[l][0])-abs(k-lst[l][1]),0)==lst[l][2] for l in range(n)):
          print(j,k,H)
          sys.exit()
        
  
  


Fixed submission:
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
  
for j in range(101):
  for k in range(101):
    for i in range(n):
      H=abs(j-lst[i][0])+abs(k-lst[i][1])+lst[i][2]
      if H>0:
        if all(max(H-abs(j-lst[l][0])-abs(k-lst[l][1]),0)==lst[l][2] for l in range(n)):
          print(j,k,H)
          sys.exit()

Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
  
for j in range(101):
  for k in range(101):
    for i in range(n):
      H=abs(j-lst[i][0])-abs(k-lst[i][1])+lst[i][2]
      if H>0:
        if all(max(H-abs(j-lst[l][0])-abs(k-lst[l][1]),0)==h[l] for l in range(n)):
          print([j,k,H])
          sys.exit()
        
  
  


Fixed submission:
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
  
for j in range(101):
  for k in range(101):
    for i in range(n):
      H=abs(j-lst[i][0])+abs(k-lst[i][1])+lst[i][2]
      if H>0:
        if all(max(H-abs(j-lst[l][0])-abs(k-lst[l][1]),0)==lst[l][2] for l in range(n)):
          print(j,k,H)
          sys.exit()

Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
def pita(a,b,c,d):
  return abs(a-b)+abs(c-d)
hm=float'inf'
for l in range(n):
  for j in range(101):
    for k in range(101):
      if lst[l][2]-pita(lst[l][0],j,lst[l][1],k)<=0:
        hm=min(hm,pita(lst[l][0],j,lst[l][1],k))
for l in range(hm+1):
  for j in range(101):
    for k in range(101):
      if lst[l][2]-pita(lst[l][0],j,lst[l][1],k)==0:
        print(j,k,lst[l][2])
        sys.exit()
        
  
  


Fixed submission:
import sys
n=int(input())
lst=[]
for i in range(n):
  x,y,h=map(int,input().split())
  lst.append([x,y,h])
  
for j in range(101):
  for k in range(101):
    for i in range(n):
      H=abs(j-lst[i][0])+abs(k-lst[i][1])+lst[i][2]
      if H>0:
        if all(max(H-abs(j-lst[l][0])-abs(k-lst[l][1]),0)==lst[l][2] for l in range(n)):
          print(j,k,H)
          sys.exit()
Buggy python submission (verdict: Runtime Error):
n=input()
m=n[0]
for i in range(len(n)-1):
  m+=n[0]
if int(n)>int(m):
  if n[0]!=9:
    a=str(int(n[0]+1))
    for j in range(len(n)-1):
      a+=str(int(n[0]+1))
    print(a)
  else:
    b=str(1)
    for k in range(len(n)):
      b+=str(1)
    print(b)
else:
  print(m)
      
      
              

Fixed submission:
n=input()
m=n[0]
for i in range(len(n)-1):
  m+=n[0]
if int(n)>int(m):
  if n[0]!=str(9):
    a=str(int(n[0])+1)
    for j in range(len(n)-1):
      a+=str(int(n[0])+1)
    print(a)
  else:
    b=str(1)
    for k in range(len(n)):
      b+=str(1)
    print(b)
else:
  print(m)
Buggy python submission (verdict: Runtime Error):
import collections,sys
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
for i in range(0,n,2):
  a.append(v[i-1])
  b.append(v[i])
c=collections.Counter(a)
d=collections.Counter(b)
C=sorted(c.items(), key=lambda x:-x[1])
D=sorted(d.items(), key=lambda x:-x[1])
A=int(C[0][0])
B=int(D[0][0])
cnt=0
if A!=B:
  for i in range(n//2):
    if a[i]!=A:
      cnt+=1
  for j in range(n//2):
    if b[j]!=B:
      cnt+=1
  print(cnt)
  sys.exit()
if A==B:
  totla=0
  A_=int(C[1][0])
  for i in range(n//2):
    if a[i]!=A_:
      totla+=1
  for j in range(n//2):
    if b[j]!=B:
      totla+=1
  totlb=0
  B_=int(D[1][0])
  for i in range(n//2):
    if a[i]!=A:
      totlb+=1
  for j in range(n//2):
    if b[j]!=B_:
      totlb+=1
  print(min(totla,totlb))
  sys.exit()
  
  
  
  
    
    
    

    





Fixed submission:
import collections,sys
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
for i in range(0,n,2):
  a.append(v[i-1])
  b.append(v[i])
c=collections.Counter(a)
d=collections.Counter(b)
C=sorted(c.items(), key=lambda x:-x[1])
D=sorted(d.items(), key=lambda x:-x[1])
A=int(C[0][0])
B=int(D[0][0])
cnt=0
if len(set(v))==1:
  print(n//2)
  sys.exit()
if A!=B:
  for i in range(n//2):
    if a[i]!=A:
      cnt+=1
  for j in range(n//2):
    if b[j]!=B:
      cnt+=1
  print(cnt)
  sys.exit()
if A==B:
  totla=0
  A_=int(C[1][0]) if len(set(a))!=1 else A
  for i in range(n//2):
    if a[i]!=A_:
      totla+=1
  for j in range(n//2):
    if b[j]!=B:
      totla+=1
  totlb=0
  B_=int(D[1][0]) if len(set(b))!=1 else B
  for i in range(n//2):
    if a[i]!=A:
      totlb+=1
  for j in range(n//2):
    if b[j]!=B_:
      totlb+=1
  print(min(totla,totlb))
  sys.exit()

Buggy python submission (verdict: Runtime Error):
import collections
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
for i in range(0,n,1):
  a.append(v[i])
  b.append(v[i+1])
c=collections.Counter(a)
d=collections.Counter(b)
C=sorted(c.items(), key=lambda x:-x[1])
D=sorted(d.items(), key=lambda x:-x[1])
A=int(C[0][0])
B=int(D[0][0])
cnt=0
for i in range(n):
  if a[i]!=A:
    cnt+=1
for j in range(n):
  if b[j]!=B:
    cnt+=1
print(cnt)

    





Fixed submission:
import collections,sys
n=int(input())
v=list(map(int,input().split()))
a=[]
b=[]
for i in range(0,n,2):
  a.append(v[i-1])
  b.append(v[i])
c=collections.Counter(a)
d=collections.Counter(b)
C=sorted(c.items(), key=lambda x:-x[1])
D=sorted(d.items(), key=lambda x:-x[1])
A=int(C[0][0])
B=int(D[0][0])
cnt=0
if len(set(v))==1:
  print(n//2)
  sys.exit()
if A!=B:
  for i in range(n//2):
    if a[i]!=A:
      cnt+=1
  for j in range(n//2):
    if b[j]!=B:
      cnt+=1
  print(cnt)
  sys.exit()
if A==B:
  totla=0
  A_=int(C[1][0]) if len(set(a))!=1 else A
  for i in range(n//2):
    if a[i]!=A_:
      totla+=1
  for j in range(n//2):
    if b[j]!=B:
      totla+=1
  totlb=0
  B_=int(D[1][0]) if len(set(b))!=1 else B
  for i in range(n//2):
    if a[i]!=A:
      totlb+=1
  for j in range(n//2):
    if b[j]!=B_:
      totlb+=1
  print(min(totla,totlb))
  sys.exit()
Buggy python submission (verdict: Runtime Error):
import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<=Y and x[i]<z for i in range(n) and y[j]>=z for j in range(m):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<=Y and x[i]<z*(-1) for i in range(n) and y[j]>=z*(-1) for j in range(m):
    print('No War')
    sys.exit()
print('War')


Fixed submission:
import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<=Y and all(x[i]<z for i in range(n)) and all(y[j]>=z for j in range(m)):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<=Y and all(x[i]<z*(-1) for i in range(n)) and all(y[j]>=z*(-1) for j in range(m)):
    print('No War')
    sys.exit()
print('War')

Buggy python submission (verdict: Runtime Error):
import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<Y and x[i]<z for i in range(n) and y[j]>=z for j in range(m):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<Y and x[i]<z*(-1) for i in range(n) and y[j]>=z*(-1) for j in range(m):
    print('No War')
    sys.exit()
print('War')


Fixed submission:
import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<=Y and all(x[i]<z for i in range(n)) and all(y[j]>=z for j in range(m)):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<=Y and all(x[i]<z*(-1) for i in range(n)) and all(y[j]>=z*(-1) for j in range(m)):
    print('No War')
    sys.exit()
print('War')
Buggy python submission (verdict: Runtime Error):
import sys
s=input()
t=input()
def hanten(*S,c1,c2):
  for i range(len(S)):
    if S[i]==c1:
      S[i]=c2
    if S[i]==c2:
      S[i]=c1
for j,k in s:
  if hanten(s,j,k)==t:
    print('Yes')
    sys.exit()
print('No')

Fixed submission:
import collections
s=input()
t=input()
cnt1=1
cnt2=1
lst1=[]
lst2=[]
for i in range(len(s)-1):
  if s[i]==s[i+1]:
    cnt1+=1
  else:
    lst1.append(cnt1)
for j in range(len(t)-1):
  if t[j]==t[j+1]:
    cnt2+=1
  else:
    lst2.append(cnt2)
S=collections.Counter(s)
T=collections.Counter(t)
S_=list(S.values())
T_=list(T.values())
S_.sort()
T_.sort()
if S_==T_ and lst1==lst2:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
w=[input() for i in range(n)]
if all(w[j][len(w[j])]==w[j+1][0] for j in range(n-1)) and len(set(w))==n:
  print('Yes')
  sys.exit()
print('No')

Fixed submission:
import sys
n=int(input())
w=[input() for i in range(n)]
if all(w[j][len(w[j])-1]==w[j+1][0] for j in range(n-1)) and len(set(w))==n:
  print('Yes')
  sys.exit()
print('No')
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
x=list(map(int,input().split()))
time=float'inf'
for i in range(n-k+1):
  l=x[i]
  r=x[i+k-1]
  time=min(time,abs(l)+r-l,abs(r)+r-l)
print(time)
  
      
  


Fixed submission:
n,k=map(int,input().split())
x=list(map(int,input().split()))
time=100000000000
for i in range(n-k+1):
  l=x[i]
  r=x[i+k-1]
  time=min(time,abs(l)+r-l,abs(r)+r-l)
print(time)
Buggy python submission (verdict: Runtime Error):
def yakusu(m):
  cnt=0
  for i in range(m//2):
    if m%i==0:
      cnt+=1
  return cnt
ans=0
n=int(input())
for j in range(1,n+1):
  if yakusu(j)==8 and n%2!=0:
    ans+=1
print(ans)
               

    

Fixed submission:
def yakusu(m):
  cnt=1
  for i in range(1,(m//2)+1):
    if m%i==0:
      cnt+=1
  return cnt
ans=0
n=int(input())
for j in range(1,n+1):
  if yakusu(j)==8 and j%2!=0:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
if s[0]!='1':
  print(s[0])
else:
  cnt=0
  for i in range(len(s)):
    if s[i]=='1':
      cnt+=1 
    else:
      idx=i
      break
  if cnt>k:
    print('1')
  else:
    print(s[idx])
    
    
  
    
    

    


Fixed submission:
s=input()
k=int(input())
if s[0]!='1':
  print(s[0])
else:
  cnt=0
  idx=0
  for i in range(len(s)):
    if s[i]=='1':
      cnt+=1 
    else:
      idx=i
      break
  if cnt>k-1:
    print('1')
  else:
    print(s[idx])
Buggy python submission (verdict: Runtime Error):
import numpy as np
n=int(input())
a=list(map(int,input().split()))
A=np.array(a)
g=np.gcd.reduce(A)
m=1
for i in range(n):
  m*=a[i]
l=m//g
print(l+1)
  


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

m=0
for i in range(n):
  m+=a[i]-1

print(m)

Buggy python submission (verdict: Runtime Error):
import numpy
n=int(input())
a=list(map(int,input().split()))
A=np.array(a)
g=np.gcd.reduce(A)
m=1
for i in range(n):
  m*=a[i]
l=m//g
print(l+1)
  


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

m=0
for i in range(n):
  m+=a[i]-1

print(m)

Buggy python submission (verdict: Runtime Error):
import fractions
n=int(input())
a=list(map(int,input().split()))
g=fractions.gcd(*a)
m=1
for i in range(n):
  m*=a[i]
l=m//g
print(l+1)
  

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

m=0
for i in range(n):
  m+=a[i]-1

print(m)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
A=[]
for i in range(n):
  A.append(a[i]-i-1)
A.sort()
b=0
c=0
ans=0
Ans=0
if n%!=0:
  b=n//2
  for i in range(n):
    ans+=abs(A[i]-b)
  print(ans)
else:
  b=n//2
  c=(n//2)-1
  for i in range(n):
    ans+=abs(A[i]-b)
    Ans+=abs(A[i]-c)
  print(min(ans,Ans))
  

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
A=[]
for i in range(n):
  A.append(a[i]-i-1)
A.sort()
b=0
c=0
ans=0
Ans=0
if n%2!=0:
  b=n//2
  for i in range(n):
    ans+=abs(A[i]-A[b])
  print(ans)
else:
  b=n//2
  c=(n//2)-1
  for i in range(n):
    ans+=abs(A[i]-A[b])
    Ans+=abs(A[i]-A[c])
  print(min(ans,Ans))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(1,x**(0.5)+1):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return list(set(lst))    
for i in range(n):
  y=yakusu(a[i])
  for j in range(len(y)):
    while y[j]%2==0:
      y[j]==y[j]//2
      m+=1
print(m)

  


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]//2
    m+=1
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(1,x**(0.5)+1):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return list(set(lst))    
for i in range(n):
  for j in range(len(yakusu(a[i]))):
    while (yakusu(a[i]))[j]%2==0:
      (yakusu(a[i]))[j]==(yakusu(a[i]))[j]//2
      m+=1
print(m)

  


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]//2
    m+=1
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(1,x**(0.5)+1):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return lst    
for i in range(n):
  for j in range(len(yakusu(a[i]))):
    while yakusu(a[i])[j]%2==0:
      yakusu(a[i])[j]==yakusu(a[i])[j]//2
      m+=1
print(m)

  


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]//2
    m+=1
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(x**(0.5)):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return lst    
for i in range(n):
  for j in range(len(yakusu(a[i]))):
    while yakusu(a[i])[j]%2==0:
      yakusu(a[i])[j]==yakusu(a[i])[j]//2
      m+=1
print(m)

  


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]//2
    m+=1
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(x**(0.5)):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return lst    
for i in range(n):
  for j in len(yakusu(a[i])):
    while yakusu(a[i])[j]%2==0:
      yakusu(a[i])[j]==yakusu(a[i])[j]//2
      m+=1
print(m)

  


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]//2
    m+=1
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=0
def yakusu(x):
  lst=[]
  for i in range(x**(0.5)):
    if x%i==0:
      lst.append(i)
      lst.append(x//i)
  return lst    
for i in range(n):
  Lst=yakusu(a[i])
  for j in len(Lst):
    while a[j]%2==0:
      a[j]==a[j]//2
      m+=1
print(m)

  


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]//2
    m+=1
print(m)
Buggy python submission (verdict: Runtime Error):
n=int(input())
S=6
N=9
lst=[]
cnt=0
for i in range(16667):
  S*=6
  N*=9
  lst.append(S)
  lst.append(N)
while n>5:
  for i in len(lst):
    if lst[i]>n:
      n-=lst[i-1]
      cnt+=1
      break
print(cnt+n)


Fixed submission:
n=int(input())
dp=[0]*100010

for i in range(1,100010):
  dp[i]=float('inf')
  
for i in range(1,100010):
  power6=1
  while power6<=i:
    dp[i]=min(dp[i-power6]+1,dp[i])
    power6*=6
  power9=1
  while power9<=i:
    dp[i]=min(dp[i-power9]+1,dp[i])
    power9*=9

print(dp[n])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
lst1=[0]*(n+2)
lst2=[0]*(n+2)
lst1[1]=abs(a[0])
lst2[1]=abs(a[n-1])
for i in range(1,n):
  lst1[i+1]=lst1[i]+abs(a[i]-a[i-1])
  lst2[i+1]=lst2[i]+abs(a[n-i]-a[n-i-1])
lst1[n+1]=lst1[n]+abs(a[n-1])
lst2[n+1]=lst2[n]+abs(a[0])
print(lst2[n-1]+abs([1]))
for i in range(1,n-1):
  print(lst1[i]+lst2[n-i]+abs(a[i+1]-a[i-1]))
print(lst1[n-1]+abs([n-2]))

 


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

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
lst1=[0]*(n+2)
lst2=[0]*(n+2)
lst1[1]=abs(a[0])
lst2[1]=abs(a[n-1])
for i in range(1,n):
  lst1[i+1]=lst1[i]+abs(a[i]-a[i-1])
  lst2[i+1]=lst2[i]+abs(a[n-i]-a[n-i-1])
lst1[n+1]=lst[n]+abs(a[n-1])
lst2[n+1]=lst[n]+abs(a[0])
for i in range(n):
  print(lst1[i]+lst2[n-i]+abs(a[min(n-1,i+1)]-a[max(0,i-1)]))

 


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
list1=[abs(a[0])]*(n+1)
list2=[abs(a[n-1])]*(n+1)
for i in range(n-1):
  list1[i+1]=list1[i]+abs(a[i+1]-a[i])
  list2[i+1]=list2[i]+abs(a[n-i-1]-a[n-i-2])
list1[n]=abs(a[n-1])
list2[n]=abs(a[0])
print(list2[n-2]+abs(a[1]))
for i in range(1,n-1):
  print(list2[n-2-i]+list1[i-1]+abs(a[i+1]-a[i-1]))
print(list1[n-2]+abs(a[n-2]))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.append(b)
a.append(c)
d=[]
cnd=a[0][0]
for i in range(n):
  for j in range(n):
    if i<j+1:
      cnd+=a[0][j]
    else:
      cnd+=a[1][j]
  d.append(cnd)
  cnd=a[0][i+1]
print(max(d))

  


Fixed submission:
n=int(input())
a=[]
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.append(b)
a.append(c)
d=[]
cnd=a[0][0]
for i in range(n):
  for j in range(n):
    if i>j:
      cnd+=a[0][j]
    else:
      cnd+=a[1][j]
  d.append(cnd)
  cnd=a[0][min(n-1,i+1)]
print(max(d))
Buggy python submission (verdict: Runtime Error):
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
      if i*10000+j*5000+(n-i-j)*1000==y:
        print(i j n-i-j)
        sys.exit()
print(-1 -1 -1)
    


Fixed submission:
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
      if i*10000+j*5000+(n-i-j)*1000==y:
        print(*[i,j,n-i-j])
        sys.exit()
print(*[-1,-1,-1])

Buggy python submission (verdict: Runtime Error):
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    for k in range(n-i-j+1):
      if i*10000+j*5000+k*1000==y:
        print(i j k)
        sys.exit()
print(-1 -1 -1)
    


Fixed submission:
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
      if i*10000+j*5000+(n-i-j)*1000==y:
        print(*[i,j,n-i-j])
        sys.exit()
print(*[-1,-1,-1])

Buggy python submission (verdict: Runtime Error):
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-j+1):
    for k in range(n-i-j+1):
      if i*10000+j*5000+k*1000==y:
        print(i j k)
        sys.exit()
print(-1 -1 -1)
    

Fixed submission:
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
      if i*10000+j*5000+(n-i-j)*1000==y:
        print(*[i,j,n-i-j])
        sys.exit()
print(*[-1,-1,-1])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=set(a)
cnt=0
for i in b:
  num=a.count(i)
  if i<=num:
    cnt+=(num-i)
  else:
    cnt+=num
print(cnt)
    


Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=set(a)
b=Counter(a)
cnt=0
for i in c:
  if i<=b[i]:
    cnt+=b[i]-i
  else:
    cnt+=b[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=set(a)
cnt=0
for i in b:
  num=a.count(i)
  if i<=num:
    cnt+=(num-i)
  else:
    cnt+=num
print(cnt)
    


Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=set(a)
b=Counter(a)
cnt=0
for i in c:
  if i<=b[i]:
    cnt+=b[i]-i
  else:
    cnt+=b[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=set(a)
cnt=0
for i in b:
  if i<=a.count(i):
    cnt+=(a.count(i)-i)
  else:
    cnt+=a.count(i)
print(cnt)
    


Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=set(a)
b=Counter(a)
cnt=0
for i in c:
  if i<=b[i]:
    cnt+=b[i]-i
  else:
    cnt+=b[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=set(a)
cnt=0
for i in b:
  if i<=a.count(i):
    cnt+=(a.count(i)-i)
  else:
    cnt+=a.count(i)
print(cnt)
    


Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=set(a)
b=Counter(a)
cnt=0
for i in c:
  if i<=b[i]:
    cnt+=b[i]-i
  else:
    cnt+=b[i]
print(cnt)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=Counter(a).values()
b.sort()
c=set(a)
num=0
for i in range(len(c)-k):
  num+=b[i]
print(num)


Fixed submission:
from collections import Counter
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=Counter(a).values()
d=list(b)
d.sort()
c=set(a)
num=0
for i in range(len(c)-k):
  num+=d[i]
print(num)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
print((1800*m+100*n)*2(**m))

Fixed submission:
n,m=map(int,input().split())
print((1800*m+100*n)*(2**m))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
from collentions import Counter
b=list(Counter(a).values())
cnt=0
for i in range(len(b)):
  if b[i]%2==0:
    cnt+=1
print(cnt)


Fixed submission:
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
from collections import Counter
b=list(Counter(a).values())
cnt=0
for i in range(len(b)):
  if b[i]%2==1:
    cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import fractions
n=int(input())
t=[]
for i in range(n):
  t.append(int(input()))
a=t[0]
for i in range(n-1):
  a=fractions.gcd(a,a[i+1])
print(a)
  

Fixed submission:
import fractions
n=int(input())
t=[]
for i in range(n):
  t.append(int(input()))
a=t[0]
for i in range(n-1):
  a=(a*t[i+1])//(fractions.gcd(a,t[i+1]))
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,m=map(int,input().split())
if abs(n-m)>1:
  print(0)
  sys.exit()
cnt=1
for i in range(1,n+1):
  cnt*=i
if n==m:
  print(2*((cnt**2)%((10**9)+7)))
if n-m==1:
  print((cnt*(cnt//n))%((10**9)+7))
if m-n==1:
  print((cnt*cnt*m)%((10**9)+7))


Fixed submission:
import sys
n,m=map(int,input().split())
num=n
mum=m
if 2<=abs(n-m):
  print(0)
  sys.exit()
if abs(n-m)==1:
  while n>1:
    num*=n-1
    n-=1
    num=num%((10**9)+7)
  while m>1:
    mum*=m-1
    m-=1
    mum=mum%((10**9)+7)
  print((num*mum)%((10**9)+7))
  sys.exit()
if abs(n-m)==0:
  while n>1:
    num*=n-1
    n-=1
    num=num%((10**9)+7)
  print((2*(num**2))%((10**9)+7))
  sys.exit()