Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,y = map(int,input().split())

price = 0
ok = 0

for i in range(n+1):
    for j in range(n+1):
            k = n - i - j
            if k < 0:
                k = 0

            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == y and i+j+k == n and ok == 0:
                print(i, j, k)
                ok = 1
                break

            else:
                no_flg = 1
    else:
        continue
    break

if no_flg == 1 and ok == 0:
    print(-1, -1, -1 )

Fixed submission:
n,y = map(int,input().split())

price = 0
ok = 0

for i in range(n+1):
    for j in range(n+1):
            k = n - i - j
            if k < 0:
                k = 0

            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == y and i+j+k == n and ok == 0:
                print(i, j, k)
                ok = 1
                break

    else:
        continue
    break

if ok == 0:
    print(-1, -1, -1 )

Buggy python submission (verdict: Runtime Error):
n_y = list(map(int,input().split()))

price = 0
ok = 0

for i in range(n_y[0]+1):
    for j in range(n_y[0]+1):
            k = n_y[0] - i - j
            if k < 0:
                k = 0

            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == n_y[1] and i+j+k == n_y[0] and ok == 0:
                print(i, j, k)
                ok = 1
                break

            else:
                no_flg = 1
    else:
        continue
    break

if no_flg == 1 and ok == 0:
    print(-1, -1, -1 )

Fixed submission:
n,y = map(int,input().split())

price = 0
ok = 0

for i in range(n+1):
    for j in range(n+1):
            k = n - i - j
            if k < 0:
                k = 0

            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == y and i+j+k == n and ok == 0:
                print(i, j, k)
                ok = 1
                break

    else:
        continue
    break

if ok == 0:
    print(-1, -1, -1 )

Buggy python submission (verdict: Time Limit Exceeded):
n_y = list(map(int,input().split()))

price = 0
ok = 0

for i in range(n_y[0]+1):
    for j in range(n_y[0]+1):
        for k in range(n_y[0]+1):
            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == n_y[1] and i+j+k == n_y[0] and ok == 0:
                print(i, j, k)
                ok = 1
                break

            else:
                no_flg = 1
        else:
            continue
        break
    else:
        continue
    break

if no_flg == 1 and ok == 0:
    print(-1, -1, -1 )

Fixed submission:
n,y = map(int,input().split())

price = 0
ok = 0

for i in range(n+1):
    for j in range(n+1):
            k = n - i - j
            if k < 0:
                k = 0

            price = 10000 * i + 5000 * j + 1000 * k   
            
            if price == y and i+j+k == n and ok == 0:
                print(i, j, k)
                ok = 1
                break

    else:
        continue
    break

if ok == 0:
    print(-1, -1, -1 )
Buggy python submission (verdict: Runtime Error):
def div_cnt(input_n):
    cnt = 0
    while input_n % 2 == 0:
        input_n /= 2
        cnt += 1

    return cnt

input_n = int(input())
input_a = list(map(int,input().split()))
cnt = min(map(div_cnt,input_a))

print(cnt)

Fixed submission:
input_s = input().count("1")

print(input_s)
Buggy python submission (verdict: Runtime Error):
input_n = int(input())
input_a = map(int,input().split())
cnt = 0
end_flg = True

while end_flg:
    for i in range(input_n):

        if input_a[i] % 2 == 0:
            input_a[i] = input_a[i]/2

        else:
            end_flg = False
            break
    if end_flg == False:break
    cnt+=1

print(cnt)

Fixed submission:
input_n = input()
input_a = input().split()
cnt = 0
end_flg = True

while end_flg:
    for i in range(int(input_n)):

        if int(input_a[i]) % 2 == 0:
            input_a[i] = int(input_a[i])/2

        else:
            end_flg = False
            break
    if end_flg == False:break
    cnt+=1

print(cnt)
Buggy python submission (verdict: Runtime Error):
s = input()

ichi = 0
cnt = 0
l = len(s)

while True:
    s_dreamer = s.find ("dreamer",ichi,l)
    s_eraser = s.find ("eraser",ichi,l)
    s_dream = s.find ("dream",ichi,l)
    s_erase = s.find ("erase",ichi,l)


    if s_dream == ichi:
        ichi = s_dreamer + 7
        cnt += 7 

    elif s_eras == ichi:
        ichi = s_eraser + 6
        cnt += 6  

    elif s_dreamer == ichi:
        ichi = s_dream + 5
        cnt += 5  

    elif s_eraser == ichi:
        ichi = s_erase + 5
        cnt += 5

    elif cnt == l:
        print("YES")
        break

    else:
        print("NO")
        break

Fixed submission:
s = input()

ichi = 0
l = len(s)
cnt = l

while True:
    s_dreamer = s.rfind ("dreamer",ichi,l)
    s_eraser = s.rfind ("eraser",ichi,l)
    s_dream = s.rfind ("dream",ichi,l)
    s_erase = s.rfind ("erase",ichi,l)

    if s_dreamer == l - 7 and 0 <= l - 7:
        l = s_dreamer
        cnt -= 7 

    elif s_eraser == l - 6 and 0 <= l - 6:
        l = s_eraser
        cnt -= 6  

    elif s_dream == l - 5 and 0 <= l - 5:
        l = s_dream
        cnt -= 5  

    elif s_erase == l - 5 and 0 <= l - 5:
        l = s_erase
        cnt -= 5

    elif cnt == 0:
        print("YES")
        break

    else:
        print("NO")
        break
Buggy python submission (verdict: Runtime Error):
a = input().split()

a.sort()

print(a[-1] - a[0])

Fixed submission:
a = input().split()
b =[]
for i in a:
    b.append(int(i))
b.sort()

print(b[-1] - b[0])
Buggy python submission (verdict: Runtime Error):
a = int(input())
d = {
    25 : 'Christmas',
    24 : 'Christmas Eve Eve',
    23 : 'Christmas Eve Eve Eve'
}
print(d[a])

Fixed submission:
a = int(input())
d = {
    25 : 'Christmas',
    24 : 'Christmas Eve',
    23 : 'Christmas Eve Eve',
    22 : 'Christmas Eve Eve Eve'
}
print(d[a])
Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int, input().split(" ")))
s = input()
t = input()
if n<m:
  s, t = t, s
  n, m = m, n
def gcd(a,b):
  while b > 0:
    a, b = b, a % b
  return a
d = gcd(n, m)
l = n*m // d
a = ['' for i in range(l)]
res = l
for i in range(n):
  a[i*(l//n)] = s[i]
for i in range(m):
  if a[i*(l//m)]!='' and a[i*(l//m)]!=t[i]:
    res = -1
    break
print(res)

Fixed submission:
n, m = list(map(int, input().split(" ")))
s = input()
t = input()
def gcd(a,b):
  while b > 0:
    a, b = b, a % b
  return a
d = gcd(n, m)
l = n*m // d
res = l

s_sep = n//d
t_sep = m//d

for si,ti in zip(s[::s_sep], t[::t_sep]):
  if si!=ti:
    res = -1
    break
print(res)
Buggy python submission (verdict: Runtime Error):
N, T = list(map(int, input().split()))
paris = []
for i in range(N):
  c, t = list(map(int, input().split()))
  if t<=T:
    pairs.append((c, t))
if len(pairs)==0:
  print('TLE')
else:
  print(sorted(pairs, key=lambda p:p[0])[0][0])

Fixed submission:
N, T = list(map(int, input().split()))
pairs = []
for i in range(N):
  c, t = list(map(int, input().split()))
  if t<=T:
    pairs.append((c, t))
if len(pairs)==0:
  print('TLE')
else:
  print(sorted(pairs, key=lambda p:p[0])[0][0])
Buggy python submission (verdict: Runtime Error):
n, m = list(map(int, input().split(" ")))

ds = [x for x in range(1, m**.5+1) if m%x==0]
ds = ds + [m%x for x in ds]
ds = [x for x in ds if x<=m//n]
print(max(ds))

Fixed submission:
N, M = list(map(int, input().split(" ")))
def solv(N, M):
    d = M//N
    for i in range(d+1)[::-1]:
        if M%i == 0:
            return i
print(solv(N, M))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int, input().split()))
d = m//n+1
for x in range(d)[::-1]:
  if m%x==0:
    break
print(x)

Fixed submission:
N, M = list(map(int, input().split(" ")))
def solv(N, M):
    d = M//N
    for i in range(d+1)[::-1]:
        if M%i == 0:
            return i
print(solv(N, M))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int, input().split()))
for x in range(m//n+1)[::-1]:
  if m%x==0:
    break
print(x)

Fixed submission:
N, M = list(map(int, input().split(" ")))
def solv(N, M):
    d = M//N
    for i in range(d+1)[::-1]:
        if M%i == 0:
            return i
print(solv(N, M))

Buggy python submission (verdict: Time Limit Exceeded):
N, T = list(map(int, input().split()))
m = T//N
if T%N==0:
  print(m)
else:
  while m>0 and T%m!=0:
    m -= 1
  print(max(m, 1))
  

Fixed submission:
N, M = list(map(int, input().split(" ")))
def solv(N, M):
    d = M//N
    for i in range(d+1)[::-1]:
        if M%i == 0:
            return i
print(solv(N, M))
Buggy python submission (verdict: Runtime Error):
n, m, x, y = list(map(int, input().split()))
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

xs_max = max(xs)
ys_min = min(ys)
flag = True
for xi in range(xs+1, ys_min):
  if x<xi and xi<=y:
    print('No War')
    flag = False
    break
if flag:
  print('War')


Fixed submission:
n, m, x, y = list(map(int, input().split()))
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

xs_max = max(xs)
ys_min = min(ys)
#print(xs_max, ys_min)
flag = True
for xi in range(xs_max+1, ys_min+1):
  #print(xi)
  if x<xi and xi<=y:
    print('No War')
    flag = False
    break
if flag:
  print('War')
Buggy python submission (verdict: Time Limit Exceeded):

N, V = list(map(int, input().split()))
C = list(map(int, input().split()))
assert len(C)==N

W = [1 for i in range(N)]
F = [0 for i in range(V+1)]

def pack01(F, c, w):
    """
    f: states
    c: cost
    w: value

    v: volume
    """
    for v in range(c, V+1)[::-1]:
        F[v] = max(F[v], F[v-c]+w)
for i in range(N):
    pack01(F, C[i], W[i])

s = sum(C)
if s==V or s>V:
    print(F[-1])
elif sum(C)<V:
    print(F[-1]-1)
    

Fixed submission:
N, V = list(map(int, input().split()))
C = list(map(int, input().split()))
N = len(C)

if sum(C)==V:
  print(N)
else:
  cnt = 0
  for c in sorted(C):
    if V-c>0:
      cnt += 1
      V -= c
    elif V-c==0:
      cnt += 1
      break
    else:
      break
  print(min(cnt, N-1))
Buggy python submission (verdict: Time Limit Exceeded):
S = [i for i in input()]
T = [i for i in input()]
flag = 1
count1 = 0
count2 = 0
if(len(set(S))!=len(set(T))):
  flag = 0
for i in range(len(S)-1):
  if(S[i]==S[i+1]):
    count1 += S.count(S[i])
  if(T[i]==T[i+1]):
    count2 += T.count(T[i])
if(count1!=count2):
  flag = 0
if(flag==1):
  print("Yes")
else:
  print("No")


Fixed submission:
def main():
  S = [s for s in input()]
  T = [s for s in input()]
  R1 = [-1 for i in range(26)]
  R2 = [-1 for i in range(26)]
  for i in range(len(S)):
    a = ord(S[i]) % 26
    b = ord(T[i]) % 26
    if(R1[a] != -1 or R2[b] != -1):
      if(R1[a] != b or R2[b] != a):
        print("No")
        return
    else:
      R1[a]=b
      R2[b]=a
  print("Yes")
  return

main()
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
_ = input()
even = reduce(lambda x, y: x * y, list(map(int, input().split())))
i = 0
while even % 2 == 0:
    i = i + 1
    even = even // 2
print(i)

Fixed submission:
_ = input()
even = [int(i) for i in input().split() if int(i) % 2 == 0]
i = 0
while len(even) != 0:
    i = i + len(even)
    even = [i // 2 for i in even if (i // 2) % 2 == 0]
print(i)
Buggy python submission (verdict: Runtime Error):
H, W = (int(i) for i in input().split())
str = [input() for i in range(H)]
print(str)

for i in range(W+2):
        print("#", end = "")
print("")

for i in range(H):
        print("#", end = "")
        print(str[i], end = "")
        print("#")

for i in range(W+2):
        print("#", end = "")
print("")

Fixed submission:
listA = [1, 3, 5, 7, 8, 10, 12]
listB = [4, 6, 9, 11]
listC = [2]
a = {}
b = {}
c = {}

N = [int(i) for i in input().split()]

for i in range(2):
	a[i] = N[i] in listA
	b[i] = N[i] in listB
	c[i] = N[i] in listC


if a[0] == True and a[1] == True:
	print ("Yes")
elif b[0] == True and b[1] == True:
	print ("Yes")
elif c[0] == True and c[1] == True:
	print ("Yes")
else:
	print ("No")

Buggy python submission (verdict: Runtime Error):
listA = [1, 3, 5, 7, 8, 10, 12]
listB = [4, 6, 9, 11]
listC = [2]

N = [int(i) for i in input().split()]

for i in range(2):
	a[i] = N[i] in listA
	b[i] = N[i] in listB
	c[i] = N[i] in listC

if a[0] == a[1]:
	print "yes"
elif b[0] == b[1]:
	print "yes"
elif c[0] == c[1]:
	print "yes"
else:
	print "no"

Fixed submission:
listA = [1, 3, 5, 7, 8, 10, 12]
listB = [4, 6, 9, 11]
listC = [2]
a = {}
b = {}
c = {}

N = [int(i) for i in input().split()]

for i in range(2):
	a[i] = N[i] in listA
	b[i] = N[i] in listB
	c[i] = N[i] in listC


if a[0] == True and a[1] == True:
	print ("Yes")
elif b[0] == True and b[1] == True:
	print ("Yes")
elif c[0] == True and c[1] == True:
	print ("Yes")
else:
	print ("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
s1 = input()
s2 = input()
sum = 1
mul = 1
flag = 0
i = 0

while True:
    if i >= N:
        print(sum%1000000007)
        break

    elif s1[i]==s2[i] and flag==0:
        sum = 3
        i += 1
        flag = 1
    elif s1[i]!=s2[i] and flag==0:
        sum = 6
        i += 2
        flag = 2
    elif s1[i]==s2[i] and flag==1:
        mul = 2
        i += 1
        flag = 1
    elif s1[i]!=s2[i] and flag==1:
        mul = 2
        i += 2
        flag = 2
    elif s1[i]==s2[i] and flag==2:
        mul = 1
        i += 1
        flag = 1
    elif s1[i]!=s2[i] and flag==2:
        mul = 3
        i += 2
        flag = 2
    sum = sum*mul


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

bars.sort(reverse=True)

flag = 0
l = 0
l1 = 0
l2 = 0

for x in bars:
    if flag==0:
        l = x
        flag = 1
    elif flag==1 and x==l and l1==0:
        l1 = x
        l = 0
        flag = 0
    elif flag==1 and x==l and l1!=0:
        l2 = x
        break
    else:
        l = x
        flag = 1

print(l1 * l2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
l1 = input()
l2 = input()
result_f=[3,6]
result_g=[3,6]

def f(N, l1, l2):
    if N==1:
        return 3
    if N==2:
        return 6
    else:
        if l1[len(l1)-1]==l2[len(l2)-1]:
            if l1[len(l1)-2]==l2[len(l2)-2]:
                l1 = l1[:len(l1)-3]
                l2 = l2[:len(l2)-3]
                return f(N-1, l1, l2)*2
            else:
                l1 = l1[:len(l1)-2]
                l2 = l2[:len(l2)-2]
                return g(N-1, l1, l2)
        else:
            return g(N, l1, l2)

def g(N, l1, l2):
    if N==1:
        return 3
    if N==2:
        return 6
    if N==3:
        return 6
    else:
        if l1[len(l1)-1]!=l2[len(l2)-1]:
            if l1[len(l1)-3]==l2[len(l2)-3]:
                l1 = l1[:len(l1)-3]
                l2 = l2[:len(l2)-3]
                return f(N-2, l1, l2)*2
            else:
                l1 = l1[:len(l1)-3]
                l2 = l2[:len(l2)-3]
                return g(N-2, l1, l2)*3
        else:
            return f(N, l1, l2)

print(f(N, l1, l2)%1000000007)


Fixed submission:
N = int(input())
s1 = input()
s2 = input()
sum = 1
mul = 1
flag = 0
i = 0

while True:
    if i >= N:
        print(sum%1000000007)
        break

    elif s1[i]==s2[i] and flag==0:
        sum = 3
        i += 1
        flag = 1
    elif s1[i]!=s2[i] and flag==0:
        sum = 6
        i += 2
        flag = 2
    elif s1[i]==s2[i] and flag==1:
        mul = 2
        i += 1
        flag = 1
    elif s1[i]!=s2[i] and flag==1:
        mul = 2
        i += 2
        flag = 2
    elif s1[i]==s2[i] and flag==2:
        mul = 1
        i += 1
        flag = 1
    elif s1[i]!=s2[i] and flag==2:
        mul = 3
        i += 2
        flag = 2
    sum = sum*mul
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations


N, M = map(int,input().split())
ferris = [list(map(int, input().split())) for i in range(M)]

f = combinations(ferris, 2)
flag = 0
for f_ in f:
    if (f_[0][0]==1 and f_[1][1]==N and f_[0][1]==f_[1][0]) or (f_[1][0]==1 and f_[0][1]==N and f_[0][0]==f_[1][1]):
        print('POSSIBLE')
        flag = 1
        break

if flag==0:
    print('IMPOSSIBLE')


Fixed submission:
N, M = map(int, input().split())
ferry = [list(map(int, input().split())) for i in range(M)]

from_1 = [0 for i in range(N)]
to_N = [0 for i in range(N)]

for f in ferry:
    if f[0]==1:
        from_1[f[1]-1] = 1
    if f[1]==N:
        to_N[f[0]-1] = 1


flag = 0

for k in range(N):
    if from_1[k]==1 and to_N[k]==1:
        print('POSSIBLE')
        flag = 1
        break

if flag==0:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
ferris = [list(map(int, input().split())) for i in range(M)]

f1 =[]
fN = []
flag = 0

for f in ferris:
    if f[0]==1:
        f1.append(f)
    if f[1]==N:
        fN.append(f)

for f_1 in f1:
    if flag==0:
        for f_N in fN:
            if f_1[1]==f_N[0]:
                print('POSSIBLE')
                flag = 1
                break
            else:
                pass

if flag==0:
    print('IMPOSSIBLE')


Fixed submission:
N, M = map(int, input().split())
ferry = [list(map(int, input().split())) for i in range(M)]

from_1 = [0 for i in range(N)]
to_N = [0 for i in range(N)]

for f in ferry:
    if f[0]==1:
        from_1[f[1]-1] = 1
    if f[1]==N:
        to_N[f[0]-1] = 1


flag = 0

for k in range(N):
    if from_1[k]==1 and to_N[k]==1:
        print('POSSIBLE')
        flag = 1
        break

if flag==0:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
a,b=map[int,input().split()]

if a+b<10:
  print(a+b)
else:
  print("error")

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

if a+b<10:
  print(a+b)
else:
  print("error")

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

if c<10:
  print(c)
else:
  print('error')

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

if a+b<10:
  print(a+b)
else:
  print("error")

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

b=int(input())

if a+b<10:
  print('%d',a+b)
else:
  print('error')

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

if a+b<10:
  print(a+b)
else:
  print("error")

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

b=input()

if a+b<10:
  print('%d',a+b)
else:
  print('error')

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

if a+b<10:
  print(a+b)
else:
  print("error")

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

b=input()

if int(a)+int(b)<10:
  print(a+b)
else:
  print('error')
  


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

if a+b<10:
  print(a+b)
else:
  print("error")

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

if c>=10:
  print('error')
  
  else:
    print(a+b)


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

if a+b<10:
  print(a+b)
else:
  print("error")

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=a+b

if c>=10:
  print('error')
  
  else:
    print('c')


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

if a+b<10:
  print(a+b)
else:
  print("error")

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=a+b
if c>=10:
  print('error')
  
  else:
    print(c)


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

if a+b<10:
  print(a+b)
else:
  print("error")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input(),split())

if c>=a and b<=a:
  print("Yes")
else:
  print("No")

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

if c>=a and c<=b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import math

def comb(n,m):
    return math.factorial(n) // (math.factorial(n-m)*math.factorial(m))

n = int(input())
a = list(map(int, input().split()))

a_max = 0

for ai in a:
    a_max = max(a_max, ai)

res_max = -1
m = -1

for ai in a:
    if ai == a_max:
        continue

    c = comb(a_max, ai)

    if c > res_max:
        res_max = c
        m = ai

print(a_max, m)


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

a_max = 0

for ai in a:
    a_max = max(a_max, ai)

if a[0] != a_max:
    m = a[0]
else:
    m = a[1]

for ai in a:
    if ai == a_max or ai == m:
        continue

    if ai > m and ai < a_max - m:
        m = ai
    elif ai < m and ai > a_max - m:
        m = ai

print(a_max, m)
Buggy python submission (verdict: Runtime Error):
import math

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

A_row = math.ceil((A-1)/50)
if A_row == 0:
    A_row = 1
A_row_full = (A-1)//50
B_row = math.ceil((B-1)/50)
if B_row == 0:
    B_row = 1
B_row_full = (B-1)//50

print("100 ", (A_row+B_row)*2)

A_mod = (A-1)%50
B_mod = (B-1)%50

if A_row == A_row_full:
    A_add = ''
else:
    A_add = '.#'

if B_row == B_row_full:
    B_add = ''
else:
    B_add = '.#'
    

for i in range(50):
    print('.#'*A_row_full + (A_add if i < A_mod else '##') + '.#'*B_row_full + (B_add if i < B_mod else '..'))
    print('##'*A_row + '..'*B_row)


Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())

densha = min(A,B)
bus = min(C,D)

print(densha+bus)
Buggy python submission (verdict: Runtime Error):

import math

def regular(i1, i2, res1, res2):
    return ((i1 % 2 == i2 % 2) and not (res1 == res2)) or (not (i1 % 2 == i2 % 2) and (res1 == res2))

def search(range_list, result_list):

    print(range_list)
    next_range_list = []
    next_result_list = []

    for r in zip(range_list, result_list):
        rng = r[0]
        result = r[1]
        half = rng[0] + math.floor((rng[1] - rng[0])/2)

        res = input()

        if res == 'Vacant':
            return
        else:
            if rng[0] == rng[1]:
                return

            if regular(result[0], half, result[1], res):
                next_range_list.append((rng[0], half - 1))
                next_range_list.append((half + 1, rng[1]))
                next_result_list.append((half, res))
                next_result_list.append((half, res))

            else:
                search([(rng[0], half - 1)], [(half, res)])
                return


    search(next_range_list, next_result_list)

def main():
    N = int(input())

    print(0)
    res1 = input()
    half = math.floor(N/2)
    print(half)
    res2 = input()

    if res1 == 'Vacant' or res2 == 'Vacant':
        return

    range_list = []
    result_list = []

    if regular(0, half, res1, res2):
        if 1 <= half-1:
            range_list.append((1, half-1))
            result_list.append(0, res1)
        if half+1 <= N-1:
            range_list.append((half + 1, N-1))
            result_list.append(half, res2)
    else:
        if 1 <= half - 1:
            range_list = [(1, half-1)]
            result_list = [(0, res1)]
        else:
            range_list = [(half+1, N-1)]
            result_list = [(half, res2)]

    search(range_list, result_list)

main()


Fixed submission:

import math
import sys

def isBetween(i1, i2, res1, res2):
    return (i1 % 2 == i2 % 2) != (res1 == res2)

def search(s_range, isLeft, result):
    half = s_range[0] + math.floor((s_range[1] - s_range[0])/2)
    print(half)
    res = input()

    if res == 'Vacant':
        return

    if isLeft:
        if isBetween(s_range[0]-1, half, result, res):
            search((s_range[0], half-1), False, res)
        else:
            search((half+1, s_range[1]), True, res)
    else:
        if isBetween(half, s_range[1]+1, res, result):
            search((half+1, s_range[1]), True, res)
        else:
            search((s_range[0], half-1), False, res)


def main():
    N = int(input())

    print(0)
    res = input()

    s_range = (1, N-1)
    search(s_range, True, res)

main()
Buggy python submission (verdict: Runtime Error):
l = sorted(ist(map(int, input().split())))
print(l[0] + int(str(l[1]) + str(l[2])))

Fixed submission:
l = sorted(list(map(int, input().split())))
print(l[0] + int(str(l[2]) + str(l[1])))
Buggy python submission (verdict: Runtime Error):
n = input()
nl = [int(i) for i in n]
ns = sum(nl)
print(["No", "Yes"][n % ns == 0])

Fixed submission:
n = input()
nl = [int(i) for i in n]
ns = sum(nl)
print(["No", "Yes"][int(n) % ns == 0])