Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    v = list(map(int, input().split()))
    v_ki = v[1:N:2].copy()
    val_ki = [i+1 for i in range(10**5)]
    count_ki = [0] * (10**5)
    v_gu = v[0:N:2].copy()
    val_gu = [i+1 for i in range(10**5)]
    count_gu = [0] * (10**5)
    for i in range(N//2):
        count_ki[v_ki[i]] += 1
        count_gu[v_gu[i]] += 1
    
    ki = list(zip(count_ki, val_ki))
    ki.sort()
    ki_len = len(ki)
    gu = list(zip(count_gu, val_gu))
    gu.sort()
    gu_len = len(gu)
    if ki[-1][1] != gu[-1][1]:
        return N-ki[-1][0]-gu[-1][0]
    else:
        return min(N-ki[-2][0]-gu[-1][0], N-ki[-1][0]-gu[-2][0])

if __name__ == "__main__":
    print(main())


Fixed submission:
def main():
    N = int(input())
    v = list(map(int, input().split()))
    v_ki = v[1:N:2].copy()
    val_ki = [i+1 for i in range(10**5)]
    count_ki = [0] * (10**5)
    v_gu = v[0:N:2].copy()
    val_gu = [i+1 for i in range(10**5)]
    count_gu = [0] * (10**5)
    for i in range(N//2):
        count_ki[v_ki[i]-1] += 1
        count_gu[v_gu[i]-1] += 1
    
    ki = list(zip(count_ki, val_ki))
    ki.sort()
    gu = list(zip(count_gu, val_gu))
    gu.sort()
    if ki[-1][1] != gu[-1][1]:
        return N-ki[-1][0]-gu[-1][0]
    else:
        return min(N-ki[-2][0]-gu[-1][0], N-ki[-1][0]-gu[-2][0])

if __name__ == "__main__":
    print(main())

Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    v = list(map(int, input().split()))
    v_ki = v[1:N:2].copy()
    val_ki = [i+1 for i in range(10**5)]
    count_ki = [0] * (10**5)
    v_gu = v[0:N:2].copy()
    val_gu = [i+1 for i in range(10**5)]
    count_gu = [0] * (10**5)
    for i in range(N//2):
        count_ki[v_ki[i]] += 1
        count_gu[v_gu[i]] += 1
    
    ki = list(zip(count_ki, val_ki))
    ki.sort()
    ki_len = len(ki)
    gu = list(zip(count_gu, val_gu))
    gu.sort()
    gu_len = len(gu)
    if ki[-1][1] != gu[-1][1]:
        return N-(ki[-1][0])-(gu[-1][0])
    elif ki_len == gu_len:
        return N//2
    else:
        return min(N-(ki[-2][0])-(gu[-1][0]), N-(ki[-1][0])-(gu[-2][0]))

if __name__ == "__main__":
    print(main())


Fixed submission:
def main():
    N = int(input())
    v = list(map(int, input().split()))
    v_ki = v[1:N:2].copy()
    val_ki = [i+1 for i in range(10**5)]
    count_ki = [0] * (10**5)
    v_gu = v[0:N:2].copy()
    val_gu = [i+1 for i in range(10**5)]
    count_gu = [0] * (10**5)
    for i in range(N//2):
        count_ki[v_ki[i]-1] += 1
        count_gu[v_gu[i]-1] += 1
    
    ki = list(zip(count_ki, val_ki))
    ki.sort()
    gu = list(zip(count_gu, val_gu))
    gu.sort()
    if ki[-1][1] != gu[-1][1]:
        return N-ki[-1][0]-gu[-1][0]
    else:
        return min(N-ki[-2][0]-gu[-1][0], N-ki[-1][0]-gu[-2][0])

if __name__ == "__main__":
    print(main())
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0

    s = [0 for _ in range(N)]
    for i in range(N):
        if i == 0:
            s[i] = A[i]
        else:
            s[i] = s[i-1] + A[i]
    count += s.count(0)

    for i in range(N-1):
        del s[0]
        for j in range(len(s)):
            s[j] -= A[i]
        count += s.count(0)

    return count

if __name__ == '__main__':
    print(main())


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0

    s = [0 for _ in range(N+1)]
    for i in range(N):
        s[i+1] = s[i] + A[i]
    s.sort()
    n = 1
    for i in range(N):
        if s[i+1] == s[i]:
            n+=1
        else:
            count += n*(n-1)//2
            n = 1
    count += n*(n-1)//2
    return count

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0
    for i in range(0, N):
        b = 0
        for j in range(i, N):
            if j==i:
                b = A[i]
            else:
                b = b + A[j]
            if b == 0:
                count += 1
    return count

if __name__ == '__main__':
    print(main())



Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0

    s = [0 for _ in range(N+1)]
    for i in range(N):
        s[i+1] = s[i] + A[i]
    s.sort()
    n = 1
    for i in range(N):
        if s[i+1] == s[i]:
            n+=1
        else:
            count += n*(n-1)//2
            n = 1
    count += n*(n-1)//2
    return count

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0
    for i in range(1, N+1):
        for j in range(N-i+1):
            if sum(A[j:j+i]) == 0:
                count += 1
    return count

if __name__ == '__main__':
    print(main())



Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0

    s = [0 for _ in range(N+1)]
    for i in range(N):
        s[i+1] = s[i] + A[i]
    s.sort()
    n = 1
    for i in range(N):
        if s[i+1] == s[i]:
            n+=1
        else:
            count += n*(n-1)//2
            n = 1
    count += n*(n-1)//2
    return count

if __name__ == '__main__':
    print(main())
Buggy python submission (verdict: Time Limit Exceeded):
import math
def comb(n,r):
   return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))

def main():
   N = int(input())
   a = list(map(int, input().split()))
   a.sort()
   if N==2:
      return str(max(a))+" "+str(min(a))

   k = a[N//2-1]
   kk = a[N//2]
   A = a[N-1]
   if comb(A,k) > comb(A,kk):
      return str(A)+" "+str(k)
   return str(a[N-1])+" "+str(kk)



print(main())



Fixed submission:

def main():
   N = int(input())
   a = list(map(int, input().split()))
   a.sort()
   A = a.pop()
   k = A/2
   for i in a:
      if k - i == 0:
         B = i
         break
      else:
         sa = k - i
         if sa < 0:
            if abs(B-k)>abs(sa):
               B = i
            break
         B = i
   return str(A)+" "+str(B)
         


print(main())
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    A,B,K = map(int, input().split())

    for i in range(A, B+1):
        if (i < A+K) or (i > B-K):
            print(i)

if __name__ == '__main__':
    main()


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

    a = []
    for i in range(A, A+K):
        if i <= B:
            a.append(i)
            print(i)
    for i in range(B-K+1, B+1):
        if ((i in a)==False)and(i>=A):
            print(i)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
H,W,D = list(map(int, input().split()))
A = []
for i in range(H):
    A.append(list(map(int, input().split())))
Q = int(input())
L = [0 for _ in range(Q)]
R = [0 for _ in range(Q)]
for i in range(Q):
    L[i], R[i] = list(map(int, input().split()))


masu = [[0,0] for _ in range(H*W)]
for i in range(H):
    for j in range(W):
        masu[A[i][j]-1] = [i, j]

MP = [0 for _ in range(Q)]
for k in range(Q):
    XY = masu[L[k]-1:R[k]:D]
    for i in range(len(XY)-1):
        MP[k] += abs(XY[i][0]-XY[i+1][0])
        MP[k] += abs(XY[i][1]-XY[i+1][1])


for i in range(Q):
    print(MP[i])

Fixed submission:
H,W,D = list(map(int, input().split()))
A = []
for i in range(H):
    A.append(list(map(int, input().split())))

Q = int(input())
L = [0 for _ in range(Q)]
R = [0 for _ in range(Q)]
for i in range(Q):
    L[i], R[i] = list(map(int, input().split()))

masu = [[0,0] for _ in range(H*W)]
for i in range(H):
    for j in range(W):
        masu[A[i][j]-1] = [i, j]

MP = [0 for _ in range(H*W)]
for i in range(H*W):
    if i < D:
        MP[i] = 0
    else:
        MP[i] = MP[i-D] + abs(masu[i][0]-masu[i-D][0]) + abs(masu[i][1]-masu[i-D][1])

for i in range(Q):
    print(MP[R[i]-1] - MP[L[i]-1])

Buggy python submission (verdict: Time Limit Exceeded):
H,W,D = list(map(int, input().split()))
A = []
for i in range(H):
    A.append(list(map(int, input().split())))
Q = int(input())
L = [0 for _ in range(Q)]
R = [0 for _ in range(Q)]
for i in range(Q):
    L[i], R[i] = list(map(int, input().split()))


masu = [[0,0] for _ in range(H*W)]
for i in range(H):
    for j in range(W):
        masu[A[i][j]-1] = [i, j]

MP = [0 for _ in range(Q)]
for k in range(Q):
    K = L[k]
    i, j = masu[K-1]
    while A[i][j] != R[k]:
        K = K + D
        x, y = masu[K-1]
        MP[k] += abs(x-i) + abs(y-j)
        i, j = x, y

for i in range(Q):
    print(MP[i])


Fixed submission:
H,W,D = list(map(int, input().split()))
A = []
for i in range(H):
    A.append(list(map(int, input().split())))

Q = int(input())
L = [0 for _ in range(Q)]
R = [0 for _ in range(Q)]
for i in range(Q):
    L[i], R[i] = list(map(int, input().split()))

masu = [[0,0] for _ in range(H*W)]
for i in range(H):
    for j in range(W):
        masu[A[i][j]-1] = [i, j]

MP = [0 for _ in range(H*W)]
for i in range(H*W):
    if i < D:
        MP[i] = 0
    else:
        MP[i] = MP[i-D] + abs(masu[i][0]-masu[i-D][0]) + abs(masu[i][1]-masu[i-D][1])

for i in range(Q):
    print(MP[R[i]-1] - MP[L[i]-1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

flag = "Yes"
for i in range(N):
   A_max = max(a)
   B_max = max(b)
   if A_max > B_max:
      flag = "No"
   else:
      del a[a.index(A_max)]
      del b[b.index(B_max)]

print(flag)


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

c = 0
for i in range(N):
   if b[i] - a[i] > 0:
      c += (b[i] - a[i])//2
   elif b[i] - a[i] < 0:
      c += b[i] - a[i]

if c >= 0:
   print("Yes")
else:
   print("No")
Buggy python submission (verdict: Runtime Error):
N, Y = list(map(int, input().split()))

# Y = 10000*x + 5000*y + 1000*z
# N = x + y + z
flag = 0
x = 0
y = 0
z = 0

if Y % 1000 != 0:
   flag = 1
elif Y > 10000*N:
   flag = 1
elif Y % 10000 == 0:
   x = Y//10000
else :
   x = Y//10000
   while True:
      for y in range(N-x+1):
         z = N-x-y
         if Y == 10000*x + 5000*y + 1000*z:
            flag = -1
            break
      if flag == -1:
         break
      elif x ==0:
         flag = 1
         break
      x = x-1
      
            

if flag == 1:
   print("-1 -1 -1")

else :
   print(str(x)+" "+str(y)+" "+str(z))

Fixed submission:
S = input()

print("2018" + S[4:])
Buggy python submission (verdict: Runtime Error):
def sokutei(s):
    b = [1,]
    for t in range(1, len(s)):
        if s[t] == s[t-1]:
            b[-1] += 1
        else:
            b.append(1)
    return max(b)

def main():
    S = input()
    B = sokutei(S)

    for K in range(len(S), 1, -1):
        a = [1,]
        for i in range(len(S) - K):
            s = ""
            for j in range(len(S)):
                if j<i or j>(i+K):
                    s += S[j]
                else:
                    if S[j]=="1":
                        s += "0"
                    else:
                        s += "1"
            a.append(sokutei(s))
        if B < max(a):
            return K+1
    return K

if __name__ == '__main__':
    print(main())


Fixed submission:
def main():
    S = input()
    S_l = len(S)
    T = []

    for i in range(S_l-1):
        if S[i] != S[i+1]:
            T.append(max([i+1, S_l-i-1]))

    if T != []:
        return min(T)
    else:
        return S_l

if __name__ == '__main__':
    print(main())
Buggy python submission (verdict: Time Limit Exceeded):
def main():
   N = int(input())
   a = list(map(int, input().split()))

   a.sort()
   b = []
   c = []
   for a in a:
      if (a in b)==False:
         b.append(a)
         c.append(1)
      else:
         c[-1] += 1

   count = 0
   for i in range(len(b)):
      if b[i] < c[i]:
         count += c[i] - b[i]
      elif b[i] > c[i]:
         count += c[i]
   return count

print(main())


Fixed submission:
def main():
   N = int(input())
   a = list(map(int, input().split()))

   a.sort()
   a.append(0)
   b = 0
   c = 0
   count = 0
   for a in a:
      if a != b:
         if b < c:
            count += c - b
         elif b > c:
            count += c
         b = a
         c = 1
      else:
         c += 1
   return count

print(main())

Buggy python submission (verdict: Time Limit Exceeded):
def main():
   N = int(input())
   a = list(map(int, input().split()))

   a.sort()
   b = []
   c = []
   for i in range(len(a)):
      if (a[i] in b)==False:
         b.append(a[i])
         c.append(1)
      else:
         c[-1] += 1

   count = 0
   for i in range(len(b)):
      if b[i] < c[i]:
         count += c[i] - b[i]
      elif b[i] > c[i]:
         count += c[i]
   return count

print(main())


Fixed submission:
def main():
   N = int(input())
   a = list(map(int, input().split()))

   a.sort()
   a.append(0)
   b = 0
   c = 0
   count = 0
   for a in a:
      if a != b:
         if b < c:
            count += c - b
         elif b > c:
            count += c
         b = a
         c = 1
      else:
         c += 1
   return count

print(main())
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N,K = map(int,input().split())
    A = list(map(int, input().split()))

    AA = []
    num = []
    for A in A:
        if (A in AA)==False:
            AA.append(A)
            num.append(1)
        else:
            num[AA.index(A)] += 1

    count = 0
    num.sort()
    num = num[::-1]
    if len(num)<=K:
        return 0
    else:
        for i in range(K,len(num)):
            count += num[i]
        return count


if __name__ == '__main__':
    print(main())

Fixed submission:
def main():
    N,K = map(int,input().split())
    A = list(map(int, input().split()))

    num = [0 for _ in range(200000)]
    s = 0
    for A in A:
        num[A-1] += 1

    count = 0
    num.sort()
    for i in range(200000-K):
        count += num[i]
    return count

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N,K = map(int,input().split())
    A = list(map(int, input().split()))

    AA = []
    num = []
    for A in A:
        if (A in AA)==False:
            AA.append(A)
            num.append(1)
        else:
            num[AA.index(A)] += 1

    B = list(zip(num, AA))
    B.sort()
    B = B[::-1]
    count = 0
    if len(B)<=K:
        return 0
    else:
        for i in range(K,len(B)):
            count += B[i][0]
        return count


if __name__ == '__main__':
    print(main())

Fixed submission:
def main():
    N,K = map(int,input().split())
    A = list(map(int, input().split()))

    num = [0 for _ in range(200000)]
    s = 0
    for A in A:
        num[A-1] += 1

    count = 0
    num.sort()
    for i in range(200000-K):
        count += num[i]
    return count

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N,K = map(int,input().split())
    A = list(map(int, input().split()))

    AA = []
    num = []
    for A in A:
        if (A in AA)==False:
            AA.append(A)
            num.append(1)
        else:
            num[AA.index(A)] += 1

    B = list(zip(num, AA))
    B.sort()
    B = B[::-1]
    count = 0
    while len(B) > K:
        count += B.pop()[0]

    return count

if __name__ == '__main__':
    print(main())

Fixed submission:
def main():
    N,K = map(int,input().split())
    A = list(map(int, input().split()))

    num = [0 for _ in range(200000)]
    s = 0
    for A in A:
        num[A-1] += 1

    count = 0
    num.sort()
    for i in range(200000-K):
        count += num[i]
    return count

if __name__ == '__main__':
    print(main())
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    B.sort()
    C.sort()

    count = 0
    Ai = -1
    Ci = -1
    for i in range(N):
        if Ai<N-1:
            while A[Ai+1]<B[i]:
                Ai += 1
                if Ai == N-1:
                    break
        if Ci<N:
            while C[Ci+1]<=B[i]:
                Ci += 1
                if Ci==N-1:
                    break
        count += (Ai+1) * (N-(Ci+1))

    return count

if __name__ == '__main__':
    print(main())


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    B.sort()
    C.sort()

    count = 0
    Ai = -1
    Ci = -1
    for i in range(N):
        if Ai<N-1:
            while A[Ai+1]<B[i]:
                Ai += 1
                if Ai == N-1:
                    break
        if Ci<N-1:
            while C[Ci+1]<=B[i]:
                Ci += 1
                if Ci==N-1:
                    break
        count += (Ai+1) * (N-(Ci+1))

    return count

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))

    A.sort()
    B.sort()
    C.sort()

    bb = [0 for _ in range(N)]
    for i,b in enumerate(B):
        for c in C[::-1]:
            if c > b:
                bb[i]+=1
            else: 
                break
    count = 0
    for a in A:
        for i,b in enumerate(B[::-1]):
            if b > a:
                count += bb[-i-1]
            else:
                break
    return count

print(main())


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    B.sort()
    C.sort()

    count = 0
    Ai = -1
    Ci = -1
    for i in range(N):
        if Ai<N-1:
            while A[Ai+1]<B[i]:
                Ai += 1
                if Ai == N-1:
                    break
        if Ci<N-1:
            while C[Ci+1]<=B[i]:
                Ci += 1
                if Ci==N-1:
                    break
        count += (Ai+1) * (N-(Ci+1))

    return count

if __name__ == '__main__':
    print(main())
Buggy python submission (verdict: Runtime Error):
N = int(input())
m = 0
b = 0
for _ in range(N):
  a = int(input())
  if b <= a:
    m += 1
  b = max(b,a)
print(m)

Fixed submission:
N = int(input())
H = [int(i) for i in input().split()]
m = 0
b = 0
for a in H:
  if b <= a:
    m += 1
  b = max(b,a)
print(m)
Buggy python submission (verdict: Runtime Error):
c2,c3 = 0,0
def ret(a,b,c):
  global c2,c3
  if a == b:
    if c == 2:
      c2 += 1
    else:
      c3 += 1
    if b == "0":
      return "1"
    else:
      return "0"
  else:
    return b
S = input()
S2,S3 = list(S),list(S)
default = S2[0]
for j,k in enumerate(S2):
  if j == 0:
    continue
  S2[j] = ret(S2[j-1],k,2)
  print(S2,c2)
for j,k in enumerate(S3):
  if j == 0:
    S3[0] = ret(default,S3[0],3)
  S3[j] = ret(S3[j-1],k,3)
  print(S3,c3)
print(c2 if c2 <= c3 else c3)

Fixed submission:
c2,c3 = 0,0
def ret(a,b,c):
  global c2,c3
  if a == b:
    if c == 2:
      c2 += 1
    else:
      c3 += 1
    if b == "0":
      return "1"
    else:
      return "0"
  else:
    return b
S = input()
S2,S3 = list(S),list(S)
default = S2[0]
for j,k in enumerate(S2):
  if j == 0:
    continue
  S2[j] = ret(S2[j-1],k,2)
for j,k in enumerate(S3):
  if j == 0:
    S3[0] = ret(default,S3[0],3)
  S3[j] = ret(S3[j-1],k,3)
print(c2 if c2 <= c3 else c3)

Buggy python submission (verdict: Runtime Error):
def ret(a,b,c):
  global c2,c3
  if a == b:
    if b == "0":
      return "1"
   	else:
      return "0"
    if c == 2:
      c2 += 1
    else:
      c3 += 1
  else:
    return b
S = input()
S2,S3 = list(S),list(S)
c2,c3 = 0,0
default = S2[0]
for j,k in enumerate(S2):
  if j == 0:
    continue
  S2[j] = ret(S2[j-1],k,2)
for j,k in enumerate(S3):
  if j == 0:
    S3[0] = ret(default,S3[0])
  S3[j] = ret(S3[j-1],k,3)
print(c2 if c2 >= c3 else c3)

Fixed submission:
c2,c3 = 0,0
def ret(a,b,c):
  global c2,c3
  if a == b:
    if c == 2:
      c2 += 1
    else:
      c3 += 1
    if b == "0":
      return "1"
    else:
      return "0"
  else:
    return b
S = input()
S2,S3 = list(S),list(S)
default = S2[0]
for j,k in enumerate(S2):
  if j == 0:
    continue
  S2[j] = ret(S2[j-1],k,2)
for j,k in enumerate(S3):
  if j == 0:
    S3[0] = ret(default,S3[0],3)
  S3[j] = ret(S3[j-1],k,3)
print(c2 if c2 <= c3 else c3)
Buggy python submission (verdict: Runtime Error):
a = [int(input) for i in range(5)]
m = 0
n = 0
for i in a:
  if i%10 != 0:
    t = 10 - i%10
  else:
    t = 0
  n += i + t
  m = max(m,t)
print(n-m)

Fixed submission:
a = [int(input()) for i in range(5)]
m = 0
n = 0
for i in a:
  if i%10 != 0:
    t = 10 - i%10
  else:
    t = 0
  n += i + t
  m = max(m,t)
print(n-m)
Buggy python submission (verdict: Runtime Error):
a = 0
for i in range(int(input())):
  v,u = input().split()
  if u == "JPY":
    a += int(v)
  else:
    a += int(v)*380000
print(a)

Fixed submission:
a = 0
for i in range(int(input())):
  v,u = input().split()
  if u == "JPY":
    a += int(v)
  else:
    a += float(v)*380000
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C = map(int,input().split())
count = 0
for i in range(C):
    if B > 0:
        B -= 1
        count += 2
    elif A > 0:
        A -= 1
        count += 1
    else:
        if C > 0:
            count += 1
        break
count += B
print(count)

Fixed submission:
A,B,C = map(int,input().split())
if C > (A + B):
    count = A + B + B + 1
elif C == (A + B):
    count = A + B + B
else:
    count = C + B
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,C = map(int,input().split())
count = 0
for i in range(C):
    if B > 0:
        B -= 1
        count += 2
    elif A > 0:
        A -= 1
        count += 1
    else:
        if C > 0:
            count += 1
        break
for i in range(B):
    count += 1
print(count)

Fixed submission:
A,B,C = map(int,input().split())
if C > (A + B):
    count = A + B + B + 1
elif C == (A + B):
    count = A + B + B
else:
    count = C + B
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
H = [int(i) for i in input().split()]
for i in range(N):
  H[i] = abs(T - H[i] * 0.006 - A)
print(H.index(min[H])+1)

Fixed submission:
N = int(input())
T,A = map(int,input().split())
H = [int(i) for i in input().split()]
for i in range(N):
  H[i] = abs(T - H[i] * 0.006 - A)
print(H.index(min(H))+1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
H = [int(i) for i in input().split()]
for i in range(len(H)):
  H[i] = abs(T - H[i] * 0.006 - A)
print(H.index(min[H])+1)

Fixed submission:
N = int(input())
T,A = map(int,input().split())
H = [int(i) for i in input().split()]
for i in range(N):
  H[i] = abs(T - H[i] * 0.006 - A)
print(H.index(min(H))+1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
H = [int(i) for i in input().split()]
for i in range(len(H)):
  H[i] = T - H[i] * (0.006 - 1)
print(H[min(H)]+1)

Fixed submission:
N = int(input())
T,A = map(int,input().split())
H = [int(i) for i in input().split()]
for i in range(N):
  H[i] = abs(T - H[i] * 0.006 - A)
print(H.index(min(H))+1)
Buggy python submission (verdict: Runtime Error):
a = input().split("\n")
N,X = map(int,a[0].split())
m = list(int(i) for i in a.pop(0))
print(N+int((X-sum(m))/min(m)))

Fixed submission:
N,X = map(int,input().split())
m = []
for i in range(N):
  m.append(int(input()))
print(N+int((X-sum(m))/min(m)))