Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  s = []
  for j in range(1, K+1):
    if i > j:
      dp = DP[i-j] + abs(H[i-j] - H[i])
      s.append(dp)
  DP[i] = min(s)
print(DP[N])


Fixed submission:
N = int(input())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)
for i in range(2, N+1):
  dp = DP[i-1] + abs(H[i-1] - H[i])
  if i > 2:
    dp = min(dp, DP[i-2] + abs(H[i-2] - H[i]))
  DP[i] = dp
print(DP[N])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int, input().strip().split()))

mm = list(map(int, input().strip().split()))

dp = [float('inf')] * n

dp[0] = 0

for i in range(n):
  for j in range(1, k+1): 
    if i + j < n:
      dp[i+j] = min(dp[i+j], dp[i] + abs(mm[i+j] - mm[i]))

print(dp[n-1])

Fixed submission:
N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  k = max(i-K, 1)
  DP[i] = min(dp + abs(h - H[i]) for dp, h in zip(DP[k:i], H[k:i]))
print(DP[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  k = min(i, K+1)
  DP[i] = min(DP[i-j] + abs(H[i-j] - H[i]) for j in range(1, k))
print(DP[N])


Fixed submission:
N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  k = max(i-K, 1)
  DP[i] = min(dp + abs(h - H[i]) for dp, h in zip(DP[k:i], H[k:i]))
print(DP[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  DP[i] = min(DP[i-j] + abs(H[i-j] - H[i]) for j in range(1, K+1) if i > j)
print(DP[N])


Fixed submission:
N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  k = max(i-K, 1)
  DP[i] = min(dp + abs(h - H[i]) for dp, h in zip(DP[k:i], H[k:i]))
print(DP[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  s = []
  for j in range(1, K+1):
    if i > j:
      dp = DP[i-j] + abs(H[i-j] - H[i])
      s.append(dp)
  DP[i] = min(s)
print(DP[N])


Fixed submission:
N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  k = max(i-K, 1)
  DP[i] = min(dp + abs(h - H[i]) for dp, h in zip(DP[k:i], H[k:i]))
print(DP[N])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, W = map(int, input().split())
WV = (map(int, input().split()) for _ in range(N))

DP = [0] * (W+1)

for w, v in WV:
  for j in range(W, w-1, -1):
    dp = DP[j-w] + v 
    if DP[j] < dp:
      DP[j] = dp
print(max(DP))


Fixed submission:
def dp():
  N, W = map(int, input().split())
  WV = (map(int, input().split()) for _ in range(N))

  DP = [0] * (W+1)
  for w, v in WV:
    for j in range(W, w-1, -1):
      dp = DP[j-w] + v 
      if DP[j] < dp:
        DP[j] = dp
  return max(DP)
print(dp())

Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
WV = (map(int, input().split()) for _ in range(N))

DP = [0] * (W+1)

for w, v in WV:
  for j in range(W, w-1, -1):
    dp = DP[j-w] + v 
    if DP[j] < dp:
      DP[j] = dp
print(DP[W])

Fixed submission:
def dp():
  N, W = map(int, input().split())
  WV = (map(int, input().split()) for _ in range(N))

  DP = [0] * (W+1)
  for w, v in WV:
    for j in range(W, w-1, -1):
      dp = DP[j-w] + v 
      if DP[j] < dp:
        DP[j] = dp
  return max(DP)
print(dp())

Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
WV = (list(map(int, input().split())) for _ in range(N))

DP = [0] * (W+1)

for i, (w, v) in enumerate(WV):
  for j in range(W, w-1, -1):
    # toru
    dp1 = DP[j-w] + v 
    # toranai
    dp2 = DP[j]
    dp = max(dp1, dp2)
    DP[j] = dp
print(DP[W])

Fixed submission:
def dp():
  N, W = map(int, input().split())
  WV = (map(int, input().split()) for _ in range(N))

  DP = [0] * (W+1)
  for w, v in WV:
    for j in range(W, w-1, -1):
      dp = DP[j-w] + v 
      if DP[j] < dp:
        DP[j] = dp
  return max(DP)
print(dp())

Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
WV = (list(map(int, input().split())) for _ in range(N))

DP = [[0] * (W+1) for _ in range(N)]

for i, (w, v) in enumerate(WV):
  for j in range(W+1):
    if j-w >= 0:
      # toru
      dp1 = DP[i-1][j-w] + v 
      # toranai
      dp2 = DP[i-1][j]
      dp = max(dp1, dp2)
    else:
      # toranai
      dp = DP[i-1][j]
    DP[i][j] = dp
print(max(DP[N-1]))

Fixed submission:
def dp():
  N, W = map(int, input().split())
  WV = (map(int, input().split()) for _ in range(N))

  DP = [0] * (W+1)
  for w, v in WV:
    for j in range(W, w-1, -1):
      dp = DP[j-w] + v 
      if DP[j] < dp:
        DP[j] = dp
  return max(DP)
print(dp())
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

L = list(range(A,B+1))
L = sorted(list(set(L[:K])|set(L[-K:])))
print(*L, sep='\n')


Fixed submission:
S = list(input().strip())

b = all(i in S for i in 'abc')
print(b and 'Yes' or 'No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
num = list(map(int,input().split()))
numabs = [abs(i) for i in num]
cnt = 0    
negative = []        
for i in num :
    if i < 0 :
        cnt += 1
        negative.append()

if cnt % 2 == 0 :
    print(sum(numabs))

if cnt % 2 == 1 :
    print(sum(numabs)-2*max(negative))

Fixed submission:
n = int(input())
num = list(map(int,input().split()))
numabs = [abs(i) for i in num]
cnt = 0           
for i in num :
    if i < 0 :
        cnt += 1

if cnt % 2 == 0 :
    print(sum(numabs))

if cnt % 2 == 1 :
    print(sum(numabs) - 2*min(numabs))

Buggy python submission (verdict: Runtime Error):
n = int(input())
num = list(map(int,input().split()))
numabs = [abs(i) for i in num]
cnt = 0    
negative = []        
for i in num :
    if i < 0 :
        cnt += 1
        negtive.append()

if cnt % 2 == 0 :
    print(sum(numabs))

if cnt % 2 == 1 :
    print(sum(numabs)-2*max(negative))

Fixed submission:
n = int(input())
num = list(map(int,input().split()))
numabs = [abs(i) for i in num]
cnt = 0           
for i in num :
    if i < 0 :
        cnt += 1

if cnt % 2 == 0 :
    print(sum(numabs))

if cnt % 2 == 1 :
    print(sum(numabs) - 2*min(numabs))
Buggy python submission (verdict: Runtime Error):
S = input()
if int(s[5]) == 0 and int(s[6]) <= 4 :
    print('Heisei')
else :
    print('TBD')

Fixed submission:
s = input()
if int(s[5]) == 0 and int(s[6]) <= 4 :
    print('Heisei')
else :
    print('TBD')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
f = [int(input()) for i in range(n)]
li = []
f.sort()
for i in range(n-k+1) :
    li.append(max(f[i:i+k])-min(f[i:i+k]))
print(min(li))

Fixed submission:
n,k = map(int,input().split())
f = [int(input()) for i in range(n)]
li = []
f.sort()
for i in range(n-k+1) :
    li.append(f[i+k-1]-f[i])
print(min(li))
Buggy python submission (verdict: Runtime Error):
n = input()
if n == '1' :
    print('Hello World')
else :
    a,b = map(int,input().split())
    print(a+b)

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

Buggy python submission (verdict: Runtime Error):
n = input()
if n == '1' :
    print('Helli World')
else :
    a,b = map(int,input().split())
    print(a+b)

Fixed submission:
n = input()
if n == '1' :
    print('Hello World')
else :
    a = int(input())
    b = int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
for i in range(1,4) :
    if (a*b*c)%2 == 1 :
        print('Yes')
    else :
        print('No')

Fixed submission:
a,b = map(int,input().split())
if (a*b)%2 == 1 :
    print('Yes')
else :
    print('No')
Buggy python submission (verdict: Runtime Error):
a = int(input())
if a%2  == 0 :
    print(a**2)
else :
    prin((a+1)/2*(a-1)/2)
  

Fixed submission:
a = int(input())
if a%2  == 0 :
    print(int(a**2/4))
else :
    print(int((a+1)/2*(a-1)/2))
Buggy python submission (verdict: Runtime Error):
a = int(input())
if a < 1200 :
    prunt('ABC')
elif a >= 1200 and a < 2800 :
    print('ARC')
else :
    print('AGC')

Fixed submission:
a = int(input())
if a < 1200 :
    print('ABC')
elif a >= 1200 and a < 2800 :
    print('ARC')
else :
    print('AGC')
Buggy python submission (verdict: Runtime Error):
n = list(map(input().split()))
n.sort()
print(int(n[2])-int(n[0]))

Fixed submission:
n = list(map(int,input().split()))
n.sort()
print(n[2]-n[0])

Buggy python submission (verdict: Runtime Error):
n = list(input())
n.sort()
print(int(n[2])-int(n[0]))

Fixed submission:
n = list(map(int,input().split()))
n.sort()
print(n[2]-n[0])

Buggy python submission (verdict: Runtime Error):
n = input()
n.sort()
print(int(n[2])-int(n[0]))

Fixed submission:
n = list(map(int,input().split()))
n.sort()
print(n[2]-n[0])
Buggy python submission (verdict: Runtime Error):
n = int(input()
if n%2 == 0 :
    print(n)
else :
    print(2*n)

Fixed submission:
n = int(input())
if n%2 == 0 :
    print(n)
else :
    print(2*n)
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
x = int(X**0.5)
num = []
for b in range(1,x+1) :
    p = 2
    while b**p <= X :
        p += 1
    num.append(b**(p-1))
print(max(num))

Fixed submission:
X = int(input())
x = int(X**0.5)
num = []
if X <= 3 :
    print(1)
else :
    for b in range(2,x+1) :
        p = 2
        while b**p <= X :
            p += 1
        num.append(b**(p-1))
    print(max(num))

Buggy python submission (verdict: Runtime Error):
X = int(input())
x = int(X**0.5)
num = []
for b in range(2,x+1) :
    p = 2
    while b**p <= X :
        p += 1
    num.append(b**(p-1))
print(max(num))

Fixed submission:
X = int(input())
x = int(X**0.5)
num = []
if X <= 3 :
    print(1)
else :
    for b in range(2,x+1) :
        p = 2
        while b**p <= X :
            p += 1
        num.append(b**(p-1))
    print(max(num))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
k = int(input())
x = map(a,b,c)
print(x*(2**k) + a + b + c - x)

Fixed submission:
a,b,c = map(int,input().split())
k = int(input())
x = max(a,b,c)
print(x*(2**k) + a + b + c - x)
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int,input(),split())
if A + B > C + D :
    print('Left')
elif A + B == C + D :
    print('Balanced')
else :
    print('Right')

Fixed submission:
A,B,C,D = map(int,input().split())
if A + B > C + D :
    print('Left')
elif A + B == C + D :
    print('Balanced')
else :
    print('Right')
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input()split())
print(min(n*a,b))

Fixed submission:
n,a,b = map(int,input().split())
print(min(n*a,b))
Buggy python submission (verdict: Runtime Error):
N  = int(input())
a = 0
for i in range(N):
    l, r = map(int, input().split())
    ans += r - l + 1
print(a)  

Fixed submission:
N  = int(input())
a = 0
for i in range(N):
    l, r = map(int, input().split())
    a += r - l + 1
print(a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split())
a.sort()
print(a[n-1]-a[0])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
print(a[n-1]-a[0])
Buggy python submission (verdict: Runtime Error):
T = []
for i in range(5):
    T.append(input())
tmp = []
for i in range(5):
    tmp.append(int(T[i][-1]))
ans = []
for i in range(5):
    if 0 < tmp[i] and tmp[i] <= 5:
        ans.append(i)

lastidx = tmp.index(min([tmp[x] for x in ans]))

sum_ = 0
for i in range(5):
    if tmp[i] == 0:
        sum_ += int(T[i])
    else:
        sum_ += (int(T[i]) + 10 - tmp[i])
print(sum_ - 10 + tmp[lastidx])

Fixed submission:
T = []
for i in range(5):
    T.append(input())
tmp = []
for i in range(5):
    tmp.append(int(T[i][-1]))
T2 = []
for i in range(5):
    if tmp[i] != 0:
        T2.append(int(T[i]) + 10 - tmp[i])
    else:
        T2.append(int(T[i]))
ans = []
for i in range(5):
    if tmp[i] != 0:
        ans.append(sum(T2) - 10 + tmp[i])
    else:
        ans.append(sum(T2))
    
    
    
    

print(min(ans))

Buggy python submission (verdict: Runtime Error):
T = []
for i in range(5):
    T.append(input())
tmp = []
for i in range(5):
    tmp.append(10 - int(T[i][-1]))
minlist = []
for i in range(5):
    if tmp[i] > 4:
        minlist.append(tmp[i])
    else:
        minlist.append(10)
last = tmp.index(min(minlist))
tmp2 = [0 if x == 10 else x for x in tmp]
ans = []
for i in range(5):
    ans.append(tmp2[i] + int(T[i]))
print(sum(ans) - ans[last] + int(T[last]))

Fixed submission:
T = []
for i in range(5):
    T.append(input())
tmp = []
for i in range(5):
    tmp.append(int(T[i][-1]))
T2 = []
for i in range(5):
    if tmp[i] != 0:
        T2.append(int(T[i]) + 10 - tmp[i])
    else:
        T2.append(int(T[i]))
ans = []
for i in range(5):
    if tmp[i] != 0:
        ans.append(sum(T2) - 10 + tmp[i])
    else:
        ans.append(sum(T2))
    
    
    
    

print(min(ans))
Buggy python submission (verdict: Runtime Error):
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = []
if len(S) == 1:
    if S in ACGT:
        print(1)
    else:
        print(0)
else:
    for i in range(len(S)):
        j = 0
        while i + j < len(S):
            if S[i + j] in ACGT:
                j += 1
            else:
                ans.append(S[i : i + j])
                break
    
    print(max([len(x) for x in ans]))

Fixed submission:
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = []
if len(S) == 1:
    if S in ACGT:
        print(1)
    else:
        print(0)
else:
    for i in range(len(S)):
        j = 0
        while i + j < len(S):
            if S[i + j] in ACGT:
                j += 1
            else:
                ans.append(S[i : i + j])
                break
        if i + j == len(S):
            ans.append(S[i : len(S)])
    
    print(max([len(x) for x in ans]))

Buggy python submission (verdict: Runtime Error):
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = []

for i in range(len(S)):
    j = 0
    while i + j < len(S):
        if S[i + j] in ACGT:
            j += 1
        else:
            ans.append(S[i : i + j])
            break
print(max([len(x) for x in ans]))

Fixed submission:
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = []
if len(S) == 1:
    if S in ACGT:
        print(1)
    else:
        print(0)
else:
    for i in range(len(S)):
        j = 0
        while i + j < len(S):
            if S[i + j] in ACGT:
                j += 1
            else:
                ans.append(S[i : i + j])
                break
        if i + j == len(S):
            ans.append(S[i : len(S)])
    
    print(max([len(x) for x in ans]))
Buggy python submission (verdict: Runtime Error):
N = input()

tmp = 0
for i in range(len(N)):
    tmp += int(N[i])

if int(N) % tmp == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
D, N = map(int, input().split())
if D == 0:
    if N == 100:
        print(101)
    else:
        print(N)
    
else:
    if N == 100:
        print((100 ** D) * (N + 1))
    else:
        print((100 ** D) * N)

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

tmp = 0
for i in range(len(N)):
    tmp += int(N[i])

if int(N) % tmp == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
D, N = map(int, input().split())
if D == 0:
    if N == 100:
        print(101)
    else:
        print(N)
    
else:
    if N == 100:
        print((100 ** D) * (N + 1))
    else:
        print((100 ** D) * N)
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

if A <= C:
    print(max(min(B, D) - C), 0)
else:
    print(max(min(B, D) - A), 0)


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

if A <= C:
    print(max(min(B, D) - C, 0))
else:
    print(max(min(B, D) - A, 0))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

if A % 3 == 0 or B % 3 == 0 or A + B % == 0:
    print('Possible')
else:
    print('Impossible')

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

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print('Possible')
else:
    print('Impossible')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
S = input()

I_count = [i for i, x in enumerate(S) if x == 'I']
D_count = [i for i, x in enumerate(S) if x == 'D']

tmp = [0] * N
for i in I_count:
    tmp[i] = 1
for i in D_count:
    tmp[i] = -1

ans = 0
List = []
for i in range(N):
    ans += tmp[i]
    List.append(ans)

print(max(0, List))

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
S = input()

I_count = [i for i, x in enumerate(S) if x == 'I']
D_count = [i for i, x in enumerate(S) if x == 'D']

tmp = [0] * N
for i in I_count:
    tmp[i] = 1
for i in D_count:
    tmp[i] = -1

ans = 0
List = []
for i in range(N):
    ans += tmp[i]
    List.append(ans)

print(max(0, max(List)))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
K, S = map(int, input().split())
ans = 0

for X in range(K + 1):
    for Y in range(X, K + 1):
        for Z in range(Y, K + 1):
            if X + Y + Z == S:
                if len(set([X, Y, Z])) == 1:
                    ans += 1
                elif len(set([X, Y, Z])) == 2:
                    ans += 3
                else:
                    ans += 6
print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
K, S = map(int, input().split())
ans = 0

for X in range(K + 1):
    for Y in range(X, K + 1):
        Z = S - Y - X
        if Z >= Y and Z <= K:
                
            if len(set([X, Y, Z])) == 1:
                ans += 1
            elif len(set([X, Y, Z])) == 2:
                ans += 3
            else:
                ans += 6
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = []
for i in range(3):
    S.append(input())
for i in range(3):
    S[i] = S[i].replace('a', '0').replace('b', '1').replace('c', '2')
    
idx = int(S[0][0])
S[0] = S[0][1:]

while True:
    tmp = int(S[idx][0])
    S[idx] = S[idx][1:]
    idx = tmp
    if S[idx] == '':
        print(['A', 'B', 'C'][idx])
        break


Fixed submission:
SA = input()
SB = input()
SC = input()

Aidx, Bidx, Cidx = 0, -1, -1
X = SA[0]
i = 0

while True:
    if X == 'a':
        Aidx += 1
        if Aidx == len(SA):
            ans = 'A'
            break
        X = SA[Aidx]
    elif X == 'b':
        Bidx += 1
        if Bidx == len(SB):
            ans = 'B'
            break
        X = SB[Bidx]
    elif X == 'c':
        Cidx += 1
        if Cidx == len(SC):
            ans = 'C'
            break
        X = SC[Cidx]


print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = []
for i in range(3):
    S.append(input())
for i in range(3):
    S[i] = S[i].replace('a', '0').replace('b', '1').replace('c', '2')
    
idx = int(S[0][0])
S[0] = S[0][1:]

while True:
    tmp = int(S[idx][0])
    S[tmp] = S[tmp][1:]
    idx = tmp
    if len(S[0]) == 0:
        print('A')
        break
    elif len(S[1]) == 0:
        print('B')
        break
    elif len(S[2]) == 0:
        print('C')
        break


Fixed submission:
SA = input()
SB = input()
SC = input()

Aidx, Bidx, Cidx = 0, -1, -1
X = SA[0]
i = 0

while True:
    if X == 'a':
        Aidx += 1
        if Aidx == len(SA):
            ans = 'A'
            break
        X = SA[Aidx]
    elif X == 'b':
        Bidx += 1
        if Bidx == len(SB):
            ans = 'B'
            break
        X = SB[Bidx]
    elif X == 'c':
        Cidx += 1
        if Cidx == len(SC):
            ans = 'C'
            break
        X = SC[Cidx]


print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = []
for i in range(3):
    S.append(input())
for i in range(3):
    S[i] = S[i].replace('a', '0').replace('b', '1').replace('c', '2')
    
idx = int(S[0][0])
S[0] = S[0][1:]

while True:
    tmp = int(S[idx][0])
    S[tmp] = S[tmp][1:]
    idx = tmp
    if len([i for i, x in enumerate(S) if len(x) == 0]) == 1:
        print(['A', 'B', 'C'][int([i for i, x in enumerate(S) if len(x) == 0][0])])
        break


Fixed submission:
SA = input()
SB = input()
SC = input()

Aidx, Bidx, Cidx = 0, -1, -1
X = SA[0]
i = 0

while True:
    if X == 'a':
        Aidx += 1
        if Aidx == len(SA):
            ans = 'A'
            break
        X = SA[Aidx]
    elif X == 'b':
        Bidx += 1
        if Bidx == len(SB):
            ans = 'B'
            break
        X = SB[Bidx]
    elif X == 'c':
        Cidx += 1
        if Cidx == len(SC):
            ans = 'C'
            break
        X = SC[Cidx]


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
time=[]
for i in range(5):
  time.append(int(input()))
population=[n,0,0,0,0,0]
delay=0
while population[5]<n:
  temp=population[:]
  for i in range(5):
    trans=min(population[i],time[i])
    temp[i]-=trans
    temp[i+1]+=trans
  population=temp[:]
  delay+=1
print(delay)

Fixed submission:
n=int(input())
time=[]
for i in range(5):
  time.append(int(input()))
time.append(0)
mini=time[0]
for i in range(5):
  mini=min(mini,time[i])
delay=(n-1)//mini+5
print(delay)
Buggy python submission (verdict: Runtime Error):
s=list(input())
out=[]
for i in range(len(s)):
  if s[i]=="1":
    out.append(s[i])
  elif s[i]=="0":
    out.append(s[i])
  elif len(out)!=0:
    del(s[-1])
for i in range(len(out)):
  print(out[i])

Fixed submission:
s=list(input())
out=[]
for i in range(len(s)):
  if s[i]=="1":
    out.append(s[i])
  if s[i]=="0":
    out.append(s[i])
  if len(out)!=0 and s[i]=="B":
    del(out[-1])
print("".join(out))
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
moji=[]
for i in range(n):
  moji.appned(input())
moji.sort()
print("".join(moji))

Fixed submission:
n,l=map(int,input().split())
moji=[]
for i in range(n):
  moji.append(input())
moji.sort()
print("".join(moji))