Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 0
ls = []
for i in range(N):
  if A[A[i]-1] == i+1:
    k = [A[i]-1,i]
    k.sort()
    if k not in ls:
      ls.append(k)
print(len(ls))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = 0
ls = []
for i in range(N):
  if A[A[i]-1] == i+1:
    ans += 1
print(ans//2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N<=K:
  print(N*X)
else:
  print(K*X)+(N-K)*Y

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N<=K:
  print(int(N*X))
else:
  print(int((K*X)+(N-K)*Y))

Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N<=K:
  print(N*X)
else:
  print(K*X)+(N-K)*Y

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N<=K:
  print(int(N*X))
else:
  print(int((K*X)+(N-K)*Y))

Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N=<K:
  print(N*X)
else:
  print(K*X)+(N-K)*Y

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N<=K:
  print(int(N*X))
else:
  print(int((K*X)+(N-K)*Y))
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(0.5*n*(n+1))

Fixed submission:
N = int(input())
print(int(0.5*N*(N+1)))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
num = 1
for i in range(a,b+1):
  num = num * i
if num>0:
  print("Positive")
elif num<0:
  pirnt("Negative")
else:
  print("Zero")

Fixed submission:
a,b = map(int,input().split())
if a == 0 or b == 0:
    print("Zero")
else:
    if 0<a<=b:
        print("Positive")
    elif a<=0<b:
        print("Zero")
    elif a<=b<0:
        if abs(a+b)%2 == 0:
            print("Negative")
        else:
            print("Positive")
Buggy python submission (verdict: Runtime Error):
A = llist(map(int,input().split()))
if (A.count(5)) == 2 and (A.count(7)) == 1:
  print("YES")
else:
  print("NO")

Fixed submission:
A = list(map(int,input().split()))
if (A.count(5)) == 2 and (A.count(7)) == 1:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
A = list(int,input().split())
if (A.count(5)) == 2 and (A.count(7)) == 1:
  print("YES")
else:
  print("NO")

Fixed submission:
A = list(map(int,input().split()))
if (A.count(5)) == 2 and (A.count(7)) == 1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
A,B,C,D = list(map(int,input().split()))
 
for num in range (A <= B):
    if num in range (C<=D):
        print("Yes")
        break
    else:
        print("No")

Fixed submission:
K = int(input())
P = str("ACL")
D = print(P*K)

Buggy python submission (verdict: Runtime Error):
A,B,C,D = list(map(int,input().split()))
for num in range (A,B+1):
    if num in range (C,D+1):
        print("Yes")
        break
else:
    print("No")
       

Fixed submission:
K = int(input())
P = str("ACL")
D = print(P*K)

Buggy python submission (verdict: Runtime Error):
A,B,C,D = list(map(int,input().split()))
for num in range (A,B+1):
    if num in range (C,D+1):
        print("Yes")
        break
else:
        print("No")
       

Fixed submission:
K = int(input())
P = str("ACL")
D = print(P*K)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
re = 1
for i in A:
    re *= i
if re > 10**18:
    print(-1)
else:
    print(re)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
if 0 in A:
    print(0)
else:
    for i in range(N):
        result *= A[i]
        if result > 10**18:
            print(-1)
            quit()
    print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = map(int, input().split())
re = 1
for i in A:
    re *= i
if re > 10**18:
    print(-1)
else:
    print(re)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
if 0 in A:
    print(0)
else:
    for i in range(N):
        result *= A[i]
        if result > 10**18:
            print(-1)
            quit()
    print(result)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
e = (c-a)*60
print(e-d)

Fixed submission:
H1, M1, H2, M2, K = map(int, input().split())
hour1 = (H1 * 60) + M1
hour2 = (H2 * 60) + M2
hour = hour2 - hour1
minute = hour - K
print(minute)
Buggy python submission (verdict: Runtime Error):
a = str(input())
b = str(input())
if a = 'chokudai' and b = 'chokudaiz' or a = 'a' and b = 'aa':
    print("Yes")
elif a = 'snuke' and b = 'snukee':
    print("No")

Fixed submission:
s = input()
t = input()
check = t[:-1]
a = len(s)
b = len(t) - 1
if a == b:
    if s == check:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
if a = 'chokudai' and b = 'chokudaiz' or a = 'a' and b = 'aa':
    print("Yes")
elif a = 'snuke' and b = 'snukee':
    print("No")

Fixed submission:
s = input()
t = input()
check = t[:-1]
a = len(s)
b = len(t) - 1
if a == b:
    if s == check:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
if a = 'chokudai' and b = 'chokudaiz' or a = 'a' and b = 'aa':
    print("Yes")
elif a = 'snuke' and b = 'snukee':
    print("No")

Fixed submission:
s = input()
t = input()
check = t[:-1]
a = len(s)
b = len(t) - 1
if a == b:
    if s == check:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
for i in range(s):
  if s[i] ='B':
    s[i] = 'R'
print("".join(s))

Fixed submission:
s = input()
if s== 'ABC':
    print("ARC")
elif s=='ARC':
    print("ABC")
else:
    pass
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
for i in range(-x,x):
  for j in range(-x,x):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()


Fixed submission:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
for i in range(-s, s):
    for j in range(-1, s):
        if i**5-j**5 == s:
            if i == abs(j)+1 or abs(j) == i+1:
                print(i, j)
                break

Fixed submission:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
for i in range(-s, s):
    for j in range(-1, s):
        if i**5-j**5 == s:
            if i == abs(j)+1 or abs(j) == i+1:
                print(i, j)
                break

Fixed submission:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
for i in range(-1, s):
    for j in range(-1, s):
        if i**5-j**5 == s:
            print(i, j) 
            break

Fixed submission:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
for i in range(-s, s):
    for j in range(-1, s):
        if i**5-j**5 == s:
            print(i, j) 
            break

Fixed submission:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Runtime Error):
s = int(input())
for i in range(-s, s):
    for j in range(-s, s):
    if i**5-j**5 == s:
        if i > j:
            print(i, j) 
            break

Fixed submission:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Runtime Error):
s = int(input())
j= -1
for i in range(-s, s):
    for j in range(-s, s):
    if i**5-j**5 == s:
        if i > j:
            print(i, -1) 
            break

Fixed submission:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Buggy python submission (verdict: Runtime Error):
s =input()
for i in range(-s, s):
  for j in range(-s, s):
    if i**5-j**5= s:
      print(i, j)
      break

Fixed submission:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()
Buggy python submission (verdict: Runtime Error):
n, len(a)= map(int, input().split())
a= list(map(int, input().split()))
c= n-sum(a)
print(c)


Fixed submission:
n,m= map(int, input().split())
a = list(map(int, input().split()))
c = n-sum(a)
if m == len(a) and c>= 0:
    print(c)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
n, len(a)= map(int, input().split())
a= list(map(int, input().split()))
c= n-sum(a)
print(c)

Fixed submission:
n,m= map(int, input().split())
a = list(map(int, input().split()))
c = n-sum(a)
if m == len(a) and c>= 0:
    print(c)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
k = input()
if k[0] == k[1] or k[1] ==k[2] or k[2]==k[0] in str(N):
    print("Yes")
else:
    print("No")
   

Fixed submission:
N = input()
if '7' in str(N):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
k = input()
if k[0] == k[1] or k[1] ==k[2] or k[2]==k[3]:
    print("Yes")
else:
    print("No")
   


Fixed submission:
N = input()
if '7' in str(N):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
k = input()
if k[0] == k[1] or k[1] ==k[2] or k[2]==k[3]:
    print("Yes")
else:
    print("No")
   


Fixed submission:
N = input()
if '7' in str(N):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
        ans = N - x
 
if ans >= M :
    print('Yes')
else:
    print('No')

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

if ans >= M :
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
        ans = N - x
 
if ans >= M :
    print('Yes')
else:
    print('No')

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

if ans >= M :
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(set((map(int, input().split()))))
vote = []
for Ai in A:
	if Ai > (1 / (4 * M) * sum(A)):
      vote.append(Ai)
if len(vote) >= M:
    print("Yes")
else:
    print("No")

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

if ans >= M :
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = str(input("Enter something:"))
    if N[3] == N[4] and N[5] == N[6]:
        print("yes")
    else:
        print("No")

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):
print yes or no"""
N = str(input("Enter something:"))
for str in N:
    if N[3] == N[4] and N[5] == N[6]:
        print("yes")
    else:
        print("No")

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):
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')

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):
"""print yes or no"""
N = str(input("Enter something:"))
for str in N:
    if N[3] == N[4] and N[5] == N[6]:
        print("yes")
    else:
        print("No")

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):
s = input(int())
print(s*s*s/27)

Fixed submission:
s = int(input())
print(s*s*s/27)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
print('YNeos'[S[:N//2]!=S[-N//2:]::2])


Fixed submission:
print(int(input())**2)
Buggy python submission (verdict: Runtime Error):
s = []
n, k = map(int, input().split())
for i in range(n):
	s.append(0)
for i in range(k):
	m = int(input())
    na = list(map(int, input().split())
    for j in na:
    	s[j - 1] = 1
         
print(s.count(0))
        

Fixed submission:
s = []
n, k = map(int, input().split())
for i in range(n):
    s.append(0)
for i in range(k):
    m = int(input())
    na = list(map(int, input().split()))
    for j in na:
        s[j - 1] = 1
         
print(s.count(0))

Buggy python submission (verdict: Runtime Error):
s = []
n, k = map(int, input().split())
for i in range(n):
  s.append(0)
for i in range(k):
	m = int(input())
    na = list(map(int, input().split())
    for j in na:
    	s[j - 1] = 1
         
print(s.count(0))
        

Fixed submission:
s = []
n, k = map(int, input().split())
for i in range(n):
    s.append(0)
for i in range(k):
    m = int(input())
    na = list(map(int, input().split()))
    for j in na:
        s[j - 1] = 1
         
print(s.count(0))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, intput().split())
print(max(0, a - 2 * b))

Fixed submission:
a, b = map(int, input().split())
print(max(0, a - 2 * b))
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()

if >= 3200:
  print(s)
else:
  print('red')

Fixed submission:
a = int(input())
s = input()
 
if a >= 3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
k, x = map(int, input().split())
for i in range(max(1, x - 3), x + 4, 1):
  preint(i)

Fixed submission:
k, x = map(int, input().split())
for i in range(x - k + 1, x + k):
  print(i, end = " ")
Buggy python submission (verdict: Time Limit Exceeded):
m, k = map(int, input().split())
if m == 1 and k == 1:
    print(-1)
elif m == 1 and k == 0:
    print("0 0 1 1")
elif 2**m > k:
    ans = str(k)
    for i in range(2**m):
        x = str(i)
        if i == k:
            continue
        ans = "{} {} {}".format(x, ans, x)
    ans = ans + " " + str(k)
    print(ans)

else:
    print(-1)


Fixed submission:
m, k = map(int, input().split())
if m == 1 and k == 1:
    print(-1)
elif m == 1 and k == 0:
    print("0 0 1 1")
elif 2**m > k:
    ans = str(k)
    y = []
    for i in range(2**m):
        if i == k:
            continue
        y.append(str(i))
    ans =  ' '.join(reversed(y)) + ' ' + ans + ' ' + ' '.join(y) + ' ' +ans
    print(ans)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
import math
n= int(input())
ans = 0
if math.sqrt(n) == int(math.sqrt(n)):
    for i in range(1,int(math.sqrt(n))):
        if (n-i) % i == 0:
            ans += (n-i) // i
else:
    for i in range(1,int(math.sqrt(n) + 1)):
        if (n-i) % i == 0:
            ans += (n-i) // i
print(ans)

Fixed submission:
n,k = map(int,input().split())
print(n-k+1)
Buggy python submission (verdict: Runtime Error):
x,y,z,k = map(int,input().split())
A,B,C= [[int(i) for i in input().split()] for j in range(3)]
AB = []
ABC = []
for i in range(x):
        for j in range(y):
                AB.append(A[i]+B[j])
AB.sort(reverse = True)
for i in range(min(k,len(AB))):
        for j in range(z):
                ABC.append(AB[i]+C[j])
ABC.sort(reverse = True)
for i in range(k):
        print(ABC[i])

Fixed submission:
x = []
for i in range(5):
        x.append(int(input()))
k = int(input())
a = x[0]
n = True
for i in x:
        b = abs(a-i)
        if b > k:
                n = False
        else:
                None
if not n:
        print(":(")
else:
        print("Yay!")
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[0]*(len(bin(max(a+[k])))-2)
ans=""
for i in range(n):
    l=len(bin(a[i])[2:])
    for j in bin(a[i])[2:]:
        b[len(bin(max(a+[k])))-l-2]+=int(j)
        l-=1
for (i,j) in enumerate(b):
    if j<(n/2) and k>=2**i:
        ans=ans+"1"
    else:
        ans=ans+"0"
x=0
ans=int(ans,2)
for i in a:
    x+=ans^i
print(x)

Fixed submission:
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
m=len(bin(max(a+[k])))-2
b=[0]*m
ans=""
x=0
a2=[bin(i)[2:] for i in a]
for i in a2:
    for j in range(-1,-len(i)-1,-1):
        b[j]+=int(i[j])
B=len(b)
for (i,j) in enumerate(b):
    if j<(n/2) and k>=2**(B-i-1):
        ans=ans+"1"
        k-=2**(B-i-1)
    else:
        ans=ans+"0"
ans=int(ans,2)
for i in a:
    x+=ans^i
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
h=[int(i) for i in input().split()]
def frog(x):
    if len(x)<=3:
        return(abs(x[0]-x[-1]))

    else:
        step1=abs(x[0]-x[1])
        step2=abs(x[0]-x[2])
        return min(step1+frog(x[1:]),step2+frog(x[2:]))

print(frog(h))


Fixed submission:
n=int(input())
h=[int(i) for i in 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[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
ans=0
N,M=[int(i) for i in input().split()]
A=input().split()
for i in range(N):
    a=0
    for j in A[i:N+1]:
        a+=int(j)%M
        if a%M==0:
            ans+=1
print(ans)



Fixed submission:
N,M = [int(i) for i in input().split()]
A = [int(j) for j in input().split()]
B = [0,A[0]]
for i in range(1,len(A)):
    B+=[A[i]+B[i]]
C = {}
X = 0
for j in B:
    if str(j%M) in C:
        X+=C[str(j%M)]
        C[str(j%M)]+=1
    else:
        C.update({str(j%M):1})
print(X)

Buggy python submission (verdict: Time Limit Exceeded):
ans=0
N,M=[int(i) for i in input().split()]
A=input().split()
for i in range(N):
    a=0
    for j in A[i:N+1]:
        a+=int(j)
        if a%M==0:
            ans+=1
print(ans)



Fixed submission:
N,M = [int(i) for i in input().split()]
A = [int(j) for j in input().split()]
B = [0,A[0]]
for i in range(1,len(A)):
    B+=[A[i]+B[i]]
C = {}
X = 0
for j in B:
    if str(j%M) in C:
        X+=C[str(j%M)]
        C[str(j%M)]+=1
    else:
        C.update({str(j%M):1})
print(X)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = map(int,input().split())
k = 1
for i in a:
    k*=i
l = 0
while k%2 == 0:
    l += 1
    k /= 2
print (l)


Fixed submission:
N = int(input())
a = map(int,input().split())
k = 0
for i in a:
    while i%2 == 0:
        k+=1
        i/=2
print(k)
Buggy python submission (verdict: Runtime Error):
a, b = [int(i) for i in input().split()]
c = b-a
d = 0
for j in range(c):
    d+=j
d-=a
print(d)

Fixed submission:
N = int(input())
if N<1000:
    print("ABC")
else:
    print("ABD")

Buggy python submission (verdict: Runtime Error):
N = input()
if N<1000:
    print("ABC")
else:
    print("ABD")  


Fixed submission:
N = int(input())
if N<1000:
    print("ABC")
else:
    print("ABD")
Buggy python submission (verdict: Runtime Error):
import sys, ast

def dfs(str_input,count = 1):
    if count == 7:
        if ast.literal_eval(str_input) == 7:
            sys.exit(str_input + "=7")
        else:
            return 0
    for i in ["+","-"]:
        dfs(str_input[:count] + i + str_input[count:], count = count + 2)

x = input()

dfs(x)

Fixed submission:
import sys, ast

def dfs(str_input,count = 1):
    if count == 7:
        if ast.literal_eval(str_input) == 7:
            print(str_input + "=7")
            sys.exit(0)
        else:
            return 0
    for i in ["+","-"]:
        dfs(str_input[:count] + i + str_input[count:], count = count + 2)

x = input()

dfs(x)

Buggy python submission (verdict: Runtime Error):
import sys, ast

def dfs(str_input,count = 1):
    if count == 7:                                                      #演算子を挿入完了
        if ast.literal_eval(str_input) == 7:
            sys.exit(str_input + "=7")
        else:       　　　　　　　　　　　　　　　　　　　　#和が7にならなかった場合は何もしない
            return 0
    for i in ["+","-"]:
        dfs(str_input[:count] + i + str_input[count:], count = count + 2)　　#演算子の挿入

x = input()

dfs(x)

Fixed submission:
import sys, ast

def dfs(str_input,count = 1):
    if count == 7:
        if ast.literal_eval(str_input) == 7:
            print(str_input + "=7")
            sys.exit(0)
        else:
            return 0
    for i in ["+","-"]:
        dfs(str_input[:count] + i + str_input[count:], count = count + 2)

x = input()

dfs(x)
Buggy python submission (verdict: Runtime Error):
a=int(input())
ans=0
for i in a:
  ans+=1
print(ans)

Fixed submission:
s=input()
ans=0
for i in s:
    ans+=int(i)
print(ans)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print((A+B)%24)

Fixed submission:
A,B=[int(i) for i in input().split()]
print((A+B)%24)
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()

for i in range(len(s)-len(t)):
    ans=10**9+7
    miss=0
    tmp=s[i:i+len(t)]
    for j in range(len(t)):
        if tmp[j]!=t[j]:
            miss+=1
    ans=min(ans, miss)

print(ans)


Fixed submission:
s=input()
t=input()

ans=10**9+7
for i in range(len(s)-len(t)+1):
    miss=0
    tmp=s[i:i+len(t)]
    for j in range(len(t)):
        if tmp[j]!=t[j]:
            miss+=1
    ans=min(ans, miss)

print(ans)
Buggy python submission (verdict: Runtime Error):
a = abs(x//d)
b = x%d

if k <= a:
    print(abs(abs(x)-k*d))

else:
    tmp = k-abs(a)
    if tmp%2 == 0:
        print(abs(x)-a*d)
    else:
        print(abs(abs(x)-(a+1)*d))


Fixed submission:
x,k,d = map(int,input().split())
#print(x,k,d)
x=abs(x)
a = x//d
b = x%d

if k <= a:
    print(abs(x-k*d))

else:
    tmp = k-a
    if tmp%2 == 0:
        print(x-a*d)
    else:
        print(abs(x-(a+1)*d))