Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N=int(input())
P= np.array([int(x) for x in input().split()])
cnt=0
for i in range(N):
  if np.amin(P[:i+1])==P[i]:
    cnt+=1
print(cnt)

Fixed submission:
N=int(input())
P=[int(x) for x in input().split()]
cnt=0
tmp=P[0]
for i in range(N):
  if P[i]<=tmp:
    cnt+=1
    tmp=P[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P= [int(x) for x in input().split()]
cnt=0
for i in range(N):
  if min(P[:i+1])==P[i]:
    cnt+=1
print(cnt)

Fixed submission:
N=int(input())
P=[int(x) for x in input().split()]
cnt=0
tmp=P[0]
for i in range(N):
  if P[i]<=tmp:
    cnt+=1
    tmp=P[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
cnt=0
for i in range(N):
  if min(P[:i+1])==P[i]:
    cnt+=1
print(cnt)

Fixed submission:
N=int(input())
P=[int(x) for x in input().split()]
cnt=0
tmp=P[0]
for i in range(N):
  if P[i]<=tmp:
    cnt+=1
    tmp=P[i]
print(cnt)
Buggy python submission (verdict: Runtime Error):
import itertools
 
N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))
nlis=[i for i in range(1,N+1)]
 
j=list(itertools.permutations(nlis))
cp=j.index(P)+1
cq=j.index(Q)+1
print(abs(cp-cq))

Fixed submission:
K,X=map(int,input().split())
if K*500>=X:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
if (b-a)%2==0:
  print(int((b-a)/2))
else:
  print(int((b-a-1)/2+1+min(n-b,a-1))

Fixed submission:
n,a,b=map(int,input().split())
if (b-a)%2==0:
  print(int((b-a)//2))
else:
  print(int((b-a-1)//2+min(n-b,a-1)+1))
Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
C=(A*B)/(math.gcd(A,B))
print(C)


  


Fixed submission:
import fractions
A,B=map(int,input().split())
C=(A*B)//(fractions.gcd(A,B))
print(C)
Buggy python submission (verdict: Runtime Error):
N=int(input())
list=[]
for i in range(1,N//2):
  if N%i==0:
    list.append(i+(N/i))
if min(list)==N:
  print(N-1)
else:
  print(int(min(list)-2))

Fixed submission:
import math
N=int(input())
tmp=N+1
for i in range(1,int(math.sqrt(N)+1)):
  if N%i==0:
    if i+(N/i)<=tmp:
      tmp=i+(N/i)
if tmp==N+1:
  print(int(N-1))
else:
  print(int(tmp-2))

Buggy python submission (verdict: Runtime Error):
N=int(input())
list=[]
for i in range(1,N//2):
  if N%i==0:
    list.append(i+(N/i))
if min(list)==N:
  print(N-1)
else:
  print(int(min(list)-2))

Fixed submission:
import math
N=int(input())
tmp=N+1
for i in range(1,int(math.sqrt(N)+1)):
  if N%i==0:
    if i+(N/i)<=tmp:
      tmp=i+(N/i)
if tmp==N+1:
  print(int(N-1))
else:
  print(int(tmp-2))
Buggy python submission (verdict: Runtime Error):
N=int(input())
St=[int(x) for x in input().split()]
num=1
out=[]
while num<=N:
  for i in range(N):
    if St[i] ==num:
      out.append(i)
      num+=1

for i in range(N):
  print(out[i]+1,end=" ")
    

Fixed submission:
N=int(input())

if N%2==0:
  print(float(0.5))

else:
  s=float(((N+1)/2)/N)
  print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
St=[int(x) for x in input().split()]
num=1
out=[]
while num<=N:
  for i in range(N):
    if St[i] ==num:
      out.append(i)
      num+=1

for i in range(N):
  print(out[i]+1,end=" ")
    

Fixed submission:
N=int(input())

if N%2==0:
  print(float(0.5))

else:
  s=float(((N+1)/2)/N)
  print(s)
Buggy python submission (verdict: Runtime Error):
S=input()
K=[]
G[]
for i in range(0,len(S),2):
  K.append(S[i])
  try:
    G.append(S[i+1])
  except:
    pass
if ('L' in K) or ('R' in G):
  print('No')
else:
  print('Yes')

Fixed submission:
S=input()
K=[]
G=[]
for i in range(0,len(S),2):
  K.append(S[i])
  try:
    G.append(S[i+1])
  except:
    pass
if ('L' in K) or ('R' in G):
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
sum=0
for i in range(len(A)):
  sum+=B[i]
  try
    if A[i]+1==A[i+1]:
      sum+=C[i]
  except:
    pass
print(sum)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
sum=0
for i in range(len(A)-1):
  sum+=B[i]
  if A[i]+1==A[i+1]:
      sum+=C[A[i]-1]
sum+=B[len(A)-1]
print(sum)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
cmt=0
while True:
  if (A-1)*cnt+1>=B:
    break
  cnt+=1
print(cnt)

Fixed submission:
A,B=map(int,input().split())
cnt=0
while True:
  if (A-1)*cnt+1>=B:
    break
  cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n=int(input())
p=[int(i) for i in input().split()]
cnt=0
for i in range(1,N-1):
  if p[i-1]<p[i] and p[i]<p[i+1]:
    cnt+=1
print(cnt)

Fixed submission:
n=int(input())
p=[int(i) for i in input().split()]
cnt=0
for i in range(1,n-1):
  if p[i-1]<p[i] and p[i]<p[i+1]:
    cnt+=1
  elif p[i-1]>p[i] and p[i]>p[i+1]:
    cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
l = list(map(int, input().split()))
for i in range(n):
    x = l[i]
    ans *= x
    # if ans > 10**18:
    #     print(-1)
    #     exit()
print(ans if ans <= 10**18 else -1)

Fixed submission:
n = int(input())
ans = 1
l = list(map(int, input().split()))
l.sort()
for i in range(n):
    x = l[i]
    ans *= x
    if ans == 0:
        print(0)
        exit()
    if ans > 10**18:
        print(-1)
        exit()
print(ans if ans <= 10**18 else -1)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a,b,n = map(int,input().split())
ans = 0
for k in range(1,int(n/b)+1+1):
    if k*b -1 <= n :
        # print(k,k*b-1,n)
        ans = max(ans, np.floor(a*(k*b-1)/b) - a * (k-1))
    else:
        # print(k,k*b-1,n)
        ans = max(ans, np.floor(a*n/b) - a*(k-1))
        # break
print(int(ans))


Fixed submission:
import numpy as np
a,b,n = map(int,input().split())
ans = 0
if b == 1:
    print(0)
    exit()
else:
    for k in range(1,int(n/b)+1+1):
        if k*b -1 <= n :
        # print(k,k*b-1,n)
            ans = max(ans, np.floor(a*(k*b-1)/b) - a * (k-1))
        else:
        # print(k,k*b-1,n)
            ans = max(ans, np.floor(a*n/b) - a*(k-1))
        # break
print(int(ans))
Buggy python submission (verdict: Runtime Error):
a - int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)
Buggy python submission (verdict: Runtime Error):
h, w, n = map(int, input().split())
from collections import defaultdict
d = defaultdict(int)
surround = [(0, 0), (1,1), (1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1)]
for _ in range(n):
    x, y  = map(int, input().split())
    x -= 1
    y -= 1
    for i in surround:
        if x + i[0] >= w or x + i[0] < 0 or y + i[1] < 0 or y + i[1] >= h:
            continue
        else:
            d[(x+i[0], y + i[1])] += 1
num = [0]*9
for key in d:
    if key[0] >= 1 and key[0] < h -1 and key[1] >= 1 and key[1] < w-1:
        num[d[key]] += 1
        
num[0] = (h-2)*(w-2) - sum(num)

for ans in num:
    print(ans)


Fixed submission:
h, w, n = map(int, input().split())
from collections import defaultdict
d = defaultdict(int)
surround = [(0, 0), (1,1), (1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1)]
for _ in range(n):
    x, y  = map(int, input().split())
    x -= 1
    y -= 1
    for i in surround:
        if x + i[0] >= h or x + i[0] < 0 or y + i[1] < 0 or y + i[1] >= w:
            continue
        else:
            d[(x+i[0], y + i[1])] += 1
num = [0]*10
for key in d:
    if key[0] >= 1 and key[0] < h -1 and key[1] >= 1 and key[1] < w-1:
        num[d[key]] += 1

num[0] = (h-2)*(w-2) - sum(num)

for ans in num:
    print(ans)

Buggy python submission (verdict: Runtime Error):
h, w, n = map(int, input().split())
from collections import defaultdict
d = defaultdict(int)
surround = [(0, 0), (1,1), (1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1)]
for _ in range(n):
    x, y  = map(int, input().split())
    x -= 1
    y -= 1
    for i in surround:
        if x + i[0] >= w or x + i[0] < 0 or y + i[1] < 0 or y + i[1] >= h:
            continue
        else:
            d[(x+i[0], y + i[1])] += 1
num = [0]*9
for key in d:
    if key[0] >= 1 and key[0] < h -1 and key[1] >= 1 and key[1] < w-1:
        num[d[key]] += 1
        
num[0] = (h-2)*(w-2) - sum(num)

for ans in num:
    print(ans)


Fixed submission:
h, w, n = map(int, input().split())
from collections import defaultdict
d = defaultdict(int)
surround = [(0, 0), (1,1), (1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1)]
for _ in range(n):
    x, y  = map(int, input().split())
    x -= 1
    y -= 1
    for i in surround:
        if x + i[0] >= h or x + i[0] < 0 or y + i[1] < 0 or y + i[1] >= w:
            continue
        else:
            d[(x+i[0], y + i[1])] += 1
num = [0]*10
for key in d:
    if key[0] >= 1 and key[0] < h -1 and key[1] >= 1 and key[1] < w-1:
        num[d[key]] += 1

num[0] = (h-2)*(w-2) - sum(num)

for ans in num:
    print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
# print(s)
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        print(i+1,i+2)
        break
    if i<=len(s)-2:
        if s[i]==s[i+2]:
            print(i+1,i+3)
            break
    if i == len(s)-3:
        print(-1,-1)

Fixed submission:
s = input()
# print(s)
flag=0
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        print(i+1,i+2)
        flag = 1
        break
    if i<len(s)-2:
        if s[i]==s[i+2]:
            print(i+1,i+3)
            flag = 1
            break
if flag ==0:
    print(-1,-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(n(n-1)/2)

Fixed submission:
n = int(input())
print(int(n*(n+1)/2))
Buggy python submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
C = [0]*n
A = [[0]*m for i in range(n)]
for i in range(n):
    b = list(map(int,input().split()))
    C[i] = b[0]
    for j in range(1,m+1):
        A[i][j-1] = b[j]
    
MAX = 100000000000
def dfs(a,c,i):
    if min(a)>=x:
        return cost
    elif i == n:
        return MAX
    total_A = [u+v for (u,v) in zip(a,A[i])]
    return min(dfs(a,c,i+1), dfs(total_A,c + C[i], i+1))

ans = dfs([0]*m,0,0)
if ans == MAX:
    print(-1)
else:
    print(ans)

Fixed submission:
n,m,x = map(int,input().split())
C = list()
A = list()
for i in range(n):
    temp = list(map(int,input().split()))
    C.append(temp[0])
    A.append(temp[1:])

maxnum = 10000000000
def dfs(a,cost,i):
    if min(a) >= x:
        return cost
    elif i == n:
        return maxnum
    
    getA = [x+y for (x,y) in zip(a,A[i])]
    
    return min(dfs(a,cost,i+1), dfs(getA,cost+C[i],i+1))

ans = dfs([0]*m,0,0)

if ans == maxnum:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,n = map(int,input().split())
import math
if n < b:
    print(int(math.floor(a*n/b) - a*np.floor(n/b)))
else:
    print(int(math.floor(a*(b-1)/b) - a*np.floor((b-1)/b)))

Fixed submission:
a,b,n = map(int,input().split())
import math
if n < b:
    print(int(math.floor(a*n/b) - a*math.floor(n/b)))
else:
    print(int(math.floor(a*(b-1)/b) - a*math.floor((b-1)/b)))
Buggy python submission (verdict: Runtime Error):
import numpy as np
x=int(input())
a=[100,101,102,103,104,105]
m=[1000000]*6
dplist = np.ones((7,x+1))*(-1)
dplist[0,0] = 0
for i in range(6):
    for j in range(x+1):
        if dplist[i,j] >= 0:
            dplist[i+1,j] = m[i]
        elif dplist[i+1,j-a[i]]<= 0:
            dplist[i+1,j] = -1
        elif j - a[i] < 0:
            dplist[i+1,j] = -1
        else:
            dplist[i+1][j] = dplist[i+1,j-a[i]] -1

if dplist[6,x] >= 0:
    print(1)
else:
    print(0)


Fixed submission:
import numpy as np
x=int(input())
if x<=99:
    print(0)
    exit()
elif x==100 or x==101 or x==102:
    print(1)
    exit()
a=[100,101,102,103,104,105]
m=[1000000]*6
dplist = np.ones((7,x+1))*(-1)
dplist[0,0] = 0
for i in range(6):
    for j in range(x+1):
        if dplist[i,j] >= 0:
            dplist[i+1,j] = m[i]
        elif dplist[i+1,j-a[i]]<= 0:
            dplist[i+1,j] = -1
        elif j - a[i] < 0:
            dplist[i+1,j] = -1
        else:
            dplist[i+1][j] = dplist[i+1,j-a[i]] -1

if dplist[6,x] >= 0:
    print(1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
c=0
if n%2 != 0:
    print('No')
    exit()
else:
    for i in range(n/2):
        if s[i]!=s[i+n/2]:
            c+=1
    if c==0:
        print('Yes')
    else:
        print('No')

Fixed submission:
n=int(input())
s=list(input())
c=0
if n%2 != 0:
    print('No')
    exit()
else:
    for i in range(n//2):
        if s[i]!=s[i+n//2]:
            c+=1
    if c==0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
c=0
for i in range(n//2):
    if s[i]!=s[i+n//2]:
        c+=1
if c==0:
    print('Yes'):
else:
    print('No')

Fixed submission:
n=int(input())
s=list(input())
c=0
if n%2 != 0:
    print('No')
    exit()
else:
    for i in range(n//2):
        if s[i]!=s[i+n//2]:
            c+=1
    if c==0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
s=list(input())
a=[0]*(len(s)+1)
if s[0]=='<':
    a[0]=0
    l=0
    while s[l]=='<':
        a[l+1]=a[l]+1
        l+=1
        if l>len(s)-1:
          break
if s[len(s)-1]=='>':
    a[len(s)]=0
    m=len(s)-1
    while s[m]=='>':
        a[m]=a[m+1]+1
        m-=1
for i in range(len(s)-1):
    if s[i]=='>' and s[i+1]=='<':
        a[i+1]=0
        k=i
        t=i+1
        while s[k]=='>':
            a[k]=a[k+1]+1
            k-=1
            if k<0 or k>len(s)-1:
                break
        while s[t]=='<':
            a[t+1]=a[t]+1
            t+=1
            if t<0 or t>len(s)-1:
                break
for i in range(len(s)-1):
    if s[i]=='<' and s[i+1]=='>':
        a[i+1]=max(a[i],a[i+2])+1
print(sum(a))

Fixed submission:
s=list(input())
a=[0]*(len(s)+1)
if s[0]=='<':
    a[0]=0
    l=0
    while s[l]=='<':
        a[l+1]=a[l]+1
        l+=1
        if l>len(s)-1:
          break
if s[len(s)-1]=='>':
    a[len(s)]=0
    m=len(s)-1
    while s[m]=='>':
        a[m]=a[m+1]+1
        m-=1
        if m<0:
          break
for i in range(len(s)-1):
    if s[i]=='>' and s[i+1]=='<':
        a[i+1]=0
        k=i
        t=i+1
        while s[k]=='>':
            a[k]=a[k+1]+1
            k-=1
            if k<0 or k>len(s)-1:
                break
        while s[t]=='<':
            a[t+1]=a[t]+1
            t+=1
            if t<0 or t>len(s)-1:
                break
for i in range(len(s)-1):
    if s[i]=='<' and s[i+1]=='>':
        a[i+1]=max(a[i],a[i+2])+1
print(sum(a))

Buggy python submission (verdict: Runtime Error):
s=list(input())
a=[0]*(len(s)+1)
if s[0]=='<':
    a[0]=0
    l=0
    while s[l]=='<':
        a[l+1]=a[l]+1
        l+=1
if s[len(s)-1]=='>':
    a[len(s)]=0
    m=len(s)-1
    while s[m]=='>':
        a[m]=a[m+1]+1
        m-=1
for i in range(len(s)-1):
    if s[i]=='>' and s[i+1]=='<':
        a[i+1]=0
        k=i
        t=i+1
        while s[k]=='>':
            a[k]=a[k+1]+1
            k-=1
            if k<0 or k>len(s)-1 or s[k]=='<':
                break
        while s[t]=='<':
            a[t+1]=a[t]+1
            t+=1
            if t<0 or t>len(s)-1 or s[t]=='>':
                break
for i in range(len(s)-1):
    if s[i]=='<' and s[i+1]=='>':
        a[i+1]=max(a[i],a[i+2])+1
print(sum(a))

Fixed submission:
s=list(input())
a=[0]*(len(s)+1)
if s[0]=='<':
    a[0]=0
    l=0
    while s[l]=='<':
        a[l+1]=a[l]+1
        l+=1
        if l>len(s)-1:
          break
if s[len(s)-1]=='>':
    a[len(s)]=0
    m=len(s)-1
    while s[m]=='>':
        a[m]=a[m+1]+1
        m-=1
        if m<0:
          break
for i in range(len(s)-1):
    if s[i]=='>' and s[i+1]=='<':
        a[i+1]=0
        k=i
        t=i+1
        while s[k]=='>':
            a[k]=a[k+1]+1
            k-=1
            if k<0 or k>len(s)-1:
                break
        while s[t]=='<':
            a[t+1]=a[t]+1
            t+=1
            if t<0 or t>len(s)-1:
                break
for i in range(len(s)-1):
    if s[i]=='<' and s[i+1]=='>':
        a[i+1]=max(a[i],a[i+2])+1
print(sum(a))
Buggy python submission (verdict: Runtime Error):
wethear = ['Sunny','Cloudy','Rainy']
print(wethear[wethear.index(str(input())) + 1])

Fixed submission:
wethear = ['Sunny','Cloudy','Rainy']
print(wethear[wethear.index(str(input())) - 2])
Buggy python submission (verdict: Runtime Error):
S=list(input())
T=list(input())
c=0
for u,v = zip(S,T):
    if u==v:
        c+=1
print(c)

Fixed submission:
S = list(input())
T = list(input())
c = 0
for _ in range(3):
    if S[_] == T[_]:
        c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(max(A+B, A-B, A*B))

Fixed submission:
#137 +-x
A = list(map(int,input().split()))
print(max(A[0]+A[1], A[0]-A[1], A[0]*A[1]))
Buggy python submission (verdict: Runtime Error):
K,X=map(int,input().split());print(for i in range(min(-1000000,X-K+1),max(1000000,X+K-1)))

Fixed submission:
K,X=map(int,input().split())
for i in range(max(-1000000,X-K+1),min(1000000,X+K-1)+1):
    print(i)
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
print((A+B)/2 if (A+B)%2 == 0)

Fixed submission:
#135  Harmony
A,B = map(int, input().split())
print((A+B)//2 if (A+B)%2 == 0 else 'IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
#135 0 or 1 Swap
N=int(input())
P=map(int,input().split())
c=0
for i in range(1,N):
    if P[i-1]>P[i]:
        c+=1
print('YES' if c==0 or c==2 else 'NO')

Fixed submission:
N=int(input())
p=list(map(int,input().split()))
q=[i for i in range(1,N+1)]
c=0
for i in range(N):
    if p[i]!=q[i]:
        c+=1
print('YES' if c==0 or c==2 else 'NO')
Buggy python submission (verdict: Runtime Error):
N,D=map(int,input().split())
c=0
X=[[0]*D]*N
for l in range(N):
    X[l]=list(map(int,input().split()))
for i in range(N-1):
    l=0
    for j in range(i+1,N):
        for k in range(D):
            l+=(X[i][k]-X[j][k])**2
        if pow(l,0.5).is_integer() == True:
            c+=1
print(c)


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

Buggy python submission (verdict: Runtime Error):
print(min(int(input())*int(input()),int(input())))

Fixed submission:
#133 T or T
N,A,B = map(int,input().split())
print(min(N*A,B))
Buggy python submission (verdict: Runtime Error):
A = list(input())
if len(set(A) == 2 & A.count(A[0]) == 2:
       print('Yes')
else:
       print('No')

Fixed submission:
#132  Fifty-Fifty
A = input()
if len(set(A)) == 2 & A.count(A[0]) == 2:
       print('Yes')
else:
       print('No')

Buggy python submission (verdict: Runtime Error):
A = input()
if len(set(A) == 2 & A.count(A[0]) == 2:
       print('Yes')
else:
       print('No')

Fixed submission:
#132  Fifty-Fifty
A = input()
if len(set(A)) == 2 & A.count(A[0]) == 2:
       print('Yes')
else:
       print('No')
Buggy python submission (verdict: Runtime Error):
A = input()
print('Bad' if A[0] == A[1] or A[1] == A[2] or A[2] == A[3] or A[3] == A[4]  else 'Good')


Fixed submission:
S=list(input())
c=0
for i in range(3):
    if S[i]==S[i+1]:
        c+=1
print('Bad' if c>0 else 'Good')

Buggy python submission (verdict: Runtime Error):
A =input()
print('Bad' if A[0] == A[1] | A[1] == A[2] | A[2] == A[3] | A[3] == A[4]  else 'Good')


Fixed submission:
S=list(input())
c=0
for i in range(3):
    if S[i]==S[i+1]:
        c+=1
print('Bad' if c>0 else 'Good')

Buggy python submission (verdict: Runtime Error):
A = inout()
print('Bad' if A[i] == A[i+1] for i in range(4) else 'Good') 

Fixed submission:
S=list(input())
c=0
for i in range(3):
    if S[i]==S[i+1]:
        c+=1
print('Bad' if c>0 else 'Good')
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=list(input())
S=S[0:K-1].append(S[K-1].lower)+S[K-1:]

Fixed submission:
N,K=map(int,input().split())
S=input()
print(S[0:K-1]+S[K-1].lower()+S[K:])
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
def dp(i):
    if i>=n-1:
        return 0
    elif i==n-2:
        return dp(i+1)+abs(h[i]-h[i+1])
    else:
        return min(dp(i+1)+abs(h[i]-h[i+1]),dp(i+2)+abs(h[i]-h[i+2]))
print(dp(0))

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
 
dp = [0]*N
dp[1] = abs(H[0] - H[1])
for i in range(2,N):
    dp[i] = min(dp[i-2] + abs(H[i-2]-H[i]), dp[i-1] + abs(H[i-1]-H[i]))
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
#Palace
N,T,A,*H = map(int,open(0).read().split())
A = [A]*N
for i in range (N):
    H[i] = abs((T-H[i]*0.006)-A[i])
print(H.index(min(H)+1)+1)


Fixed submission:
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
 
res = [abs(T-h*0.006-A) for h in H]
print(res.index(min(res))+1)

Buggy python submission (verdict: Runtime Error):
#Palace
N,T,A,*H = map(int,open(0).read().split())
A = [A]*N
for i in range (N):
    H[i] = abs((T-H[i]*0.006)-A[i])
print(H.index(min(H)+1)+1)

Fixed submission:
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
 
res = [abs(T-h*0.006-A) for h in H]
print(res.index(min(res))+1)

Buggy python submission (verdict: Runtime Error):
#Palace
N,T,A,*H = map(int,open(0).read().split())
A = [A]*N
for i in range (N):
    H[i] = abs((T-H[i]*0.006)-A[i])
print(H.index(min(H)+1)+1)

Fixed submission:
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
 
res = [abs(T-h*0.006-A) for h in H]
print(res.index(min(res))+1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
meanx = (T - A)/0.006
H = H - meanx
print(index(min(H)))

Fixed submission:
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
 
res = [abs(T-h*0.006-A) for h in H]
print(res.index(min(res))+1)
Buggy python submission (verdict: Runtime Error):
#Cakes and Donuts
n = int(input())
print('Yes' if[1 for a in range(n//7+1) for b in range(n//4+1) if a*7+b*4=n] else 'No')

Fixed submission:
n = int(input())
print("Yes" if [1 for a in range(n//7+1) for b in range(n//4+1) if a*7+b*4 == n] else "No")
Buggy python submission (verdict: Runtime Error):
X = int(input())
A = int(input())
if X % 500 <= A:
	print('Yes')
eise:
	print('No')

Fixed submission:
X = int(input())
A = int(input())
if X % 500 <= A:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
S = input()
S[0] = '2'
S[1] = '0'
S[2] = '1'
S[3] = '8'
print(for i in S) 

Fixed submission:
S = input()
print('2018' + S[4:])
Buggy python submission (verdict: Runtime Error):
#Two Anagrams
s = list(input()).sorted
t = list(input()).sorted
if s < t:
    print('Yes')
else:
    print('No')

Fixed submission:
a,b=map(int,input().split())
print((1+a+b)//2)
Buggy python submission (verdict: Runtime Error):
s = input().sorted
t = input().sorted
if s < t:
    print('Yes')
else:
    print('No')

Fixed submission:
s = list(input())
s.sort()

t = list(input())
t.sort(reverse=True)

if s < t:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
#Shift only
N = int(input())
A = list(map(int,input().split()))
count = [0]*N
for a in range(N):
    count_local = 0
    while A[a]%2 == 0:
        A[a] = A[a]/2
        count_local += 1
        if count_local >= count[a]:
            count[a] = count_local

print(min(count))

Fixed submission:
print(input().count("1"))

Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
count = 0
for a in A:
    count_local = 0
    while a%2 == 0:
        a = a/2
        count_local += 1
        if count_local <= count:
            count = count_local

print(count)

Fixed submission:
print(input().count("1"))