Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k-1:
  a=que.popleft()
  count+=1
  if a%10==1:
    que.extend([10*a+1,10*a+2])
  elif a%10==9:
    que.extend([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)



Fixed submission:
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10==9:
    que.extend([10*a+8,10*a+9])
  elif a%10==0:
    que.extend([10*a,10*a+1])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)

Buggy python submission (verdict: Runtime Error):
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10 == 1:
    que.append([10*a+1,10*a+2])
  elif a%10==9:
    que.append([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.append([b,b+1,b+2])
print(count)



Fixed submission:
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10==9:
    que.extend([10*a+8,10*a+9])
  elif a%10==0:
    que.extend([10*a,10*a+1])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)

Buggy python submission (verdict: Runtime Error):
from collections import deque
que=deque([range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft
  count+=1
  if a%10 == 1:
    que.append([10*a+1,10*a+2])
  elif a%10==9:
    que.append([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.append([b,b+1,b+2])
print(count)


Fixed submission:
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10==9:
    que.extend([10*a+8,10*a+9])
  elif a%10==0:
    que.extend([10*a,10*a+1])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)

Buggy python submission (verdict: Runtime Error):
from collections import deque
que=deque([range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft
  count+=1
  if a%10 == 1:
    que.append([10*a+1,10*a+2])
  elif a%10==9:
    que.append([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.append([b,b+1,b+2])
print(count)

Fixed submission:
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10==9:
    que.extend([10*a+8,10*a+9])
  elif a%10==0:
    que.extend([10*a,10*a+1])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)
Buggy python submission (verdict: Runtime Error):
S=input()
print("Yes" if S[2] == S[3] and S[4]=S[5] else "No")


Fixed submission:
S=input()
print("Yes" if S[2] == S[3] and S[4]==S[5] else "No")
Buggy python submission (verdict: Runtime Error):
X = input()
a=X//500
b=(X-500*a)//5
print(1000*a+5*b)

Fixed submission:
X = int(input())
a=X//500
b=(X-500*a)//5
print(1000*a+5*b)
Buggy python submission (verdict: Runtime Error):
K,N=map(int,input().split())
L=list(map(int,input().split()))
A=[]
for i in range(N-1):
  A.append(L[i+1]-L[i])
L.append(K-L[L-1]+L[0])
print(K-max(L))



Fixed submission:
K,N=map(int,input().split())
L=list(map(int,input().split()))
A=[]
for i in range(N-1):
  A.append(L[i+1]-L[i])
A.append(K-L[N-1]+L[0])
print(K-max(A))

Buggy python submission (verdict: Runtime Error):
K,N=map(int,input().split())
L=list(map(int,input.split()))
A=[]
for i in range(N-1):
  A.append(L[i+1]-L[i])
L.append(K-L[L-1]+L[0])
print(K-max(L))

Fixed submission:
K,N=map(int,input().split())
L=list(map(int,input().split()))
A=[]
for i in range(N-1):
  A.append(L[i+1]-L[i])
A.append(K-L[N-1]+L[0])
print(K-max(A))
Buggy python submission (verdict: Runtime Error):
import collections
n,x,y=map(int,input().split())
lit=[]
for i in range(1,N+1):
  for j in range(i+1,N+1):
     lit.append(min(abs(i-j),abs(x-j)+abs(y-i)+1,abs(y-j)+abs(x-i)+1))
a=lit.collections.Counter
for i in range(1,N):
  print(a[i])

Fixed submission:
import collections
N,x,y=map(int,input().split())
lit=[]
for i in range(1,N+1):
  for j in range(i+1,N+1):
     lit.append(min(abs(i-j),abs(x-j)+abs(y-i)+1,abs(y-j)+abs(x-i)+1))
a=collections.Counter(lit)
for i in range(1,N):
  print(a[i])
Buggy python submission (verdict: Runtime Error):
from collections import deque
S=deque(list(input()))
Q=int(input())
l=list(input().split() for i in range(Q))
a=0
for j in l:
  if j[0]=="1":
      a+=1
  else:
    if j[1]=="1":
        if a %2==0:
            S.appendleft(j[2])
        else:
            S.append(j[2])
    else:
        if a %2==1:
            S.appendleft(j[2])
        else:
            S.append(j[2])
        
if a%2==0:
    print("".join(S))
else:
    S=S[::-1]
    print("".join(S))
      

Fixed submission:
from collections import deque
S=deque(list(input()))
Q=int(input())
l=list(input().split() for i in range(Q))
a=0
for j in l:
  if j[0]=="1":
      a+=1
  else:
    if j[1]=="1":
        if a %2==0:
            S.appendleft(j[2])
        else:
            S.append(j[2])
    else:
        if a %2==1:
            S.appendleft(j[2])
        else:
            S.append(j[2])
        
if a%2==0:
    print("".join(S))
else:
    S.reverse()
    print("".join(S))

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
Q=int(input())
l=list(input().split() for i in range(Q))
for j in l:
  if j[0]=="1":
    S=S[::-1]
  else:
    if j[1]=="1":
      S=j[2]+S
    else:
      S=S+j[2]

print(S)
      

Fixed submission:
from collections import deque
S=deque(list(input()))
Q=int(input())
l=list(input().split() for i in range(Q))
a=0
for j in l:
  if j[0]=="1":
      a+=1
  else:
    if j[1]=="1":
        if a %2==0:
            S.appendleft(j[2])
        else:
            S.append(j[2])
    else:
        if a %2==1:
            S.appendleft(j[2])
        else:
            S.append(j[2])
        
if a%2==0:
    print("".join(S))
else:
    S.reverse()
    print("".join(S))
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
p=list(map(int,input().split()))
P=([(1+i)/2 for i in p])
count=0
l=[]
for i in range(N-K+1):
  l.append(sum(P[i:i+K]))
print(max(l)) 



Fixed submission:
N,K=map(int,input().split())
p=list(map(int,input().split()))
P=([(1+i)/2 for i in p])
count=0
S=[0]
for i in range(N):
  S.append(S[i]+P[i])

ans=[]
for i in range(N-K+1):
  ans.append(S[K+i]-S[i])
print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
H=int(input())
count=0
m=1
while H:
  if H==1:
    count+=m
  else:
    m*=2
    H=int(H/2)
print(count)
    


Fixed submission:
H=int(input())
n=0
while H!=1:
  H=int(H/2)
  n+=1
print(2**(n+1)-1)

Buggy python submission (verdict: Runtime Error):
H=input()
count=0
m=1
while H:
  if H==1:
    count+=m
  else:
    m*=2
    H=int(H/2)
print(count)
    

Fixed submission:
H=int(input())
n=0
while H!=1:
  H=int(H/2)
  n+=1
print(2**(n+1)-1)
Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if a**2*b>=2*x:
  ans=math.degrees(math.atan(2*x/(a*b**2)))
  print(90-ans)
else:
  ans=math.degrees(math.atan(a**2/(2*a*b-2*x/a)))
  print(90-ans)

Fixed submission:
a,b=map(int,input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if a**2*b>=2*x:
  ans=math.degrees(math.atan(2*x/(a*b**2)))
  print(90-ans)
else:
  ans=math.degrees(math.atan(a**2/(2*a*b-2*x/a)))
  print(90-ans)
  

Fixed submission:
import math
a,b,x=map(int,input().split())
A,B=a**2,b**2
print(math.degrees(math.asin((B/((2*x/(a*b))**2+B))**0.5) if 2*x<=a*a*b else math.acos((A/((2*(a*a*b-x)/A)**2+A))**0.5)))

Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if a**2*b>=2*x:
  ans=math.degrees(math.atan(2*x/(a*b**2)))
  print(ans)
else:
  ans=math.degrees(math.atan(a**2/(2*a*b-2*x/a)))
  print(ans)
  



Fixed submission:
import math
a,b,x=map(int,input().split())
A,B=a**2,b**2
print(math.degrees(math.asin((B/((2*x/(a*b))**2+B))**0.5) if 2*x<=a*a*b else math.acos((A/((2*(a*a*b-x)/A)**2+A))**0.5)))

Buggy python submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
if a**2*b>2*x:
  ans=math.degree(math.atan(2*x/(a*b**2)))
  print(ans)
else:
  ans=math.degree(math.atan(a**2/(2*a*b-x/a)))
  print(ans)
  

Fixed submission:
import math
a,b,x=map(int,input().split())
A,B=a**2,b**2
print(math.degrees(math.asin((B/((2*x/(a*b))**2+B))**0.5) if 2*x<=a*a*b else math.acos((A/((2*(a*a*b-x)/A)**2+A))**0.5)))
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=input()
if S[K-1]=A:
  S[K-1]=a
if S[K-1]=B:
  S[K-1]=b
else:
  S[K-1]=c
print(S)

Fixed submission:
N,K=map(int,input().split())
S=input()
print(S[:K-1]+S[K-1].lower()+S[K:N+1])
Buggy python submission (verdict: Runtime Error):
S=input()
a=int(S[:2])
b=int(S[2:])
if 1<=a<=12 and 1<=b<=12:
  print("AMBIGUOUS")
elif 1<=a<=12:
  print("MMYY")
elif 1<=B<=12:
  print("YYMM")
else:
  print("NA")


Fixed submission:
S=input()
a=int(S[:2])
b=int(S[2:])
if 1<=a<=12 and 1<=b<=12:
  print("AMBIGUOUS")
elif 1<=a<=12:
  print("MMYY")
elif 1<=b<=12:
  print("YYMM")
else:
  print("NA")
Buggy python submission (verdict: Runtime Error):
dp=[0]*N
dp[1]=abs(h[1]-h[0])
for i in range(N):
  dp[i+2]=min(dp[i+1]+abs(h[i+2]-h[i+1]),dp[i]+abs(h[i+2]-h[i]))

print(dp[N])

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

dp=[0]*N
dp[1]=abs(h[1]-h[0])
for i in range(N-2):
  dp[i+2]=min(dp[i+1]+abs(h[i+2]-h[i+1]),dp[i]+abs(h[i+2]-h[i]))

print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
a=input()
print(a[0]+str(len(s)-2)+a[-1])


Fixed submission:
a=input()
print(a[0]+str(len(a)-2)+a[-1])

Buggy python submission (verdict: Runtime Error):
a=input()
print(a[1]+str(len(s)-2)+a[-1])

Fixed submission:
a=input()
print(a[0]+str(len(a)-2)+a[-1])
Buggy python submission (verdict: Runtime Error):
x,y,z=map(int,input().split())
print('A'+y[0]+'C')

Fixed submission:
x,y,z=map(str,input().split())
print('A'+y[0]+'C')
Buggy python submission (verdict: Runtime Error):
S=input()
n=len(S)-1
ans=0
def dfs(i,f):
  if i==n:
    return sum(map(int,f.split("+")))
  return dfs(i+1,f)+dfs(i+1,f+"+"+S[i+1])
print(dfs(0,S[0])  
    


Fixed submission:
S=input()
n=len(S)
ans=0

for bit in range(1<<(n-1)):
  f=S[0]
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=S[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)

Buggy python submission (verdict: Runtime Error):
S=input()
n=len(S)-1
ans=0
dfs dfs(i,f):
  if i==n:
    return sum(map(int,f.split("+")))
  return dfs(i+1,f)+dfs(i+1,f+"+"+S[i+1])
print(def(0,S[0])  
    


Fixed submission:
S=input()
n=len(S)
ans=0

for bit in range(1<<(n-1)):
  f=S[0]
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=S[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)

Buggy python submission (verdict: Runtime Error):
S=input()
n=len(S)-1
ans=0
def dfs(i,f):
  if i==n:
    return sum(map(int,f.split("+")))
  return dfs(i+1,f)+dfs(i+1,f+"+"+S[i+1])
print(def(0,S[0])  
    


Fixed submission:
S=input()
n=len(S)
ans=0

for bit in range(1<<(n-1)):
  f=S[0]
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=S[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)

Buggy python submission (verdict: Runtime Error):
S=input()
n=len(S)
ans=0
f=S[0]
for bit in range(1<<(n-1)):
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=s[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)

      	
  


Fixed submission:
S=input()
n=len(S)
ans=0

for bit in range(1<<(n-1)):
  f=S[0]
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=S[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)

Buggy python submission (verdict: Runtime Error):
S=input()
n=len(S)-1
ans=0
f=S[0]
for bit in range(1<<(n-1)):
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=s[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)

      	
  

Fixed submission:
S=input()
n=len(S)
ans=0

for bit in range(1<<(n-1)):
  f=S[0]
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=S[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

def main():

	N = int(input())
	
	d = {}
	for i in range(N):
		A = int(input())
		d[A] = 0
	print(len(d))
	
if __name__ == "__main__":
    main()

Fixed submission:
import sys

def main():

	N = int(input())
	
	d = {}
	for i in range(N):
		A = input()
		d[A] = 0
	print(len(d))
	
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys

def main():

	p = 0

	args = sys.argv
	n = int(args[1])
	
	print((int(n/2) + n%2 )/n)

if __name__ == "__main__":
    main()

Fixed submission:
import sys

def main():

	p = 0

	args = sys.argv
	n = int(input())
	
	print((int(n/2) + n%2 )/n)

if __name__ == "__main__":
    main()

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

	p = 0

	args = sys.argv
	n = int(args[1])
	for i in range(1, n+1):
		if i % 2 == 1:
			p = p + 1
	
	print(p/n)

Fixed submission:
import sys

def main():

	p = 0

	args = sys.argv
	n = int(input())
	
	print((int(n/2) + n%2 )/n)

if __name__ == "__main__":
    main()

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

def main():

	p = 0

	args = sys.argv
	n = int(args[1])
	for i in range(1, n+1):
		if i % 2 == 1:
			p = p + 1
	
	print(p/n)

if __name__ == "__main__":
    main()

Fixed submission:
import sys

def main():

	p = 0

	args = sys.argv
	n = int(input())
	
	print((int(n/2) + n%2 )/n)

if __name__ == "__main__":
    main()

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

def main():

	p = 0

	args = sys.argv
	n = int(args[1])
	for i in range(1, n):
		if i % 2 == 1:
			p = p + 1
	
	print(p/n)

if __name__ == "__main__":
    main()

Fixed submission:
import sys

def main():

	p = 0

	args = sys.argv
	n = int(input())
	
	print((int(n/2) + n%2 )/n)

if __name__ == "__main__":
    main()

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

def main():

	p = 0

	args = sys.argv
	n = int(args[1])
	for i in range(1, n):
		if i % 2 == 1:
			p = p + 1
	
	print(p/n)

if __name__ == "__main__":
    main()

Fixed submission:
import sys

def main():

	p = 0

	args = sys.argv
	n = int(input())
	
	print((int(n/2) + n%2 )/n)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
K = input()

kisu = K/2
gusu = (K+1)/2

print(kisu * gusu)

Fixed submission:
K = input()

gusu = int(int(K) / 2)
kisu = int((int(K)+1) / 2)

print(int(kisu * gusu))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split()) 
if (a * b) / 2 %= 0:
  print("Even")
else:
  print("Odd")

  

Fixed submission:
a,b=map(int,input().split())
if a*b%2==0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
a = input()
print(a.count('1')


Fixed submission:
a = input()
print(a.count('1'))

Buggy python submission (verdict: Runtime Error):
a = list(input())
print(a.count('1')


Fixed submission:
a = input()
print(a.count('1'))
Buggy python submission (verdict: Runtime Error):
n = int(input())
li = list(map(int, input().split())
b = float('inf')

for a in li:
    c = 0
	while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)
          


Fixed submission:
n = int(input())
li = list(map(int, input().split()))
b = float('inf')
for a in li:
    c = 0
    while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
li = list(map(int, input().split())
b = float()

for a in li:
    c = 0
	while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)
          

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
b = float('inf')
for a in li:
    c = 0
    while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
li = list(map(int, input().split())
b = float('inf')

for a in li:
          c = 0
	while a%2 == 0:
          a = a/2
          c += 1
          b = min(b,c)
print(b)
     

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
b = float('inf')
for a in li:
    c = 0
    while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
li = list(map(int, input().split())
b = float()

for a in li:
          c = 0
	while a%2 == 0:
          a = a/2
          c += 1
          b = min(b,c)
    print(b)

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
b = float('inf')
for a in li:
    c = 0
    while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

X=int(input())

400 <= X <=1999

if (400<= X <= 599):
    print("8")
elif (600<= X <=799):
    print("7")
elif(800<= X <=999):
    print("6")
elif(1000<= X <＝1199):
    print("5")    
elif(1200<= X <=1399):
    print("4")   
elif(1400<= X <=1599):
    print("3")   
elif(1600<= X <=1799):
    print("2")   
elif(1800<= X <=1999):
    print("1")   

Fixed submission:
# -*- coding: utf-8 -*-

X=int(input())

400 <= X <=1999

if (400<= X <= 599):
    print("8")
elif (600<= X <=799):
    print("7")
elif(800<= X <=999):
    print("6")
elif(1000<= X <=1199):
    print("5")    
elif(1200<= X <=1399):
    print("4")   
elif(1400<= X <=1599):
    print("3")   
elif(1600<= X <=1799):
    print("2")
elif(1800<= X <=1999):
    print("1")
Buggy python submission (verdict: Runtime Error):
 = input()
flag = True
for i in range((len(s)-1)//2):
	if s[i] == s[len(s)-i-1]:
		continue
	else:
		flag = False
		break

if flag:
	left = s[:(len(s)-1)//2]
	right = s[(len(s)+3)//2-1:]
	if left == right:
		print("Yes")
	else:
		print("No")
else:
	print("No")


Fixed submission:
s= input()
flag = True
for i in range((len(s)-1)//2):
	if s[i] == s[len(s)-i-1]:
		continue
	else:
		flag = False
		break

if flag:
	left = s[:(len(s)-1)//2]
	right = s[(len(s)+3)//2-1:]
	if left == right:
		print("Yes")
	else:
		print("No")
else:
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
INF=float("inf")

H,W=map(int,readline().split())
Ch,Cw=map(int,readline().split())
Dh,Dw=map(int,readline().split())
Ch-=1
Cw-=1
Dh-=1
Dw-=1
maze=list(map(str,read().rstrip().decode().split()))

path=[[INF]*W for _ in range(H)]
walk=[(1,0),(0,-1),(-1,0),(0,1)]
warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if not (i, j) in [(0, 0)] + walk]

q = deque()
path[Ch][Cw] = 0
q.append((Ch, Cw, 0))

while q:
    x, y, s = q.popleft()
    for dx, dy in walk:
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s:
            path[nx][ny] = s
            q.appendleft((nx, ny, s)) 
    for dx, dy in warp: 
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s + 1:
            path[nx][ny] = s + 1
            q.append((nx, ny, s + 1)) 
    
ans = path[Dh][Dw] if path[Dh][Dw] < INF else '-1'
print(ans)

Fixed submission:
from collections import deque
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
INF=float("inf")

H,W=map(int,readline().split())
Ch,Cw=map(lambda x: int(x) - 1, readline().split())
Dh,Dw=map(lambda x: int(x) - 1, readline().split())
maze=list(map(str,read().rstrip().decode().split()))

path=[[INF]*W for _ in range(H)]
walk=[(1,0),(0,-1),(-1,0),(0,1)]
warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if not (i, j) in [(0, 0)] + walk]

q = deque()
path[Ch][Cw] = 0
q.append((Ch, Cw, 0))

while q:
    x, y, s = q.popleft()
    for dx, dy in walk:
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s:
            path[nx][ny] = s
            q.appendleft((nx, ny, s)) 
    for dx, dy in warp: 
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s + 1:
            path[nx][ny] = s + 1
            q.append((nx, ny, s + 1)) 
    
ans = path[Dh][Dw] if path[Dh][Dw] < INF else '-1'
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split(" "))
print(a*(b*100)/100)

Fixed submission:
a,b=map(int,input().replace('.', '').split())
print(a*b//100)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split(""))
print(a*(b*100)/100)

Fixed submission:
a,b=map(int,input().replace('.', '').split())
print(a*b//100)
Buggy python submission (verdict: Runtime Error):
import bisect
import os
 
X=int(input())
hist = []
for a in range(100000):
    hist.append(a ** 5)
    i = bisect.bisect_left(hist, a ** 5 - X)
    if hist[i] == a ** 5 - X:
        print(a, i)
        break
    i = bisect.bisect_left(hist, X - a ** 5)
    if hist[i] == X - a ** 5:
        print(a, -i)
        break

Fixed submission:
import math
x=int(input())
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i**5-j**5==x:
            print(i,j,sep=" ")
            exit()
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())

lis = [i for i in range(1,10)]
for _ in range(k-1):
    x=lis.pop(0)
    if x%10!=0:
        lis.append(10*x+(x%10)-1)
    lis.append(10*x+(x%10))
    if x%10!=9:
        lis.append(10*x+(x%10)+1)
print(lis.pop(0))

Fixed submission:
from collections import deque
k=int(input())

lis = deque([i for i in range(1,10)])
for _ in range(k-1):
    x=lis.popleft()
    if x%10!=0:
        lis.append(10*x+(x%10)-1)
    lis.append(10*x+(x%10))
    if x%10!=9:
        lis.append(10*x+(x%10)+1)
print(lis.popleft())
Buggy python submission (verdict: Runtime Error):
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
n,m = map(int,input().split())
if n<1 and m<1:
    print(0)
elif n<1:
    print(combinations_count(m,2))
elif m<1:
    print(combinations_count(n,2))
else:
    print(combinations_count(n,2)+combinations_count(m,2))

Fixed submission:
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
n,m = map(int,input().split())
if n<2 and m<2:
    print(0)
elif n<2:
    print(combinations_count(m,2))
elif m<2:
    print(combinations_count(n,2))
else:
    print(combinations_count(n,2)+combinations_count(m,2))
Buggy python submission (verdict: Runtime Error):
def gcd(n,m):
  if n>m:
    return gcd(m,n);
  if n==0:
    return m;
  return gcd(m-n*(m//n),n)
 
def lcm(x, y):
    return (x * y) // gcd(x, y)
  
n=int(input())
a=list(map(int,input().split()))
s=1
for i in a:
  s=lcm(s,i)
ans=0
for i in a:
  ans+=s//i
  ans % 1000000007
print(ans)

Fixed submission:
x,y = map(int,input().split())
print("Yes") if x == y else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = list(map(int, input().split()))
ans = 0
for i in range(len(lis)):
    if min(lis[:i+1]) == lis[i]:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
lis = list(map(int, input().split()))
ans = 0
minl = lis[0]
for i in lis:
    if minl >= i:
        minl = i
        ans += 1
print(ans)

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

Fixed submission:
n = int(input())
lis = list(map(int, input().split()))
ans = 0
minl = lis[0]
for i in lis:
    if minl >= i:
        minl = i
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
x = int(input())
if x == 2:
    print(2)
    sys.exit()
prime = [2]
for i in range(3, 1000000, 2):
    all(i % p != 0 for p in prime) and prime.append(i)
    if i >= x and i in prime:
        print(i)
        sys.exit()

Fixed submission:
import sys
x = int(input())
if x == 2:
    print(2)
    sys.exit()
prime = [2]
for i in range(3, 1000000, 2):
    all(i % p != 0 for p in prime) and prime.append(i)
    if i >= x and i in prime:
        print(i)
        sys.exit()