Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
h_list = [int(i) for i in input().split()]

k = 0
while sum(h_list)>0:
  bool_list = [True if i==max(h_list) else False for i in h_list]
  indexes = []
  true_index = bool_list.index(True)
  indexes.append(true_index)
  while bool_list(true_index):
    true_index += 1
    indexes.append(true_index)
  h_list = [h_list[i]-1 for i in indexes]
  k += 1
  
print(k)
    

Fixed submission:
n = int(input())
inp_h = [int(i) for i in input().split()]

h_max = max(inp_h)
h_len = len(inp_h)

ind = [0]*h_len

h_bool = [True if ind[i] == inp_h[i] else False for i in range(h_len)]

def make_index(h_bool):
    try:
        index = h_bool.index(False)
    except:
        index = -1
    return index

num = 0
while True:
    index = make_index(h_bool)
    index_list = []
    if index != -1:
        while True:
            if index < h_len:
                if h_bool[index] == False:
                    index_list.append(index)
                    index += 1
                elif h_bool[index] == True:
                    ind = [ind[i]+1 if i in index_list else ind[i] for i in range(h_len)]
                    h_bool = [True if ind[i] == inp_h[i] else False for i in range(h_len)]
                    num += 1
                    break
            elif index >= h_len:
                ind = [ind[i]+1 if i in index_list else ind[i] for i in range(h_len)]
                h_bool = [True if ind[i] == inp_h[i] else False for i in range(h_len)]
                num += 1
                break
    else:
        break
    
print(num)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())
abc_list = [[int(i) for i in input().split()] for j in range(n)]
abc_list = np.array(abc_list)

dp = np.zeros((n, 3))
dp[0,:] = abc_list[0,:]

temp_indexes = np.array([0, 1, 2])
for i in range(1, n):
    for j in range(3):
        indexes = temp_indexes[temp_indexes!=j]
        bigger = max(dp[i-1][indexes[0]], dp[i-1][indexes[1]])
        dp[i][j] = bigger + abc_list[i][j]
        
print(int(np.max(dp[-1,:])))

Fixed submission:
n = int(input())
abc_list = [[int(i) for i in input().split()] for _ in range(n)]

dp = [[0 for i in range(3)] for _ in range(n+1)]


for i, abc in enumerate(abc_list):
    for j in range(3):
        temp = dp[i][:]
        temp.pop(j)
        dp[i+1][j] = max(temp) + abc[j]

print(max(dp[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
wv_list = [[int(i) for i in input().split()] for _ in range(N)]

dp = [[-1 for i in range(W+1)] for _ in range(N)]

w = wv_list[0][0]
v = wv_list[0][1]
dp[0][w] = v

for i in range(1, N):
    w = wv_list[i][0]
    v = wv_list[i][1]
    
    for j in range(W+1):
        if j < w:
            dp[i][j] = dp[i-1][j]
        elif j == w:
            dp[i][j] = max(dp[i-1][j], v)
        else:
            if dp[i-1][j-w] == -1:
                dp[i][j] = dp[i-1][j]
            else:
                dp[i][j] = max(dp[i-1][j], dp[i-1][j-w] + v)

print(max(dp[-1]))

Fixed submission:
import numpy as np

n, w = map(int, input().split())
wv_list = [[int(i) for i in input().split()] for i in range(n)]

dp = np.zeros(w+1)

for wv in wv_list:
    w = wv[0]
    v = wv[1]
    dp[w:] = np.maximum(dp[:-w]+v, dp[w:])

print(int(np.max(dp)))
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n % 2 != 0:
  print(n//2 + 1)
 
else:
  prnit(n//2)

Fixed submission:
n = int(input())
 
if n % 2 != 0:
  print(n//2 + 1)
 
else:
  print(n//2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

M = 0

for i in range(1, N+1):
    M += i

M = M - N

print(M)

Fixed submission:
N = int(input())

M = 0

M = N * (N-1) // 2


print(int(M))
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())

min_num = 2019

for i in range(L, R):
    for s in range(i+1, R+1):
        if (i*s)%2019 < min_num:
            min_num = (i*s)%2019

print(min_num)

Fixed submission:
L, R = map(int, input().split())

mod_list = []
min1 = 2019
min2 = 2019

if (R - L) > 2019:
    print(0)

else:
    for i in range(L, R):
        for s in range(i+1, R+1):
            if (i*s)%2019 <= min1:
                min1 = (i*s)%2019
    print(min1)
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

num_list = []

for i in range(1,100):
    if a % i == 0 & b % i == 0:
        num_list.append(i)

print(num_list[k])

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

num_list = []

for i in range(1,min(a,b)+1):
    if a % i == 0 and b % i == 0:
        num_list.append(i)


print(num_list[-k])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

diff_m = 0
diff_p = []
mcount = 0

if sum(B) > sum(A):
    print(-1)

else:
    for i in range(N):
        difftmp = A[i] - B[i]
        
        if difftmp < 0:
            diff_m += difftmp
            mcount += 1
        
        else:
            diff_p.append(difftmp)
    

    if diff_m == 0:
        print(0)

    else:
        diff_p.sort(reverse = True)

        for j in range(0,N):
            a = sum(diff_p[:j])
 

            if diff_m + a >= 0:
                print(j+mcount)
                break

            else:
                continue


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

diff_m = 0
diff_p = []
mcount = 0

if sum(B) > sum(A):
    print(-1)

else:
    for i in range(N):
        difftmp = A[i] - B[i]
        
        if difftmp < 0:
            diff_m += difftmp
            mcount += 1
        
        else:
            diff_p.append(difftmp)
    

    if diff_m == 0:
        print(0)

    else:
        diff_p.sort(reverse = True)

        for j in range(0,N):
            diff_m = diff_m + diff_p[j]
 

            if diff_m >= 0:
                print(j+1 + mcount)
                break

            else:
                continue
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
bager = []
bager.append("P")

for i in range(1, N+1):
    bagernow = "B" + bager[i-1] + "P" + bager[i-1] + "B"
    bager.append(bagernow)

bagerN = str(bager[N])

runbager = bagerN[:(X)]

Ans = runbager.count("P")

print(Ans)

Fixed submission:
D = int(input())

if D == 25:
    print("Christmas")

elif D == 24:
    print("Christmas Eve")

elif D == 23:
    print("Christmas Eve Eve")

elif D == 22:
    print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
N, M, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

if X < max(xlist):
    xmax = max(xlist)
else:
    xmax = X

if Y > min(ylist):
    ymax = min(ylist)
else:
    ymin = Y

if xmax + 1 <= ymin:
    print("No War")
else:
    print("War")

Fixed submission:
N, M, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

if X < max(xlist):
    xmax = max(xlist)
else:
    xmax = X

if Y > min(ylist):
    ymin = min(ylist)
else:
    ymin = Y

if xmax + 1 <= ymin:
    print("No War")
else:
    print("War")
Buggy python submission (verdict: Runtime Error):
A, B = map(input().split())

if A % 2 == 1 and B % 2 == 1:
    print("Yes")

else:
    print("No")

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

if A % 2 == 1 and B % 2 == 1:
    print("Yes")

else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


N, X = map(int, input().split())

clist = [X]
diff = []

a = list(map(int, input().split()))
clist.extend(a)

clist.sort(reverse = False)

for s in range(1, N+1):
    diff.append(clist[s] - clist[s-1])

print(gcd_list(diff))

Fixed submission:
import fractions
from functools import reduce

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


N, X = map(int, input().split())

clist = [X]
diff = []

a = list(map(int, input().split()))
clist.extend(a)

clist.sort(reverse = False)

for s in range(1, N+1):
    diff.append(clist[s] - clist[s-1])

print(gcd_list(diff))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

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


N, X = map(int, input().split())

clist = [X]
diff = []

for i in range(N):
    clist.append(list(map(int, input().split)))

clist.sort(reverse = False)

for s in range(1, N+1):
    diff.append(clist[s] - clist[s-1])

print(gcd(*diff))

Fixed submission:
import fractions
from functools import reduce

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


N, X = map(int, input().split())

clist = [X]
diff = []

a = list(map(int, input().split()))
clist.extend(a)

clist.sort(reverse = False)

for s in range(1, N+1):
    diff.append(clist[s] - clist[s-1])

print(gcd_list(diff))
Buggy python submission (verdict: Runtime Error):
N = int(input())
con = []
conter = 0

for i in range(1, 105):
    if i % 2 == 1:
        for s in range(1, i/2):
            if i % s == 0:
                counter += 1
            
        con.append(counter)


print(con.count(8))

Fixed submission:
N = int(input())
con = []
counter = 0

for i in range(1, N+1):
    if i % 2 == 1:
        for s in range(1, i+1):
            if i % s == 0:
                counter += 1
            
        con.append(counter)
        counter = 0


print(con.count(8))
Buggy python submission (verdict: Runtime Error):
S = list(input())
K = int(input())
i = 0
ans = 0

while K > 0:
    K = K - S[i]**(5*10**16 + 1)
    ans = S[i]
    i += 1

print(ans)

Fixed submission:
S = input()
K = int(input())

ans = 0
n1 = 0

for i in S:
    if i != "1":
        s = int(i)
        break
    
    else:
        n1 += 1

if n1 >= K:
    print(1)

else:
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int, input().split())

a = []

for i in range(0,Q):
    x = int(input())
    a.append(x)

l = [K] * N

for i in a:
    for n in range(0,N):
        if n == (i-1):
            pass
        else:
            l[n] -= 1

for n in range(0, N):
    if l[n] <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
N,K,Q = map(int, input().split())

a = []

for i in range(0,Q):
    x = int(input())
    a.append(x)

l = [0] * N

for i in a:
    l[i-1] += 1

for n in range(0, N):
    if l[n] >= (Q-K+1):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):

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

count = 0
diff = 0

if N == 1:
    print("Yes")
    exit(1)

for i in range(0, N-1):
    if H[i] <= H[i+1]:
        continue
    else:
        count += 1
        if diff < H[i+1] - H[i]:
            diff = H[i+1] - H[i]


if count <= 1 and diff <= 1:
    print("yes")
else:
    print("No")


Fixed submission:

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

count = 0
diff = 0

if N == 1:
    print("Yes")
else:
    minn = 1
    tmp = 0
    for i in range (0, N):
        if minn <= H[i] - 1:
            H[i] -= 1
            minn = H[i]
        elif minn <= H[i]:
            minn = H[i]
        else:
            tmp = 1

    if tmp == 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):

N = int(input())

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

dis = True
count = 0
for i in range(0, N-1):
    if A[i] > A[i+1]:
        count += 1
        dis = False
        if count == 1:
            tmp1 = i
        elif count == 2:
            tmp2 = i+1

if dis == False:
    tmp = A[tmp1]
    A[tmp1] = A[tmp2]
    A[tmp2] = tmp

    count = 0
    for i in range(0, N - 1):
        if A[i] > A[i + 1]:
            count += 1
            dis = False
            if count == 1:
                tmp1 = i
            elif count == 2:
                tmp2 = i + 1
    if count == 0:
        dis = True

if dis == True:
    print('YES')
else:
    print('NO')


Fixed submission:

N = int(input())

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

dis = True
count = 0
for i in range(0, N-1):
    if A[i] > A[i+1]:
        count += 1
        dis = False
        if count == 1:
            tmp1 = i
        elif count == 2:
            tmp2 = i+1

if dis == False and count > 1:
    tmp = A[tmp1]
    A[tmp1] = A[tmp2]
    A[tmp2] = tmp

    count = 0
    for i in range(0, N-1):
        if A[i] > A[i + 1]:
            count += 1
            dis = False
            if count == 1:
                tmp1 = i
            elif count == 2:
                tmp2 = i + 1
    if count == 0:
        dis = True

if dis == True:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []

for i in range(0, N):
    tmp = int(input())
    A.append(tmp)

for i in range(0, N):
    tmp = A.pop(i)
    print(max(A))
    A.insert(i, tmp)

Fixed submission:
import numpy
N = int(input())
A = []

for i in range(0, N):
    tmp = int(input())
    A.append(tmp)

MAX = max(A)
MAX_i = numpy.argmax(A)
tmp = A.pop(MAX_i)
MAXsecond = max(A)
A.insert(MAX_i, tmp)

for i in range(0, N):
    if A[i] == MAX:
        print(MAXsecond)
    else:
        print(MAX)
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
count = 0


for i in range(0,N-2):
    if p[i] < p[i+1] and p[i+1] < p[i+2]:
        count += 1
print(count)

Fixed submission:
S = input()
SL = list(S)

if SL[0] == SL[1] and SL[1] == SL[2]:
    print('No')
elif SL[0] == SL[1] and SL[2] == SL[3]:
    print('Yes')
elif SL[0] == SL[2] and SL[1] == SL[3]:
    print('Yes')
elif SL[0] == SL[3] and SL[1] == SL[2]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
friends = map(int, input().split())


n = len([1 for x in friends if x>=K])

print(n)

Fixed submission:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

N = int(input())

if N%2==0:
    odd_count = N//2
else:
    odd_count = N//2+1
print('{:.10f}'.format(odd_count/N))

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

n = len([1 for x in friends if x>K])

print(n)

Fixed submission:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

N = int(input())

if N%2==0:
    odd_count = N//2
else:
    odd_count = N//2+1
print('{:.10f}'.format(odd_count/N))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split(''))
friends = list(map(int, input().split('')))

n = len([1 for x in friends if x>K])

print(n)

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


n = len([1 for x in friends if x>=K])

print(n)
Buggy python submission (verdict: Runtime Error):
N = int(input().split(''))
number_classmate = list(map(int, input().split('')))

classmate = [[0] * 2 for i in range(N)]

for i in range(len(number_classmate)):
    classmate[i][0] = number_classmate[i]
    classmate[i][1] = i+1
print(classmate)

classmate.sort(key=lambda s: s[0])

mapped_list = map(str, list(i[1] for i in classmate))
first_index = ' '.join(mapped_list)

print(first_index)





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

classmate = [[0] * 2 for i in range(N)]

for i in range(len(number_classmate)):
    classmate[i][0] = number_classmate[i]
    classmate[i][1] = i+1

classmate.sort(key=lambda s: s[0])

mapped_list = map(str, list(i[1] for i in classmate))
first_index = ' '.join(mapped_list)

print(first_index)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split)

if a==b and b==c:
    print('Yes')
else:
    print('No')

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


if a==b and b==c:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
"""
    S：長さNの文字列
    if S[i] = '0':
        color = 'red'
    elif S[i] = '1':
        color = 'blue'
    
    I can remove set of boxes which put together red and blue box.

    output : How many can I remove box?
"""
s = input()
count = 0

while len(s) > 0:
    i = 0

    while i < len(s):
        if i == len(s)-1:
            break
        if (s[i+1] == '0' and s[i+2] =='1') or (s[i+1] == '1' and s[i+2] =='1'):
            s = s[:i+1]+s[i+3:]
            count += 1
            break
        i += 1
    if i == len(s)-1:
            break

print(count*2)

Fixed submission:
s = input()
count1 = s.count('1')
count0 = s.count('0')

if count0 >= count1:
    print(count1*2)
else:
    print(count0*2)
Buggy python submission (verdict: Runtime Error):

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

if a+b+1 > c:
    count = b+c
else
    count = b+(a+b+1)

print(count)

Fixed submission:

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

if a+b+1 > c:
    count = b+c
else:
    count = b+(a+b+1)

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
"""
    高橋君の状態で場合分け
    if Takahashi's condition is going dead
        he should eat cookies enable him recover
    else Takahashi's condition is good
        he is able to eat delicious cookies.
"""

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

takahashi = True
takahashi_condition = True
count = 0

""" Start eating cookies"""
while takahashi_condition:
    if takahashi:
        if c > 0:
            c -= 1
            takahashi = False
            count += 1
        elif b > 0:
            b -= 1
            takahashi = True
            count += 1
            if b == 0:
                break
    else:
        if a == 0 and b == 0:
            break
        elif b > 0:
            b -= 1
            takahashi = True
            count += 1
        elif a > 0:
            takahashi = True
            a -= 1
        

print(count)

Fixed submission:

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

if a+b+1 > c:
    count = b+c
else:
    count = b+(a+b+1)

print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = n%500
print(int((n - m)*1000/ 500 + m*5//5))

Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
if S[3] == S[4] and S[5] == S[6]:
  print('Yes')
else:
  print('No')
  


Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
if S[3] == S[4] and S[5] == S[6]:
  print(Yes)
else:
  print(No)
  


Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
if  s[3] == s[4] and s[5] == s[6]:
  print('yes')
else:
  print('no')


Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
if  s[3] == s[4] and s[5] == s[6]:
  print(yes)
else:
  print(no)

Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
input()
s = [input()]
if s[3] == [4] and s[5] == s[6]:
  print('yes')
else:
  print('no')

Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s = input()

def kaibun1(w):
  w = str(w)
  t = len(w)
  n = 1
  while n < t//4:
    if w[n-1] == w[(t-1)//2 - (n-1)]:
      n += 1
    else:
      return False
      break

def kaibun2(w):
  w = str(w)
  t = len(w)
  m = 1
  while m < t//4:
    if w[t+3//2-1+(m-1)] == w[t-(m-1)]:
      m += 1
    else:
      return False
      break
if len(s) == 3:
  if s[0] == s[2]:
    print('Yes')
  else:
    print('No')
else:      
  if kaibun1(s)  is False or kaibun2(s) is False:
    print('No')
  else:
    print('Yes') 

Fixed submission:
s = input()
n = len(s)
s1 = s[0:(n-1)//2]
s2 = s1[::-1]
s3 = s[(n+3)//2-1:n]
s4 = s3[::-1]
if s1 == s2 == s3 == s4:
  print('Yes')
else:
  print('No')

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

def kaibun1(w):
  w = str(w)
  t = len(w)
  n = 1
  while n < t//4:
    if w[n-1] == w[(t-1)//2 - (n-1)]:
      n += 1
    else:
      return False
      break

def kaibun2(w):
  w = str(w)
  t = len(w)
  m = 1
  while m < t//4:
    if w[t+3//2-1+(m-1)] == w[t-(m-1)]:
      m += 1
    else:
      return False
      break
if kaibun1(s)  is False or kaibun2(s) is False:
  print('No')
else:
  print('Yes')

Fixed submission:
s = input()
n = len(s)
s1 = s[0:(n-1)//2]
s2 = s1[::-1]
s3 = s[(n+3)//2-1:n]
s4 = s3[::-1]
if s1 == s2 == s3 == s4:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
if s[0] == n[1] and s[1] == s[2]:
  print('Yes')
else:
  print('No')


Fixed submission:
S = input()
if S == 'AAA' or S == 'BBB':
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
S = input()
if S[0] == s[1] and s[1] == s[2]:
  print('Yes')
else:
  print('No')

Fixed submission:
S = input()
if S == 'AAA' or S == 'BBB':
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
S = input()
if S == AAA or S == BBB:
  print('No')
else:
  print('Yes')

Fixed submission:
S = input()
if S == 'AAA' or S == 'BBB':
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int.input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
    print('DENIED')
    exit()
print('APPROVED')


Fixed submission:
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      exit()
print('APPROVED')

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
    print('DENIED')
    exit()
print('APPROVED')


Fixed submission:
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      exit()
print('APPROVED')

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = (int(x) for x in input().split())
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
    print('DENIED')
    exit()
print('APPROVED')


Fixed submission:
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      exit()
print('APPROVED')

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = (int(x) for x in input().split())
for num in a:
  if num%2 = 0:
    if num%3 != 0 and num%5 != 0:
    print('DENIED')
    exit()
print('APPROVED')

Fixed submission:
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      exit()
print('APPROVED')
Buggy python submission (verdict: Runtime Error):
a, b = (int(x) for x in input().split())
a = str(a)*b
b = str(b)*a
lis = [a, b]
new_lis = soted(lis)
print(new_lis[1])

Fixed submission:
a, b = (int(x) for x in input().split())
a1 = str(a)*b
b1 = str(b)*a
lis = [a1, b1]
new_lis = sorted(lis)
print(new_lis[0])
Buggy python submission (verdict: Runtime Error):
A = int(input())

count =  0

if A<10:
    count= A
elif A <100:
    count = 9 
elif A < 1000:
    count = 9 + A - 99
elif A < 10000:
    count = 9 + 900
elif A < 100000:
    count = 9 + 900 + (A-9999)
elif A =100000:
    count = 90909
else:
    

print(count)


Fixed submission:
A = int(input())

count =  0

if A<10:
    count= A
elif A <100:
    count = 9 
elif A < 1000:
    count = 9 + A - 99
elif A < 10000:
    count = 9 + 900
elif A < 100000:
    count = 9 + 900 + (A-9999)
else:
    count = 90909
    

print(count)