Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#83b
n,a,b=map(int,input().split())
n=[str(i) for i in range(1,n+1)]
ans=0

for i in n:
    temp=[int(x) for x in list(str(i)) ]
    temp=sum(temp)
    if a<=temp<=b:
        ans+=i

print(ans)


Fixed submission:
#83b
n,a,b=map(int,input().split())
n=[str(i) for i in range(1,n+1)]
ans=0

for i in n:
    temp=[int(x) for x in list(str(i)) ]
    temp=sum(temp)
    if a<=temp<=b:
        ans+=int(i)

print(ans)
Buggy python submission (verdict: Runtime Error):
#82b
s=sorted(list(input()))
t=sorted(list(input()))

ss=''.join(s)
tt=''.join(t)

ans=sorted([tt,ss])

if ss==tt:
    print('No')
else:
    print(['No','Yes'][ans[0]==ss])

Fixed submission:
#82a
import math
a,b=map(int,input().split())
print(math.ceil((a+b)/2))
Buggy python submission (verdict: Runtime Error):
#79a
n=input().split()
if n[0]==n[1] and n[1]==n[2] :
    print('Yes')
elif n[1]==n[2] and n[2]==n[3] :
    print('Yes')
else:
    print('No')

Fixed submission:
#79a
n=input()
if n[0]==n[1] and n[1]==n[2] :
    print('Yes')
elif n[1]==n[2] and n[2]==n[3] :
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
#74b
n = int(input())
k = int(input())
x = list(map(int,input().split()))
ans=0

for i in range(n):
    ans+=min(2*x[i],2*(k-x[i])

print(ans)

Fixed submission:
#74b
n = int(input())
k = int(input())
x = list(map(int,input().split()))
ans=0
for i in range(n):
    ans+=min(2*x[i],2*(k-x[i]))
print(ans)
Buggy python submission (verdict: Runtime Error):
#71a
x,a,b = map(int,input().split())
print('A' if abs(x-a)<(x-c) else 'B')

Fixed submission:
#71a
x,a,b = map(int,input().split())
print('A' if abs(x-a)<abs(x-b) else 'B')

Buggy python submission (verdict: Runtime Error):
#71a
x,a,b=map(int,input().split())
print('A' if abs(x-a)<(x-c) else 'B')

Fixed submission:
#71a
x,a,b = map(int,input().split())
print('A' if abs(x-a)<abs(x-b) else 'B')
Buggy python submission (verdict: Runtime Error):
#68a
n=input()
pritn('ABC'+n)

Fixed submission:
#68a
n=input()
print('ABC'+ n )
Buggy python submission (verdict: Runtime Error):
#60b
a,b,c =map(int,input().split())
i=0
aa=a
while i<b:
    i+=1
    if aa%b == c:
        print('YES')
        exit()
    aa+=a
print('NO')

Fixed submission:
#60a
a,b,c = input().split()
if a[-1]==b[0] and b[-1]==c[0]:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
#60b
a,b,c =map(int,input().split())
i=0
aa=a
while i<b:
    if aa%b == c:
        print('YES')
        exit()
    aa+=a
print('NO')

Fixed submission:
A,B,C = map(int,input().split())
i =0
AA = A
while i <B:
    i+=1
    if AA%B ==C:
        print('YES')
        exit()
    AA += A
print('NO')
Buggy python submission (verdict: Runtime Error):
#58b
o = input()
e = input()
ans=[]
for i in range(len(o)):
    ans.append(o[i]+e[i])
print(''.join(ans))

Fixed submission:
#58b
o = input()
e = input()
ans=[]
for i,j in zip(o,e):
    ans.append(i+j)
    
if len(o)>len(e):
    ans.append(o[-1])

print(''.join(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
p=1

for i in range(1,n+1):
    p*=i

print(a%(10**9+7))

Fixed submission:
#55a
n = int(input())
x = 800*n
y = (n//15)*200
print(x-y)
Buggy python submission (verdict: Runtime Error):
#55b
n = int(input())
p=1

for i in range(1,n+1):
    p = p*i

print(a%(10**9+7))

Fixed submission:
#55b
n = int(input())
p=1

for i in range(1,n+1):
    p = i*p%(10**9+7)

print(p)

Buggy python submission (verdict: Runtime Error):
#55b
n=int(input())
p=1
for i in range(1,n+1):
    p = p*i
print(a%(10**9+7))

Fixed submission:
#55b
n = int(input())
p=1

for i in range(1,n+1):
    p = i*p%(10**9+7)

print(p)
Buggy python submission (verdict: Runtime Error):
#54b
n,m =map(int,input().split())
a=[input() for _ in range(n)]
b=[input() for _ in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        t = [k[j:j+m] for k in a[i:i+m]]
        if t==b:
            print('Yes')
            exit()
print('No')

Fixed submission:
#54a
a,b =map(int,input().split())
if a==b:
    print('Draw')
elif a==1 :
    print('Alice')
elif b==1:
    print('Bob') 
elif a>b:
    print('Alice')
else :
    print('Bob')
Buggy python submission (verdict: Runtime Error):
#52b
n = int(input())
s = input()
ans = [0]

for i in s:
    if s[i]=='I':
        ans.append(ans[-1]+1)
    else:
        ans.append(ans[-1]-1)

print(max(ans))


Fixed submission:
#52b
n = int(input())
s = input()
ans = [0]

for i in s:
    if i=='I':
        ans.append(ans[-1]+1)
    else:
        ans.append(ans[-1]-1)
#print(ans)

print(max(ans))
Buggy python submission (verdict: Runtime Error):
#50b
#n　問題数
n = int(input())
#t 時間
t = [int(i) for i in input().split()]
#m ドリンクの種類
m = int(input())
ans = []
for i in range(m):
    a,b = map(int,input().split())
    temp = sum(t) - t[a-1] + b
    ans[i] = temp
for i in range(m):
    print(ans[i])

Fixed submission:
#50b
#n　問題数
n = int(input())
#t 時間
t = [int(i) for i in input().split()]
#m ドリンクの種類
m = int(input())
ans = []

for i in range(m):
    a,b = map(int,input().split())
    temp = sum(t) - t[a-1] + b
    ans.append(temp)

for i in range(m):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
#49a
s = input()
if s=='a' or s=='i' or s=='u' or s='e' or s='o':
    print('vowel')
else:
    print('consonant')

Fixed submission:
#49a
s = input()
if s=='a' or s=='i' or s=='u' or s=='e' or s=='o':
    print('vowel')
else:
    print('consonant')
Buggy python submission (verdict: Runtime Error):
a = list(input().split())
ans = a[0][0]+b[0][0]+c[0][0]
print(ans)

Fixed submission:
#48a
a = list(input().split())
ans = a[0][0]+a[1][0]+a[2][0]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#48b
a,b,x = map(int,input().split())
ans = 0
for _ in range(b-a+1):
    if a%x ==0:
        ans+=1
        a+=1
    else:
        a+=1
print(ans)

Fixed submission:
#48b
a,b,x = map(int,input().split())

A=a//x
B=b//x
C=0
if a%x==0:
    C+=1
print(B-A+C)
Buggy python submission (verdict: Runtime Error):
#43b
s = list(input())
ans =''

for i in s:
    if i =='0' or i =='1':
        a+=i
    else:
        #最後の一つをスライス
        a = a[:-1]
print(a)

Fixed submission:
#43b
s = list(input())
a =''

for i in s:
    if i =='0' or i =='1':
        a = a+i
    else:
        #最後の一つをスライス
        a = a[:-1]
print(a)
Buggy python submission (verdict: Runtime Error):

n=int(input())
w=[input()]
check=True
for i in range (1,n):
    x = input()
    if x in w or w[i-1][len(x[i-1])-1]!=x[0]:
        check=False
    w.append(x)
if check:
    print('YES')
else:
    print('NO')



Fixed submission:
a=int(input())
x=[]
flag=0
for i in range(a):
    s=input()
    if i==0:
        x.append(s)
        continue
    #print(s,x[i-1])
    if s in x or x[i-1][len(x[i-1])-1]!=s[0] :
        x.append("1")
        flag=1
    else:
        x.append(s)
if flag == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
w=[input()]
check=True
for i in range (1,n):
    x = input()
    if x in w or w[i-1][len(x[i-1])-1]!=x[0]:
        check=False
    w.append(x)
if check:
    print('YES')
else:
    print('NO')



Fixed submission:
a=int(input())
x=[]
flag=0
for i in range(a):
    s=input()
    if i==0:
        x.append(s)
        continue
    #print(s,x[i-1])
    if s in x or x[i-1][len(x[i-1])-1]!=s[0] :
        x.append("1")
        flag=1
    else:
        x.append(s)
if flag == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a=int(input())
x=[].append(input())
flag=0
for i in range(1,a):
    s=input()
    if s in x or x[i-1][len(x[i-1])-1]!=s[0] :
        x.append("1")
        flag=1
    else:
        x.append(s)
if flag == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
a=int(input())
x=[]
flag=0
for i in range(a):
    s=input()
    if i==0:
        x.append(s)
        continue
    #print(s,x[i-1])
    if s in x or x[i-1][len(x[i-1])-1]!=s[0] :
        x.append("1")
        flag=1
    else:
        x.append(s)
if flag == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
w=[].append(input())

check=True
for i in range (1,n-1,1):
    x = input()
    print(w)
    if x in w or x[0]!=w[i-1][len(w[i-1])-1]:
        check=False
        w.append("0")
    else:
        w.append(x)
if check:
    print('YES')
else:
    print('NO')



Fixed submission:
a=int(input())
x=[]
flag=0
for i in range(a):
    s=input()
    if i==0:
        x.append(s)
        continue
    #print(s,x[i-1])
    if s in x or x[i-1][len(x[i-1])-1]!=s[0] :
        x.append("1")
        flag=1
    else:
        x.append(s)
if flag == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
if val1 % 2 == 0:
        print(int((val1 // 2) * (val1 // 2)))
    else:
        val1 = val1 + 1
        print(int(((val1 // 2) * (val1 // 2)) - (val1 // 2)))

Fixed submission:
n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))

Buggy python submission (verdict: Runtime Error):
    if n & 1 == 0:
        print((n // 2) ** 2)
    else:
        print((n // 2) * (n // 2 + 1))

Fixed submission:
n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))

Buggy python submission (verdict: Runtime Error):
    if val1 % 2 == 0:
        print(int((val1 // 2) * (val1 // 2)))
    else:
        val1 = val1 + 1
        print(int(((val1 // 2) * (val1 // 2)) - (val1 // 2)))

Fixed submission:
n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))

Buggy python submission (verdict: Runtime Error):
    if val1 % 2 == 0:
        print(int((val1 / 2) * (val1 / 2)))
    else:
        val1 = val1 + 1
        print(int(((val1 / 2) * (val1 / 2)) - (val1 / 2)))

Fixed submission:
n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))

Buggy python submission (verdict: Runtime Error):
aa

Fixed submission:
n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))

Buggy python submission (verdict: Runtime Error):
    if val1 % 2 == 0:
        print(int((val1 / 2) * (val1 / 2)))
    else:
        val1 = val1 + 1
        print(int(((val1 / 2) * (val1 / 2)) - (val1 / 2)))

Fixed submission:
n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))

Buggy python submission (verdict: Runtime Error):
val1=int(input())
if val1%2==0:
    print((val1/2)*(val1/2))
else:
    val1=val1+1
    print(((val1/2)*(val1/2))-(val1/2)

Fixed submission:
n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))

Buggy python submission (verdict: Runtime Error):
k=input()  
odd=1
even=0
for i in range(2,k+1): 
     if i%2==0:
        even+=1
     else:
           odd+=1
print(odd*even)

Fixed submission:
n = int(input())
if n&1==0:
    print((n//2)**2)
else:
    print((n//2)*(n//2+1))
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = int(input())
if x == y:
    print(y)
else:
    print(y - x + 1)

Fixed submission:
n,a=map(int , input().split())
print(n-a+1)
Buggy python submission (verdict: Runtime Error):
N,T=map(int,input().split())
l=[]
for i in range(N):
    c,t=map(int,input().split())
    if t < T:
        l.append(c)
if l =[]:
    print("TLE")
elif:
    print(min(l))

Fixed submission:
N,T=map(int,input().split())
l=[]
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        l.append(c)
if not l:
    print("TLE")
else:
    print(min(l))
Buggy python submission (verdict: Runtime Error):
n1 = int(input())
n2 = int(input())
 
if n1%500<n2:
  print(Yes)
else:
  print(No)

Fixed submission:
n1 = int(input())
n2 = int(input())
 
if n1%500<=n2:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n1 = input()
n2 = input()

if n1%500<n2:
  print(Yes)
else:
  print(No)

Fixed submission:
n1 = int(input())
n2 = int(input())
 
if n1%500<=n2:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[input() for _ in range(h)]
for i in range(h):
  l = ""
  for j in range(w):
    if s[i][j] == "#":
      l += "#"
    else:
      l += sum(s[t][max(0,j-1):min(w,j+2)].count("#") for t in [max(0,i-1):min(h,i+2)])
print(l)
      

Fixed submission:
h,w=map(int,input().split())
s=[input() for _ in range(h)]
for i in range(h):
    l=""
    for j in range(w):
        if s[i][j]=="#":
            l+="#"
        else:
            l+=str(sum([t[max(0,j-1):min(w,j+2)].count("#") for t in s[max(0,i-1):min(h,i+2)]]))
    print(l)
Buggy python submission (verdict: Runtime Error):
N,T = map(int,input().split())
back=[]

for i in range(N):
    a,b = map(int,input().split())
    if b >= T:
        back.append(a)

if len(back) == 0:
    print('TLE')
else:
    print(min(back))

Fixed submission:
N = int(input())

if N == 1 :
    print( 'Hello World' )
else :
    A = int(input())
    B = int(input())
    print( A + B )
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

x = int(input())
t = int(input())

1<= x <=10^99
1<= t <=10^99

if (x - t) < 0 : 
    print(0) 
else :
    print(x - t)

Fixed submission:
# coding: utf-8

s = input().split()

x = int(s[0])
t = int(s[1])

if (x - t) < 0 : 
    print(0) 
else :
    print(x - t)
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = sorted(map(int, input().split()))

    c = n // 2
    for i in range(n):
        if i < c:
            print(a[c])
        else:
            print(a[c - 1])


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, m, x = map(int, input().split())
    a = map(int, input().split())

    cost_move_to_left = 0
    cost_move_to_right = 0
    for i in a:
        if i > x:
            cost_move_to_left += 1
        elif i < x:
            cost_move_to_right += 1

    print(cost_move_to_left if cost_move_to_left < cost_move_to_right else cost_move_to_right)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
kouyaku_max = m // n
kouyaku = 1
for i in range(min(kouyaku_max,int(m**0.5)),0,-1):
    if ((m % (i) == 0) and (n*i <= m)):
        kouyaku = i
        break

print('{}'.format(kouyaku))

Fixed submission:
a = int(input())
if a == 1:
    print("Hello World")
else:
    b = int(input())
    c = int(input())
    print('{}'.format(b+c))

Buggy python submission (verdict: Runtime Error):
a = int(input())
if a == 1:
    print("Hello World")
else:
    b, c = map(int, input().split())
    print('{}'.format(b+c))

Fixed submission:
a = int(input())
if a == 1:
    print("Hello World")
else:
    b = int(input())
    c = int(input())
    print('{}'.format(b+c))
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
c = a + b
if c <= 24:
    print(c)
else:
    print(c - 24)

Fixed submission:
a, b = map(int, input().split())
c = a + b
if c < 24:
    print(c)
else:
    print(c - 24)

Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
print(a)
c = a + b
if c <= 24:
    print(c)
else:
    print(c - 24)

Fixed submission:
a, b = map(int, input().split())
c = a + b
if c < 24:
    print(c)
else:
    print(c - 24)
Buggy python submission (verdict: Time Limit Exceeded):
input_len = int(input())
ans = 1
for i in range(1, input_len+1):
    ans *= i

ans = ans % ((10 ** 9) + 7)
print(ans)

Fixed submission:
input_len = int(input())
ans = 1
for i in range(1, input_len+1):
    ans = (i * ans) % (10 ** 9 + 7)

print(ans)

Buggy python submission (verdict: Runtime Error):
input_len = input()
ans = 1
for i in range(1, input_len+1):
    ans *= i

ans = ans % (10 ** 9) + 7
print(ans)

Fixed submission:
input_len = int(input())
ans = 1
for i in range(1, input_len+1):
    ans = (i * ans) % (10 ** 9 + 7)

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
word = []
for i in range(n):
	word.append(input())

if is_unique(word) == False:
	print("No")
	exit()

for i in range(1,len(word)):
	if word[i-1][-1] != word[i][0]:
		print("No")
		exit()

print("Yes")

Fixed submission:
n = int(input())
word = []
for i in range(n):
	word.append(input())

if len(word) != len(set(word)):
	print("No")
	exit()

for i in range(1,len(word)):
	if word[i-1][-1] != word[i][0]:
		print("No")
		exit()

print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
word = []
for i in range(n):
	word.append(input())

if is_unique(word) == False:
	print("No")
	exit()

for i in range(1,len(word)):
	if word[i-1][-1] != word[i][-1]:
		print("No")
		exit()

print("Yes")

Fixed submission:
n = int(input())
word = []
for i in range(n):
	word.append(input())

if len(word) != len(set(word)):
	print("No")
	exit()

for i in range(1,len(word)):
	if word[i-1][-1] != word[i][0]:
		print("No")
		exit()

print("Yes")
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = "No"

for i in range(100):
	for j in range(100):
		if i*7+j*4 == N:
			ans = "Yes"

print(ans)

Fixed submission:
N = int(input())
ans = "No"

for i in range(100):
    for j in range(100):
        if i*7+j*4==N:
            ans = "Yes"
            
print (ans)
Buggy python submission (verdict: Runtime Error):
s = input()
text = s[2:-1]
r = s.replace('A', '')
r = r.replace('C', '')

if s[0] != 'A' pr text.count('C') != 1 or r != r.lower():
	print('WA')
	exit()

print('AC')

Fixed submission:
r = int(input())

if r < 1200:
	print("ABC")
elif r < 2800:
	print("ARC")
else:
	print("AGC")

Buggy python submission (verdict: Runtime Error):
s = input()
a = False
b = False
c = False
cnt = 0
k = 0

if s[0] == 'A':
	a = True

for c in range(s[2],s[-1]):
	if c == 'C':
		cnt += 1
if cnt == 1:
	b = True

for c in s:
	if c != 'A' or c != 'C':
		if c.islower() == True:
			k += 1

if k == len(s):
	c = True


if a == b == c == True:
	print("AC")
else:
	print("WC")


Fixed submission:
r = int(input())

if r < 1200:
	print("ABC")
elif r < 2800:
	print("ARC")
else:
	print("AGC")
Buggy python submission (verdict: Runtime Error):
s = input()
a = False
b = False
c = False
cnt = 0
k = 0

if s[0] == 'A':
	a = True

for c in range(s[2],s[-1]):
	if c == 'C':
		cnt += 1
if cnt == 1:
	b = True

for c in s:
	if c != 'A' or c != 'C':
		if c.islower() == True:
			k += 1

if k == s.length():
	c = True


if a == b == c == True:
	print("AC")
else:
	print("WC")

Fixed submission:
s = input()
text = s[2:-1]
r = s.replace('A', '')
r = r.replace('C', '')

if s[0] != 'A' or text.count('C') != 1 or r != r.lower():
    print('WA')
else:
	print('AC')
Buggy python submission (verdict: Runtime Error):
N=input()
Y=[111,222,333,444,555,666,777,888,999]
for i in range(9):
  if N<=Y[i]:
    print(Y[i])
    break

Fixed submission:
N=int(input())
Y=[111,222,333,444,555,666,777,888,999]
for i in range(9):
  if N<=Y[i]:
    print(Y[i])
    break
Buggy python submission (verdict: Runtime Error):
a=int(input())
if a = 1:
  print("Hello World")
elif a = 2:
  A = int(input())
  B = int(input())
  print(A+B)
  

Fixed submission:
a=int(input())
if a == 1:
  print("Hello World")
elif a == 2:
  A = int(input())
  B = int(input())
  print(A+B)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
x =a*10 + b
y = b*10+ c
print([x, y][if x < y])


Fixed submission:
a, b, c = map(int, input().split())
x = a*10 + b + c
y = b*10+ c + a
z = c*10+ a + b
print(max([x, y,z]))

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
x =a*10 + b
y = b*10+ c
print([x, y] if x < y)

Fixed submission:
a, b, c = map(int, input().split())
x = a*10 + b + c
y = b*10+ c + a
z = c*10+ a + b
print(max([x, y,z]))
Buggy python submission (verdict: Runtime Error):
x = (int)input()
a = (int)input()
b = (int)input()

x -= a
x -= (int)(x/b)*b

print(x)

Fixed submission:
x = int(input())
a = int(input())
b = int(input())

x -= a
x -= (int)(x/b)*b

print(x)
Buggy python submission (verdict: Runtime Error):
n = input();

if n==1:
	print('Hello World')
else:
	a = input()
	b = input()
	print(a + b)

Fixed submission:
n = int(input())

if n==1:
	print('Hello World')
else:
	a = int(input())
	b = int(input())
	print(a + b)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a,b = map(int, raw_input().split())
h_max = 40
w_max = 100
ans = []
for j in range(w_max):
    buff = [ 0 for i in range(h_max/2)] + [ 1 for i in range(h_max/2)]
    ans.append(buff)

h = h_max
w = w_max
a = a - 1
b = b - 1

px = 0
py = 0
while b > 0:
    b = b - 1
    ans[px][py] = 1
    px = px + 2
    if px > w_max - 1:
        py = py + 2
        px = 0
#    print("[{} {}]".format(px, py))

px = 0
py = h_max / 2 + 1
while a > 0:
    a = a - 1
    ans[px][py] = 0
    px = px + 2
    if px > w_max - 1:
        py = py + 2
        px = 0
#    print("[{} {}]".format(px, py))

print("{} {}".format(h, w))
for j in range(h):
    s = ""
    for i in range(w):
        if ans[i][j] == 0:
            s = s + '.'
        else:
            s = s + '#'
    print s



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

ans = 0
a = int(raw_input())
b = int(raw_input())
ans = ans + min([a,b])
a = int(raw_input())
b = int(raw_input())
ans = ans + min([a,b])

print ans

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a,b = map(int, raw_input().split())
h_max = 100
w_max = 100
ans = []
for j in range(w_max):
    buff = [ 0 for i in range(h_max/2)] + [ 1 for i in range(h_max/2)]
    ans.append(buff)

h = h_max
w = w_max
a = a - 1
b = b - 1

px = 0
py = 0
while b > 0:
    b = b - 1
    ans[px][py] = 1
    px = px + 2
    if px > w_max - 1:
        py = py + 2
        px = 0
#    print("[{} {}]".format(px, py))

px = 0
py = h_max / 2 + 1
while a > 0:
    a = a - 1
    ans[px][py] = 0
    px = px + 2
    if px > w_max - 1:
        py = py + 2
        px = 0
#    print("[{} {}]".format(px, py))

print("{} {}".format(h, w))
for j in range(h):
    s = ""
    for i in range(w):
        if ans[i][j] == 0:
            s = s + '.'
        else:
            s = s + '#'
    print s



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

ans = 0
a = int(raw_input())
b = int(raw_input())
ans = ans + min([a,b])
a = int(raw_input())
b = int(raw_input())
ans = ans + min([a,b])

print ans
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

n = int(raw_input())
spot = map(int, raw_input().split())

for i in range(n):
    ans = 0
    p = 0
    end = 0
    for j in range(n):
        if j != i :
            ans = ans + abs(spot[j] - p)
            p = spot[j]
    ans = ans + abs(p - end)
    print ans

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

n = int(raw_input())
spot = [0] + map(int, raw_input().split()) + [0]

all_sum = 0
for j in range(n+1):
    all_sum = all_sum + abs(spot[j+1] - spot[j])

for i in range(n):
    ans = all_sum - abs(spot[i+1] - spot[i]) - abs(spot[i+2] - spot[i+1]) + abs(spot[i+2] - spot[i])
    print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    N = input()
    Sn = 0
    for n in N: Sn += int(n)
    print(Yes if int(N) % Sn == 0 else 'No')
    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N = input()
    Sn = 0
    for n in N: Sn += int(n)
    if int(N) % Sn == 0:
        print('Yes')
    else:
        print('No')
    
if __name__ == '__main__':
    main()