Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
s = ''
for i in range(n):
    s += 'b'*a + 'r'*b
    if len(s) >= n: break
print(s[:n].count('b'))

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

if a == 0:
    print(0)
elif a+b >= n:
    print(a) if a <= n else print(n)
else:
    ab = a + b
    ans = n // ab * a
    ans += a if n % ab > a else n % ab 
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
mode = True
for _ in range(q):
    tfc = input().split()
    if int(tfc[0]) == 1:
        mode = not mode
    else:
        if mode:
            s = tfc[2]+s if int(tfc[1]) == 1 else s+tfc[2]
        else:
            s = s+tfc[2] if int(tfc[1]) == 1 else tfc[2]+s
print(s if mode else s[::-1])

Fixed submission:
s = input()
q = int(input())
mode = True
l = ''
r = ''
for _ in range(q):
    tfc = input().split()
    if int(tfc[0]) == 1:
        mode = not mode
    else:
        if mode:
            if int(tfc[1]) == 1:
                l += tfc[2]
            else:
                r += tfc[2]
        else:
            if int(tfc[1]) == 1:
                r += tfc[2]
            else:
                l += tfc[2]
print(l[::-1]+s+r if mode else r[::-1]+s[::-1]+l)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
mode = True
for _ in range(q):
    tfc = input().split()
    if int(tfc[0]) == 1:
        mode = not mode
    else:
        if mode == 1:
            s = tfc[2]+s if int(tfc[1]) == 1 else s+tfc[2]
        else:
            s = s+tfc[2] if int(tfc[1]) == 1 else tfc[2]+s
print(s if mode else s[::-1])

Fixed submission:
s = input()
q = int(input())
mode = True
l = ''
r = ''
for _ in range(q):
    tfc = input().split()
    if int(tfc[0]) == 1:
        mode = not mode
    else:
        if mode:
            if int(tfc[1]) == 1:
                l += tfc[2]
            else:
                r += tfc[2]
        else:
            if int(tfc[1]) == 1:
                r += tfc[2]
            else:
                l += tfc[2]
print(l[::-1]+s+r if mode else r[::-1]+s[::-1]+l)
Buggy python submission (verdict: Time Limit Exceeded):
n,p = map(int, input().split())
s = input()
ans = 0
for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        if int(s[i:j]) % p == 0:
            ans += 1
print(ans)

Fixed submission:
n,p = map(int, input().split())
s = input()
ans = 0
ruisekiwa = [0]*(n+1)
ten = 1

if 10 % p == 0:
    for i in range(n):
        if int(s[i]) % p == 0:
            ans += i+1
else:
    for i in range(0, n)[::-1]:
        a =  int(s[i]) * ten % p
        ruisekiwa[i] = (ruisekiwa[i+1] + a) % p
        ten *= 10
        ten %= p

    cnt = [0]*p
    for i in range(0, n+1)[::-1]:
        ans += cnt[ruisekiwa[i]]
        cnt[ruisekiwa[i]] += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for _ in range(N)]
AA = sorted(A)
maxAA = max(AA)
for i in A:
    if maxAA == i:
        print(AA[-2])
    else:
        print(maxAA)

Fixed submission:
r = int(input())
print(3*(r**2))
Buggy python submission (verdict: Runtime Error):
import re
n = int(input())
s = input()
if not '#' in s:
    print(0)
else:
    s = '#.' + s.split('#.', 1)[-1] if '#.' in s else  s
    ptn = re.search(re.compile('\.#+?$'), s)
    if ptn:
        s = s[:ptn.end()]
    print(min(s.count('.'), s.count('#')))

Fixed submission:
a,b,c = map(int, input().split())
lst = list(range(min(a,b), max(a,b)+1))
if c in lst:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import re
n = int(input())
s = input()
if not '#' in s:
    print(0)
else:
    s = s.rsplit('.#', 1)[0] + '.#' if '.#' in s else  s
    ptn = re.search(re.compile('\.#+?$'), s)
    if ptn:
        s = s[:ptn.start()]
    print(min(s.count('.'), s.count('#')))

Fixed submission:
a,b,c = map(int, input().split())
lst = list(range(min(a,b), max(a,b)+1))
if c in lst:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
a = []
b = []
ans = 0

for i in range(N):
    store = input().split()
    a.append(int(store[0]))
    b.append(int(store[1]))

nokori = M
max_ = max(a)
for i in range(M):
    if nokori >= 1:
        index = a.index(min(a))
        if b[index] != 0 and nokori - (b[index]) >= 0:
            ans += a[index] * b[index]
            nokori -= b[index]
            a[index] = max_ + 1
            b[index] = 0
        else:
            ans += a[index] * nokori
            break
    else:
        break
print(ans)

Fixed submission:
N,M = map(int, input().split())
ab = []
ans = 0

for i in range(N):
    ab.append(list(map(int, input().split())))
ab = sorted(ab)
nokori = M
for i in ab:
    if nokori - i[1] >= 0:
        ans += i[0] * i[1]
        nokori -= i[1]
    else:
        ans += i[0] * nokori
        break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
a = []
b = []
ans = 0

for i in range(N):
    store = input().split()
    a.append(int(store[0]))
    b.append(int(store[1]))

nokori = M
for i in range(M):
    if nokori >= 1:
        index = a.index(min(a))
        if nokori - (b[index]) >= 0:
            ans += a[index] * b[index]
            nokori -= b[index]
            a.pop(index)
            b.pop(index)
        else:
            ans += a[index] * nokori
            break
    else:
        break
print(ans)

Fixed submission:
N,M = map(int, input().split())
ab = []
ans = 0

for i in range(N):
    ab.append(list(map(int, input().split())))
ab = sorted(ab)
nokori = M
for i in ab:
    if nokori - i[1] >= 0:
        ans += i[0] * i[1]
        nokori -= i[1]
    else:
        ans += i[0] * nokori
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A,B = map(int, input().split())
xor = str(A)
for i in range(B-A):
    xor += ' ^ '+str(A+i+1)

print(eval(xor))

Fixed submission:
def calc(a):
    val = int((a+1) / 2)
    ans = (val % 2) ^ a if a % 2 == 0 else val % 2
    return ans
A,B = map(int, input().split())

print(calc(A -1) ^ calc(B))
Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

N = int(input())
A = list(map(int,input().split()))

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

print(gcd(*A))

Fixed submission:
A,B = map(int,input().split())

if int(B % A) == 0:
    print(A+B)
else:
    print(B-A)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = list(map(int,input().split()))

if n >= m:
    print(0)
else:
    x = sorted(x)
    x = [x[i+1]-x[i] for i in range(len(x)-1)]

    x = sorted(x, reverse=True)
    x = xx[n-1:]
    ans = 0
    for i in x:
        ans+=i
    print(ans)


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

if n >= m:
    print(0)
else:
    x = sorted(x)
    xx = [x[i+1]-x[i] for i in range(len(x)-1)]

    xx = sorted(xx, reverse=True)
    xx = xx[n-1:]
    ans = 0
    for i in xx:
        ans+=i
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
a = 1
for i in range(N):
  a *= lis[i]
if a <= 10**18:
  print(a)
else:
  print('-1')

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
a = 1
tf = True
zero = False
for k in range(N):
  if lis[k] == 0:
    zero = True
if not zero:
  for i in range(N):
    a *= lis[i]
    if a > 10**18:
      tf = False
      break
if zero:
  print(0)
else:
  if tf:
    print(a)
  else:
    print('-1')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = []
indexes = []
cou = 1
ans = []
for _ in range(N):
  lis.append(input())
lis.sort()
if len(lis) != len(set(lis)):
  lis.append(999)
  for i in range(N):
    if lis[i] == lis[i+1]:
      cou += 1
    else:
      indexes.append(cou)
      cou = 1
  L = len(indexes)
  M = max(indexes)
  for k in range(L):
    if indexes[k] == M:
      ans.append(lis[sum(indexes[:k])])
  print(*ans)
else:
  print(*lis)

Fixed submission:
N = int(input())
lis = []
indexes = []
cou = 1
ans = []
c_p = 0
for _ in range(N):
  lis.append(input())
lis.sort()
if len(lis) != len(set(lis)):
  lis.append("zzzzzzzzzzzzzz")
  for i in range(N):
    if lis[i] == lis[i+1]:
      cou += 1
    else:
      indexes.append(cou)
      cou = 1
  L = len(indexes)
  M = max(indexes)
  for k in range(L):
    if indexes[k] == M:
      ans.append(lis[c_p])
    c_p += indexes[k]
  print(*ans)
else:
  print(*lis)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = []
indexes = []
cou = 1
ans = []
for _ in range(N):
  lis.append(input())
lis.sort()
if len(lis) != len(set(lis)):
  lis.append(999)
  for i in range(N):
    if lis[i] == lis[i+1]:
      cou += 1
    else:
      indexes.append(cou)
      cou = 1
  L = len(indexes)
  M = max(indexes)
  for k in range(L):
    if indexes[k] == M:
      ans.append(lis[sum(indexes[:k])])
  ans.sort()
  print(*ans)
else:
  print(*lis)

Fixed submission:
N = int(input())
lis = []
indexes = []
cou = 1
ans = []
c_p = 0
for _ in range(N):
  lis.append(input())
lis.sort()
if len(lis) != len(set(lis)):
  lis.append("zzzzzzzzzzzzzz")
  for i in range(N):
    if lis[i] == lis[i+1]:
      cou += 1
    else:
      indexes.append(cou)
      cou = 1
  L = len(indexes)
  M = max(indexes)
  for k in range(L):
    if indexes[k] == M:
      ans.append(lis[c_p])
    c_p += indexes[k]
  print(*ans)
else:
  print(*lis)
Buggy python submission (verdict: Runtime Error):
N = int(input())
import numpy as np
ans = 0
lis = [[0]*9]*9
lis = np.array(lis)
for i in range(1,N+1):
    a = i%10
    b = i//(10**(len(str(i))-1))
    if a != 0:
        lis[a-1][b-1] += 1
for j in range(9):
    for k in range(9):
        ans += lis[k][j]*lis[j][k]
print(ans)

Fixed submission:
N = int(input())
import numpy as np
ans = 0
lis = [[0]*9]*9
lis = np.array(lis)
for i in range(1,N+1):
    a = i%10
    b = i//(10**(len(str(i))-1))
    if a != 0:
        lis[a-1][b-1] += 1
for j in range(9):
    for k in range(9):
        ans += lis[k][j]*lis[j][k]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
lis = []
from functools import reduce
import fractions
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)
lc = lcm(A)
for i in range(n):
    lis.append(lc//A[i])
print(sum(lis) % (10**9+7))

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
ans = 0
from functools import reduce
import fractions
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)
lc = lcm(A)
for i in range(n):
    ans += lc//A[i]
print(ans % (10**9+7))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(a, b))

Fixed submission:
a,b = map(int,input().split())
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
print(lcm(a, b))
Buggy python submission (verdict: Runtime Error):
 N,K = map(int,input().split())
S = list(input())
happy = 0
L = 0
R = 0
for i in range(N-1):
  if S[i] == S[i+1]:
    happy += 1
  elif S[i] == 'L' and S[i+1] == 'R':
    L += 1
  else:
    R += 1
if min(R,L) >= K:
  happy += K*2
else:
  happy += min(R,L) + K
if happy <= len(S) - 1:
  print(happy)
else:
  print(len(S) - 1)

Fixed submission:
N,K = map(int,input().split())
S = list(input())
happy = 0
L = 0
R = 0
for i in range(N-1):
  if S[i] == S[i+1]:
    happy += 1
  elif S[i] == 'L' and S[i+1] == 'R':
    L += 1
  else:
    R += 1
if min(R,L) >= K:
  happy += K*2
else:
  happy += min(R,L) + K
if happy <= len(S) - 1:
  print(happy)
else:
  print(len(S) - 1)
Buggy python submission (verdict: Time Limit Exceeded):
LR = list(map(int,input().split()))
L = LR[0]
R = LR[1]
K = 2018
for j in range(L,R+1):
    for i in range(L,j):
        if K > (i*j)%2019:
            K =  (i*j)%2019
print(K)

Fixed submission:
LR = list(map(int,input().split()))
L = LR[0]
R = LR[1]
K = 2018
if R - L> 2019:
    K = 0
else:
    for j in range(L,R+1):
        for i in range(L,j):
            if K > (i*j)%2019:
                K =  (i*j)%2019
print(K)

Buggy python submission (verdict: Time Limit Exceeded):
LR = list(map(int,input().split()))
L = LR[0]
R = LR[1]
Lis = []
for j in range(L,R+1):
    for i in range(L,j):
        Lis.append((i*j)%2019)
print(min(Lis))

Fixed submission:
LR = list(map(int,input().split()))
L = LR[0]
R = LR[1]
K = 2018
if R - L> 2019:
    K = 0
else:
    for j in range(L,R+1):
        for i in range(L,j):
            if K > (i*j)%2019:
                K =  (i*j)%2019
print(K)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
gcdcd = c*d//int(math.gcd(c,d))
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)


Fixed submission:
a,b,c,d = (map(int,input().split()))
import fractions
gcdcd = c*d//int(fractions.gcd(c,d))
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
gcdcd = c*d//math.gcd(c,d)
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)


Fixed submission:
a,b,c,d = (map(int,input().split()))
import fractions
gcdcd = c*d//int(fractions.gcd(c,d))
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
gcdcd = math.lcm(c,d)
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)


Fixed submission:
a,b,c,d = (map(int,input().split()))
import fractions
gcdcd = c*d//int(fractions.gcd(c,d))
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
gcdcd = math.lcm(c,d)
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)


Fixed submission:
a,b,c,d = (map(int,input().split()))
import fractions
gcdcd = c*d//int(fractions.gcd(c,d))
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
gcdcd = math.gcd(c,d)
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)

Fixed submission:
a,b,c,d = (map(int,input().split()))
import fractions
gcdcd = c*d//int(fractions.gcd(c,d))
e = a-1
print( b - b//c - b//d + b//gcdcd - e + e//c + e//d - e//gcdcd)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [None]*N
for i in range(N):
  A[i] = list(map(int,input().split()))
A.sort(key = lambda x:x[1])
B = [0]*len(A)
C = [0]*len(A)
for b in range(len(A)):
  B[b] = A[b][0]
for c in range(len(A)):
  C[c] = A[c][1]
jud = 'Yes'
for j in range(N):
  if sum(B[:j+1]) > C[j]:
    jud = 'No'
    #print(C[j])
    #print(B[:j+1])
print(jud)

Fixed submission:
N = int(input())
A = [None]*N
for i in range(N):
  A[i] = list(map(int,input().split()))
A.sort(key = lambda x:x[1])
B = [0]*len(A)
C = [0]*len(A)
for b in range(len(A)):
  B[b] = A[b][0]
for c in range(len(A)):
  C[c] = A[c][1]
jud = 'Yes'
Sum = 0
for j in range(N):
  Sum += B[j]
  if Sum > C[j]:
    jud = 'No'
    #print(C[j])
    #print(B[:j+1])
print(jud)
Buggy python submission (verdict: Runtime Error):
W,H,x,y = map(int,input())
if x == W/2 and y == H/2:
  print(W*H/2,1)
else:
  print(W*H/2,0)



Fixed submission:
W,H,x,y = map(int,input().split())
if x == W/2 and y == H/2:
  print(W*H/2,1)
else:
  print(W*H/2,0)
Buggy python submission (verdict: Runtime Error):
A, B = int(input().split())
return (A*3 + B)//2 

Fixed submission:
A,P = map(int,input().split())
print((3*A+P)//2)

Buggy python submission (verdict: Runtime Error):
A, B = input().split()
return (A*3 + B)//2

Fixed submission:
A,P = map(int,input().split())
print((3*A+P)//2)
Buggy python submission (verdict: Runtime Error):
lis = list(map(int, input().split()))
if lis[0] => 13:
	print(lis[1])
elif lis[0]>5 and lis[0]<13:
	print(lis[1]/2)
else:
	print(0)

Fixed submission:
lis = list(map(int,input().split()))
if lis[0] >= 13:
	print(lis[1])
elif lis[0] >= 6 and lis[0] <= 13:
	print(int(lis[1]/2))
else:
	print(0)

Buggy python submission (verdict: Runtime Error):
lis = list(map(int, input().split()))
if lis[0] => 13:
	return lis[1]
elif lis[0]>5 and lis[0]<13:
	return lis[1]/2
else:
	return 0

Fixed submission:
lis = list(map(int,input().split()))
if lis[0] >= 13:
	print(lis[1])
elif lis[0] >= 6 and lis[0] <= 13:
	print(int(lis[1]/2))
else:
	print(0)

Buggy python submission (verdict: Runtime Error):
lis = list(map(int, input().split())
if lis[0] => 13:
           return lis[1]
	elif lis[0]>5 and lis[0]<13:
           return lis[1]/2
	else:
           return 0

Fixed submission:
lis = list(map(int,input().split()))
if lis[0] >= 13:
	print(lis[1])
elif lis[0] >= 6 and lis[0] <= 13:
	print(int(lis[1]/2))
else:
	print(0)
Buggy python submission (verdict: Runtime Error):
N_M = list(map(int, input().split()))
Lock_min = []
Lock_max = []
for i in range(N_M[1]):
    ADD = list(map(int,input().split()))
    Lock_min.append(ADD[0])
    Lock_max.append(ADD[1])
if min(Lock_max) - max(Lock_min) >= 1:
        print(min(Lock_max) - max(Lock_min))
 else:
        print(0)

Fixed submission:
N,M = map(int,input().split())
L = [0]*M
R = [0]*M
for i in range(M):
  l,r = map(int,input().split())
  L[i] = l
  R[i] = r
if min(R)-max(L) >= 0:
  print(min(R)-max(L)+1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())

if A>B:
	print(A*2-1)
elif A=B:
	print(A+B)
else:
	print(B*2-1)

Fixed submission:
A,B = map(int,input().split())
 
if A>B:
	print(A*2-1)
elif A==B:
	print(A+B)
else:
	print(B*2-1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = [int(input().split())]
 
ans = 1
for i in range(N):
    if  L[:i]>L[i]:
        continue
    else:
        ans = ans+1

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
NowHeight = 0
ans = 0
for i in range(N):
  if NowHeight <= H[i]:
    NowHeight = H[i]
    ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = map[int,input().split()]

ans = 1
for i in L
	if  L(:i)>L(i):
		continue
    else:
		ans = ans+1

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
NowHeight = 0
ans = 0
for i in range(N):
  if NowHeight <= H[i]:
    NowHeight = H[i]
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
lis = [int(input()) for _ in range(6)]
if lis[0]/min(lis[1:]) == 1:
  print(5)
else:
  print(lis[0]//min(lis[1:])+5)

Fixed submission:
From0 = ['0','1']*(10**6)
From1 = ['1','0']*(10**6)
s = list(input())
F0 = From0[:len(s)]
F1 = From1[:len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))

Buggy python submission (verdict: Runtime Error):
lis = [int(input()) for _ in range(6)]
if lis[0] % min(lis[1:]) == 0:
  print(5)
else:
  print(lis[0]//min(lis[1:])+5)
  

Fixed submission:
From0 = ['0','1']*(10**6)
From1 = ['1','0']*(10**6)
s = list(input())
F0 = From0[:len(s)]
F1 = From1[:len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))

Buggy python submission (verdict: Runtime Error):
lis = [int(input()) for _ in range(6)]
if lis[0] % min(lis[1:]) == 0:
  print(5)
else:
  print(lis[0]//min(lis[1:])+5)

Fixed submission:
From0 = ['0','1']*(10**6)
From1 = ['1','0']*(10**6)
s = list(input())
F0 = From0[:len(s)]
F1 = From1[:len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))

Buggy python submission (verdict: Runtime Error):
From0 = ['0','1']*(10**6)
From1 = ['1','0']*(10**6)
s = list(input())
F0 = From0[::len(s)]
F1 = From1[::len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))


Fixed submission:
From0 = ['0','1']*(10**6)
From1 = ['1','0']*(10**6)
s = list(input())
F0 = From0[:len(s)]
F1 = From1[:len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))

Buggy python submission (verdict: Runtime Error):
From0 = ['0','1']*(10**5)
From1 = ['1','0']*(10**5)
s = list(input())
F0 = From0[::len(s)]
F1 = From1[::len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))

Fixed submission:
From0 = ['0','1']*(10**6)
From1 = ['1','0']*(10**6)
s = list(input())
F0 = From0[:len(s)]
F1 = From1[:len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))
Buggy python submission (verdict: Runtime Error):
a = map(int,input())
b = map(int,input())
c = map(int,input())
d = map(int,input())
e = map(int,input())
k = map(int,input())

List = list(a,b,c,d,d,e)
if max(List)-min(List) <= k:
	print("Yay!")
else<
	print(":(")

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

List = [a,b,c,d,e]
if max(List) - min(List) <= k:
	print("Yay!")
else:
	print(":(")
Buggy python submission (verdict: Runtime Error):
lis = [int(input()) for _ in range(6)]
print(lis(0)//min(lis[1:])+5)


Fixed submission:
lis = [int(input()) for _ in range(6)]
if lis[0] % min(lis[1:]) == 0:
  print(lis[0]//min(lis[1:])+4)
else:
  print(lis[0]//min(lis[1:])+5)
Buggy python submission (verdict: Runtime Error):
S = list(input())
count = 1 if S[0] in lis else 0
lis = ['A','T','C','G']
ans = 1 if S[0] in lis else 0
for i in range(1,len(S)):
  if S[i] in lis:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
print(ans)
    

Fixed submission:
S = list(input())
S.append('fuck')
lis = ['A','T','C','G']
count = 1 if S[0] in lis else 0
ans = 1 if S[0] in lis else 0
for i in range(1,len(S)):
  if S[i] in lis:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
Lis = list(map(int,input().split()))
ans = 0
for k in range(Lis[0]+1):
    if k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 <= Lis[2] and k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 >= Lis[1]:
        ans += k
if N == 10000:
           print(ans+10000)
else:
           print(ans)
        

Fixed submission:
Lis = list(map(int,input().split()))
ans = 0
for k in range(Lis[0]+1):
    if k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 <= Lis[2] and k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 >= Lis[1]:
        ans += k
if Lis[0] == 10000 and Lis[1]<2:
           print(ans+10000)
else:
           print(ans)

Buggy python submission (verdict: Runtime Error):
Lis = list(map(int,input().split()))
ans = 0
for k in range(Lis[0]+1):
    if k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 <= Lis[2] and k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 >= Lis[1]:
        ans += k
if N == 10000:
           print(ans+10000)
else:
           print(ans)
        

Fixed submission:
Lis = list(map(int,input().split()))
ans = 0
for k in range(Lis[0]+1):
    if k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 <= Lis[2] and k%10 + (k//10)%10 + (k//100)%10 + (k//1000)%10 >= Lis[1]:
        ans += k
if Lis[0] == 10000 and Lis[1]<2:
           print(ans+10000)
else:
           print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
i=list(map(int,input().split()))
s=1
for a in i:
    s=s*a
if s>10**18:
    print(-1)
else:
    print(s)

Fixed submission:
n=int(input())
i=list(map(int,input().split()))
s=1
i=sorted(i,reverse=True)
for a in i:
    s=s*a
    if s>10**18:
        s=-1
        break
if i[-1]==0:
    print("0")
else:
    print(s)