Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def index(n:int, a: int):
    if a % 2 == 0:
        i = n // 2 - a // 2
        j = (i + 1) * -1
        return (i, j) if i != n // 2 else (i,)
    else:
        i = (n // 2 - 1) - (a - 1) // 2
        j = (i + 1) * -1
        return (i, j)
 
n = int(input())
line = [0 for _ in range(n)]
for a in map(int, input().split()):
    for i in index(n, a):
        line[i] += 1
else:
    if n % 2 == 0 and set(line) == {2}:
        print(2 ** (n // 2) % (10 ** 9 + 7))
    elif n % 2 == 1 and set(line) == {1, 2} and line[n//2] == 1:
        print(2 ** ((n - 1) // 2) % (10 ** 9 + 7))
    else:
        print(0)
def index(n:int, a: int):
    if a % 2 == 0:
        i = n // 2 - a // 2
        j = (i + 1) * -1
        return (i, j) if i != n // 2 else (i,)
    else:
        i = (n // 2 - 1) - (a - 1) // 2
        j = (i + 1) * -1
        return (i, j)

n = int(input())
line = [0 for _ in range(n)]
for a in map(int, input().split()):
    for i in index(n, a):
        line[i] += 1
else:
    if n % 2 == 0 and set(line) == {2}:
        print(2 ** (n // 2) % (10 ** 9 + 7))
    elif n % 2 == 1 and set(line) == {1, 2} and line[n//2] == 1:
        print(2 ** ((n - 1) // 2) % (10 ** 9 + 7))
    elif n == 1 and line == [1]:
        print(1)
    else:
        print(0)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]
line = [abs(i - (n - i- 1)) for i in range(n)]
if sorted(a) == sorted(line):
    print((2 ** (n // 2)) %  (10 ** 9 + 7))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
print("vowel" if c in "aeiou" else "consonant")

Fixed submission:
print("vowel" if input() in "aeiou" else "consonant")

Buggy python submission (verdict: Runtime Error):
print("vowel" if c in "aeiou" else "consonant"))

Fixed submission:
print("vowel" if input() in "aeiou" else "consonant")
Buggy python submission (verdict: Runtime Error):
t= int(input())
for i in range(t):
    k=input().split()
    a=int(k[0])
    b=int(k[1])
    c=a*b
    d=int(c**.5)
    print(2*d-1-((d*(d+1)>=c)-(c==d*d and a!=b))

Fixed submission:
t= int(input())
for i in range(t):
    k=input().split()
    a=int(k[0])
    b=int(k[1])
    c=a*b
    d=int(c**.5)
    print(2*d-1-((d*(d+1))>=c)-(c==d*d and a!=b))

Buggy python submission (verdict: Runtime Error):
t= int(input())
for i in range(t):
    k=input().split()
    a=int(k[0])
    b=int(k[1])
	c=a*b
    d=int(c**.5)
    print(2*d-1-((d*d)==c)-(c==d*d and a!=b))

Fixed submission:
t= int(input())
for i in range(t):
    k=input().split()
    a=int(k[0])
    b=int(k[1])
    c=a*b
    d=int(c**.5)
    print(2*d-1-((d*(d+1))>=c)-(c==d*d and a!=b))

Buggy python submission (verdict: Time Limit Exceeded):
t= int(input())
for i in range(t):
    k=input().split()
    a=int(k[0])
    b=int(k[1])
    if a<b:
        a,b=b,a
    k_act=a+a-1
    k=k_act
    pair = 0
    prod=a*b
    for i in range(1,k+1):
        for j in range(k,0,-1):
            if i*j<prod:
                k=j-1
                pair+=1
                break
            else:
                continue
    if a==b:
        print(pair)
    else:
        print(pair-1)

Fixed submission:
t= int(input())
for i in range(t):
    k=input().split()
    a=int(k[0])
    b=int(k[1])
    c=a*b
    d=int(c**.5)
    print(2*d-1-((d*(d+1))>=c)-(c==d*d and a!=b))
Buggy python submission (verdict: Runtime Error):
S = raw_input()
if (S[0] == S[1]) or (S[1] == S[2]) or (S[2] == S[0]):
    print("No")
else:
    print("Yes")


Fixed submission:
S = input()
if (S[0] == S[1]) or (S[1] == S[2]) or (S[2] == S[0]):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
S = raw_input()
if (S[0] != S[1]) and (S[1] != S[2]) and (S[2] != S[0]):
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
if (S[0] == S[1]) or (S[1] == S[2]) or (S[2] == S[0]):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
S = raw_input()
if S[0] != S[1] and S[1] != S[2] and S[2] != S[0]:
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
if (S[0] == S[1]) or (S[1] == S[2]) or (S[2] == S[0]):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
S = raw_input()
if S[0] != S[1] and S[1] != S[2] and S[2] != S[0]:
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
if (S[0] == S[1]) or (S[1] == S[2]) or (S[2] == S[0]):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
S = raw_input()
if S[0] != S[1] && S[1] != S[2] && S[2] != S[0]:
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
if (S[0] == S[1]) or (S[1] == S[2]) or (S[2] == S[0]):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
S = input()
if S[0] != S[1] && S[1] != S[2] && S[2] != S[0]:
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
if (S[0] == S[1]) or (S[1] == S[2]) or (S[2] == S[0]):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
S = input()
if(S[0] != S[1] && S[1] != S[2] && S[2] != S[0]):
    print("Yes")
else:
    print("No")

Fixed submission:
S = input()
if (S[0] == S[1]) or (S[1] == S[2]) or (S[2] == S[0]):
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())

if b-a+1 > 2*c:
    for i in range(a,a+c):
    print(i)
    for i in range(b-c+1,b):
    print(i)
else:
    for i in range(a,b+1):
    print(i)

Fixed submission:
a,b,c = map(int,input().split())

if b-a+1 > 2*c:
    for i in range(a,a+c):
        print(i)
    for i in range(b-c+1,b+1):
        print(i)
else:
    for i in range(a,b+1):
        print(i)
Buggy python submission (verdict: Runtime Error):
#coding: UTF-8

A = int(input())
B = int(input())
C = int(input())

if sum([A, B]) >= C:
    print ('Yes')
else:
    print('No')


Fixed submission:
#coding: UTF-8

A,B,C = list(map(int, input().split()))

if sum([A, B]) >= C:
    print ('Yes')
else:
    print ('No')

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

A = int(input())
B = int(input())
C = int(input())

if sum([A, B]) > C:
    print ('Yes')
else:
    print('No')


Fixed submission:
#coding: UTF-8

A,B,C = list(map(int, input().split()))

if sum([A, B]) >= C:
    print ('Yes')
else:
    print ('No')
Buggy python submission (verdict: Runtime Error):
m = input()
n = 48 - m
print(n)


Fixed submission:
m = int(input())
n = 48 - m
print(n)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 文字列の入力
a = input()

if (a.count("a") + a.count("b") + a.count("c") ) == 3):
    print("Yes")
# 出力
else:
    print("No")

Fixed submission:
# -*- coding: utf-8 -*-
# 文字列の入力
a = input()

if (a.count("a") and a.count("b") and a.count("c") ):
    print("Yes")
# 出力
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int, input().split()))
a = [0]*N
b = [0]*N
c = [0]*M
d = [0]*M
for k in range(N):
     a[k],b[k] = list(map(int, input().split()))
for l in range(M):
     c[l],d[l] = list(map(int, input().split()))

for i in range(N):
    s=10**8+1
    for j in range(M):
        if  s>abs(a[i]-c[j])+abs(b[i]-d[j]):
             s=abs(a[i]-c[j])+abs(b[i]-d[j])
             e=j+1
    print(e)

Fixed submission:
N,M = list(map(int, input().split()))
a = [0]*N
b = [0]*N
c = [0]*M
d = [0]*M
for k in range(N):
     a[k],b[k] = list(map(int, input().split()))
for l in range(M):
     c[l],d[l] = list(map(int, input().split()))

for i in range(N):
    s=10**9
    for j in range(M):
        if  s>abs(a[i]-c[j])+abs(b[i]-d[j]):
             s=abs(a[i]-c[j])+abs(b[i]-d[j])
             e=j+1
    print(e)

Buggy python submission (verdict: Runtime Error):
N,M = list(map(int, input().split()))
a = [0]*N
b = [0]*N
c = [0]*M
d = [0]*M
for k in range(N):
     a[k],b[k] = list(map(int, input().split()))
for l in range(M):
     c[l],d[l] = list(map(int, input().split()))

for i in range(N):
    s=10**8
    for j in range(M):
        if  s>abs(a[i]-c[j])+abs(b[i]-d[j]):
             s=abs(a[i]-c[j])+abs(b[i]-d[j])
             e=j+1
    print(e)


Fixed submission:
N,M = list(map(int, input().split()))
a = [0]*N
b = [0]*N
c = [0]*M
d = [0]*M
for k in range(N):
     a[k],b[k] = list(map(int, input().split()))
for l in range(M):
     c[l],d[l] = list(map(int, input().split()))

for i in range(N):
    s=10**9
    for j in range(M):
        if  s>abs(a[i]-c[j])+abs(b[i]-d[j]):
             s=abs(a[i]-c[j])+abs(b[i]-d[j])
             e=j+1
    print(e)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=1
for i in range(N):
   P=P*(i+1)
   M=P%(10**9+7)

print(M)

Fixed submission:
N=int(input())
P=1
for i in range(N):
   P=P*(i+1)
   P=P%(10**9+7)

print(P)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=1
for i in range(N):
   P=P*(i+1)
M=P%(10**9+7)
print(M)

Fixed submission:
N=int(input())
P=1
for i in range(N):
   P=P*(i+1)
   P=P%(10**9+7)

print(P)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
k=int(input())

c=b-a+1

a1=[]
b1=[]

for i in range(k):
    a1.append(a+i)
    b1.append(b-i)

if c>2*k-1:
    for i in range(k):
        print(a1[i])
    for i in range(k):
        print(b1[k-i-1])

else:
    for i in range(a,b+1):
        print(i)



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

c=b-a+1

a1=[]
b1=[]

for i in range(k):
    a1.append(a+i)
    b1.append(b-i)

if c>2*k-1:
    for i in range(k):
        print(a1[i])
    for i in range(k):
        print(b1[k-i-1])

else:
    for i in range(a,b+1):
        print(i)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
k=int(input())

c=b-a+1

aa=[]
bb=[]

for i in range(k):
    aa.append(a+i)
    bb.append(b-i)

if c>2*k-1:
    for i in range(k):
        print(aa[i])
    for i in range(k):
        print(bb[k-i-1])

else:
    for i in range(a,b+1):
        print(i)


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

c=b-a+1

a1=[]
b1=[]

for i in range(k):
    a1.append(a+i)
    b1.append(b-i)

if c>2*k-1:
    for i in range(k):
        print(a1[i])
    for i in range(k):
        print(b1[k-i-1])

else:
    for i in range(a,b+1):
        print(i)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
k=int(input())

c=b-a+1

aa=[]
bb=[]

for i in range(k):
    aa.append(a+i)
    bb.append(b-i)

if c>2*k-1:
    for i in range(k):
        print(aa[i])
    for i in range(k):
        print(bb[k-i-1])

else:
    for i in range(a,b+1):
        print(i)



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

c=b-a+1

a1=[]
b1=[]

for i in range(k):
    a1.append(a+i)
    b1.append(b-i)

if c>2*k-1:
    for i in range(k):
        print(a1[i])
    for i in range(k):
        print(b1[k-i-1])

else:
    for i in range(a,b+1):
        print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = (int(i) for i in input().split())

tiles = [[True for i in range(M + 2)] for j in range(N + 2)]
for i in range(1, N + 1):
    for j in range(1, M + 1):
        tiles[i - 1][j - 1] = not (tiles[i - 1][j - 1])
        tiles[i - 1][j] = not (tiles[i - 1][j])
        tiles[i - 1][j + 1] = not (tiles[i - 1][j + 1])
        tiles[i][j - 1] = not (tiles[i][j - 1])
        tiles[i][j] = not (tiles[i][j])
        tiles[i][j + 1] = not (tiles[i][j + 1])
        tiles[i + 1][j - 1] = not (tiles[i + 1][j - 1])
        tiles[i + 1][j] = not (tiles[i + 1][j])
        tiles[i + 1][j + 1] = not (tiles[i + 1][j + 1])

count = 0

for i in range(1, N + 1):
    for j in range(1, M + 1):
        if not tiles[i][j]:
            count = count + 1
print(count)

Fixed submission:
N, M = (int(i) for i in input().split())

if N == 1 and M == 1:
    print(1)

elif N == 2 or M == 2:
    print(0)

elif N == 1 or M == 1:
    if N == 1:
        print(M - 2)
    else:
        print(N - 2)

else:
    print((N - 2) * (M - 2))
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
array = np.array(list(map(int, input().split())))
c = 0
check = True
while check:
    for n in array:
        if n % 2 == 1:
            check = False

    array = array / 2
    c = c + 1
print(c-1)


Fixed submission:
masu = input()
sum = 0
for n in masu:
    sum = sum + int(n)
print(sum)
Buggy python submission (verdict: Runtime Error):
a = input().split()
if 'Y' in a:
    print(four)
else:
    print(three)

Fixed submission:
N = int(input())
a = input().split()
if 'Y' in a:
    print('Four')
else:
    print('Three')

Buggy python submission (verdict: Runtime Error):
a = input().split()
if Y in a:
    print(4)
else:
    print(3)

Fixed submission:
N = int(input())
a = input().split()
if 'Y' in a:
    print('Four')
else:
    print('Three')
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
letters = ['M','A','R','C','H']
N = int(input())
a = []
com_s = []

for i in range(N):
    x = input()
    if x[0] in letters:
        a.append(x)

coms = list(itertools.combinations(a,3))
for com in coms:
    if com[0][0] != com[1][0] and com[1][0] != com[2][0] and com[2][0] != com[0][0]:
        com_s.append(com)

print(len(com_s))


Fixed submission:
N = int(input())
_M = [] 
_A = [] 
_R = [] 
_C = [] 
_H = [] 

for i in range(N):
    x = input()
    if x[0] == 'M':
        _M.append(x)
    elif x[0] == 'A':
        _A.append(x)
    elif x[0] == 'R':
        _R.append(x)
    elif x[0] == 'C':
        _C.append(x)
    elif x[0] == 'H':
        _H.append(x)

m = len(_M)
a = len(_A)
r = len(_R)
c = len(_C)
h = len(_H)

x = m*a*r + m*a*c + m*a*h + m*r*c + m*r*h + m*c*h + a*r*c + a*r*h + a*c*h + r*c*h

print(x)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
letters = ['M','A','R','C','H']
N = int(input())
a = []
com_s = []

for i in range(N):
    x = input()
    if x[0] in letters:
        a.append(x)

coms = list(itertools.combinations(a,3))
for com in coms:
    if com[0][0] != com[1][0] and com[1][0] != com[2][0] and com[2][0] != com[0][0]:
        com_s.append(com)

print(len(com_s))

Fixed submission:
N = int(input())
_M = [] 
_A = [] 
_R = [] 
_C = [] 
_H = [] 

for i in range(N):
    x = input()
    if x[0] == 'M':
        _M.append(x)
    elif x[0] == 'A':
        _A.append(x)
    elif x[0] == 'R':
        _R.append(x)
    elif x[0] == 'C':
        _C.append(x)
    elif x[0] == 'H':
        _H.append(x)

m = len(_M)
a = len(_A)
r = len(_R)
c = len(_C)
h = len(_H)

x = m*a*r + m*a*c + m*a*h + m*r*c + m*r*h + m*c*h + a*r*c + a*r*h + a*c*h + r*c*h

print(x)

Buggy python submission (verdict: Runtime Error):
import itertools
letters = ['M','A','R','C','H']
N = int(input())
a = []
com_s = []

for i in range(N):
    x = input()
    if x[0] in letters:
        a.append(x)

coms = list(itertools.combinations(a,3))
for com in coms:
    if com[0][0] != com[1][0] and com[1][0] != com[2][0] and com[2][0] != com[0]com[0]:
        com_s.append(com)

print(len(com_s))

Fixed submission:
N = int(input())
_M = [] 
_A = [] 
_R = [] 
_C = [] 
_H = [] 

for i in range(N):
    x = input()
    if x[0] == 'M':
        _M.append(x)
    elif x[0] == 'A':
        _A.append(x)
    elif x[0] == 'R':
        _R.append(x)
    elif x[0] == 'C':
        _C.append(x)
    elif x[0] == 'H':
        _H.append(x)

m = len(_M)
a = len(_A)
r = len(_R)
c = len(_C)
h = len(_H)

x = m*a*r + m*a*c + m*a*h + m*r*c + m*r*h + m*c*h + a*r*c + a*r*h + a*c*h + r*c*h

print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n,y=map(int,input().split())
flag=False
if 10000*n<y:
    print('-1 -1 -1')
elif 10000*n==y:
    print(str(n)+' 0 0')
else:
    for i in range(n+1):
        if flag:
            break
        for j in range(n-i+1):
            if flag:
                break
            for k in range(n-i-j+1):
                if 10000*i+5000*j+1000*k==y and i+j+k==n:
                    print(str(i)+' '+str(j)+' '+str(k))
                    flag=True
                    break
    if flag==False:
        print('-1 -1 -1')


Fixed submission:
n,y=map(int,input().split())
flag=False
if 10000*n<y:
    print('-1 -1 -1')
elif 10000*n==y:
    print(n,0,0)
else:
    for i in range(n+1):
        if flag:
            break
        for j in range(n-i+1):
            if 10000*i+5000*j+1000*(n-i-j)==y:
                print(i,j,n-i-j)
                flag=True
                break
    else:
        print('-1 -1 -1')

Buggy python submission (verdict: Time Limit Exceeded):
n,y=map(int,input().split())
flag=False
if 10000*n<y:
    print('-1 -1 -1')
elif 10000*n==y:
    print(str(n)+' 0 0')
else:
    for i in range(n+1):
        if flag:
            break
        for j in range(n+1):
            if flag:
                break
            for k in range(n+1):
                if 10000*i+5000*j+1000*k==y and i+j+k==n:
                    print(str(i)+' '+str(j)+' '+str(k))
                    flag=True
                    break
    if flag==False:
        print('-1 -1 -1')


Fixed submission:
n,y=map(int,input().split())
flag=False
if 10000*n<y:
    print('-1 -1 -1')
elif 10000*n==y:
    print(n,0,0)
else:
    for i in range(n+1):
        if flag:
            break
        for j in range(n-i+1):
            if 10000*i+5000*j+1000*(n-i-j)==y:
                print(i,j,n-i-j)
                flag=True
                break
    else:
        print('-1 -1 -1')

Buggy python submission (verdict: Runtime Error):
n,y=map(int,input().split())
flag=False
if 10000*n<y:
    print(-1 -1 -1)
elif 10000*n==y:
    print(n 0 0)
else:
    for i in range(n+1):
        if flag:
            break
        for j in range(n+1):
            if flag:
                brake
            for k in range(n+1):
                if 10000*i+5000*j+1000*k==y:
                    print(str(i) str(j) str(k))
                    flag=True
                    break
    if flag==False:
        print(-1 -1 -1)


Fixed submission:
n,y=map(int,input().split())
flag=False
if 10000*n<y:
    print('-1 -1 -1')
elif 10000*n==y:
    print(n,0,0)
else:
    for i in range(n+1):
        if flag:
            break
        for j in range(n-i+1):
            if 10000*i+5000*j+1000*(n-i-j)==y:
                print(i,j,n-i-j)
                flag=True
                break
    else:
        print('-1 -1 -1')
Buggy python submission (verdict: Runtime Error):
a = [i for i in input()]
b = set(a)
print(["No", "Yes"][len(a) == 3 and b == 3]

Fixed submission:
a = [i for i in input()]
b = set(a)
print(["No", "Yes"][len(a) == 3 and len(b) == 3])

Buggy python submission (verdict: Runtime Error):
import numpy as np

queue = [np.array([ int(n) for n in input().split() ] + [0])]

while queue:
    now = queue.pop(0)

    if now[0] == now[1] == now[2]:
        print(now[3])
        break

    min = np.argmin(now[:3])
    
    if(np.max(now[:3])-np.min(now[:3]) > 2):
        now[min] += 2
        now[3] += 1
        queue.append(now)

    else:
        queue.append(now+[1, 1, 0, 1])
        queue.append(now+[1, 0, 1, 1])
        queue.append(now+[1, 1, 0, 1])
        queue.append(now+[0, 1, 1, 1])
        queue.append(now+[1, 0, 1, 1])
        queue.append(now+[0, 1, 1, 1])



Fixed submission:
from collections import Counter
 
print("Yes" if Counter(input()) == Counter("abc") else "No")

Buggy python submission (verdict: Runtime Error):
import numpy as np

queue = [np.array([ int(n) for n in input().split() ] + [0])]

while queue:
    now = queue.pop(0)
    print(now)

    if now[0] == now[1] == now[2]:
        print(now[3])
        break

    min = np.argmin(now[:3])
    
    if(np.max(now[:3])-np.min(now[:3]) > 2):
        now[min] += 2
        now[3] += 1
        queue.append(now)

    else:
        queue.append(now+[1, 1, 0, 1])
        queue.append(now+[1, 0, 1, 1])
        queue.append(now+[1, 1, 0, 1])
        queue.append(now+[0, 1, 1, 1])
        queue.append(now+[1, 0, 1, 1])
        queue.append(now+[0, 1, 1, 1])



Fixed submission:
from collections import Counter
 
print("Yes" if Counter(input()) == Counter("abc") else "No")

Buggy python submission (verdict: Runtime Error):
data = input()

if data.find('a') != -1 and data.find('b') != -1 and data.find('c') != -1:
	print 'Yes'
else:
  	print 'No'

Fixed submission:
#!/bin/python
data = input()
 
if data.find('a') != -1 and data.find('b') != -1 and data.find('c') != -1:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
def blackSum(x,y,x2,y2):
    return bs[y2][x2] - bs[y2][x-1] - bs[y-1][x2] + bs[y-1][x-1]

n,k = [int(i) for i in input().split()]
black = [[0 for i in range(2*k+2)] for j in range(2*k+2)]
for i in range(n):
    xi,yi,ci = list(input().split())
    x = int(xi)%(2*k)
    if ci == "W":
        y = (int(yi) + k)%(2*k)
    else:
        y = int(yi)%(2*k)
    black[y+2][x+2] += 1
bs = [[0 for i in range(2*k+2)] for j in range(2*k+2)]
for i in range(1,2*k+2):
    for j in range(1,2*k+2):
        bs[i][j] = black[i][j] + bs[i-1][j] + bs[i][j-1] - bs[i-1][j-1]
max = 0
#左上の黒の位置を指定する。
for i in range(2,k+2):
    for j in range(2,k+2):
        sum = blackSum(j,i,j+k-1,i+k-1) + \
              blackSum(1,1,j-1,i-1) + \
              blackSum(1,i+k,j-1,2*k+1) + \
              blackSum(j+k,1,2*k+1,i-1) + \
              blackSum(j+k,i+k,2*k+1,2*k+1)
        if sum>max:
            max=sum
print(max)
        
        
        
    



Fixed submission:
a, b = list(map(int, input().split()))
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
n = int(print())
group = 0
if n%3==0:
    group = n/3
elif n%3==1:
    group = (n-1)/3
else:
    group = (n-2)/3
print(int(group))

Fixed submission:
n = int(input())
group = 0
if n%3==0:
    group = n/3
elif n%3==1:
    group = (n-1)/3
else:
    group = (n-2)/3
print(int(group))
Buggy python submission (verdict: Runtime Error):
S = raw_input()
if 'a' in S and 'b' in S and 'c' in S:
    print 'true'
else:
    print 'false'

Fixed submission:
S = input()
if 'a' in S and 'b' in S and 'c' in S:
    print ('Yes')
else:
    print ('No')
Buggy python submission (verdict: Runtime Error):
s = input()
s[3] = '8'
print(s)


Fixed submission:
s = input()
s = s.replace('7','8',1)
print(s)
#print(s[0:3] + "8" + s[4:])
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    N, HP  = map(int, input().split())
    score = 0

    f = []
    n = []
    for i in range(N):
        a, b = map(int, input().split())
        f.append(a)
        n.append(b)

    #最後まで使う刀保存
    lastf = max(f)
    lastid = f.index(lastf)
    lastn = n[lastid]


    for i in range(len(n)):
        mn = max(n)
        id = n.index(mn)
        if lastf < mn:
            HP -= mn
            n.pop(id)
            score += 1
            if HP <= 0:
                return score
        else:
            break

    score += -(-HP // lastf)
    return score


print(solve())


Fixed submission:
def solve():
    N, HP  = map(int, input().split())
    score = 0

    f = []
    n = []
    for i in range(N):
        a, b = map(int, input().split())
        f.append(a)
        n.append(b)

    #最後まで使う刀保存
    lastf = max(f)
    lastid = f.index(lastf)
    lastn = n[lastid]
    n.sort(reverse = True)


    for i in range(len(n)):
        mn = n[0]
        id = 0
        if lastf < mn:
            HP -= mn
            n.pop(id)
            score += 1
            if HP <= 0:
                return score
        else:
            break

    score += -(-HP // lastf)
    return score


print(solve())