Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  board = []
  for _ in range(n):
    board.append(list(input().strip()))
  
  def judge(ia):
    for i in range(n):
      for j in range(i+1, n):
        if board[(i+ia)%n][j] != board[(j+ia)%n][i]:
          return False
    return True
  
  cnt = 0 
  for ia in range(n):
    if judge(ia):
      cnt += 1
  print(n * cnt)
  
if __name__=='__main__':
  main()



Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  board = []
  for _ in range(n):
    board.append(list(input().strip()))
  
  def judge(ia):
    for i in range(n):
      for j in range(i+1, n):
        if board[(i+ia)%n][j] != board[(j+ia)%n][i]:
          return False
    return True
  
  cnt = 0 
  for ia in range(n):
    if judge(ia):
      cnt += 1
  print(n * cnt)
  
if __name__=='__main__':
  main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  board = []
  for _ in range(n):
    board.append(list(input().strip()))
  
  def judge(ia):
    for i in range(n):
      for j in range(i+1, n):
        if board[(i+ia)%n][j] != board[(j+ia)%n][i]:
          return False
    return True
  
  cnt = 0 
  for ia in range(n):
    if judge(ia):
      cnt += 1
  print(n * cnt)
  
if __name__=='__main__':
  main()



Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  board = []
  for _ in range(n):
    board.append(list(input().strip()))
  
  def judge(ia):
    for i in range(n):
      for j in range(i+1, n):
        if board[(i+ia)%n][j] != board[(j+ia)%n][i]:
          return False
    return True
  
  cnt = 0 
  for ia in range(n):
    if judge(ia):
      cnt += 1
  print(n * cnt)
  
if __name__=='__main__':
  main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3r
# -*- coding:utf-8 -*-

from itertools import permutations

def main():
  n, m, nr = map(int, input().split())
  lr = list(map(lambda x:int(x)-1, input().split()))
  edges = [[10**9]*n for _ in range(n)]
  for i in range(n):
    edges[i][i] = 0
  for _ in range(m):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    edges[a][b] = edges[b][a] = c
    
  def wf():
    for k in range(n):
      for i in range(n):
        for j in range(n):
          edges[i][j] = min(edges[i][j], edges[i][k] + edges[k][j])
  wf()
          
  def calc_cost(path):
    cost = 0
    for i in range(nr-1):
      cost += edges[path[i]][path[i+1]]
    return cost
  
  print(min([calc_cost(path) for path in permutations(lr)]))

if __name__=='__main__':
  main()



Fixed submission:
#!/usr/bin/python3r
# -*- coding:utf-8 -*-

from itertools import permutations

def main():
  n, m, nr = map(int, input().split())
  lr = list(map(lambda x:int(x)-1, input().split()))
  edges = [[10**9]*n for _ in range(n)]
  for i in range(n):
    edges[i][i] = 0
  for _ in range(m):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    edges[a][b] = edges[b][a] = c
    
  def wf():
    for k in range(n):
      for i in range(n):
        for j in range(n):
          edges[i][j] = min(edges[i][j], edges[i][k] + edges[k][j])
  wf()
          
  def calc_cost(path):
    cost = 0
    for i in range(nr-1):
      cost += edges[path[i]][path[i+1]]
    return cost
  
  print(min([calc_cost(path) for path in permutations(lr)]))

if __name__=='__main__':
  main()
Buggy python submission (verdict: Runtime Error):
from functools import reduce, gcd

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) > k and (max(la) - k) % (reduce(gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()

Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from functools import reduce

def calc_gcd(a, b):
  if a > b:
    a, b = b, a
  while b % a:
    a, b = b % a, a
  return a

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) >= k and k % (reduce(calc_gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import gcd
from functools import reduce

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) > k and (max(la) - k) % (reduce(gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()



Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from functools import reduce

def calc_gcd(a, b):
  if a > b:
    a, b = b, a
  while b % a:
    a, b = b % a, a
  return a

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) >= k and k % (reduce(calc_gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()
Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
    x, a ,b = input().split()
    if b - a <= 0:
        print("delicious")
    elif b - a <= x:
        print("safe")
    else:
        print("dangerous")


Fixed submission:
if __name__=="__main__":
    x, a ,b = map(int, input().split())
    if b - a <= 0:
        print("delicious")
    elif b - a <= x:
        print("safe")
    else:
        print("dangerous")
Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
    s = int(input())
    if(s < 1200):
	print("ABC")
    else:
        print("ARC")

Fixed submission:
if __name__=="__main__":
    s = int(input())
    if(s < 1200):
        print("ABC")
    else:
        print("ARC")

Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
    [s] = map(int,input().split())
    if(s < 1200):
	print("ABC")
    else:
        print("ARC")

Fixed submission:
if __name__=="__main__":
    s = int(input())
    if(s < 1200):
        print("ABC")
    else:
        print("ARC")

Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
    [s] = map(int,input().split())
    if(a < 1200):
    	print("ABC")
    else:
	print("ARC")

Fixed submission:
if __name__=="__main__":
    s = int(input())
    if(s < 1200):
        print("ABC")
    else:
        print("ARC")
Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
    s=int(input().split()[0])
    q=int(s/11)
    r=s%11
    if(r!=0):
	r=int((r-1)/6+1)
    print(2*q+r)

Fixed submission:
if __name__=="__main__":
    [s] = map(int, input().split())
    q = int(s / 11)
    r = s % 11
    if(r!=0):
        r = int((r-1)/6 + 1)
    print(2*q + r)

Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
s = int(input().split()[0])
    q = int(s / 11)
    r = s % 11
    if(r!=0):
	r = int((r-1)/6 + 1)
    print(2*q + r)

Fixed submission:
if __name__=="__main__":
    [s] = map(int, input().split())
    q = int(s / 11)
    r = s % 11
    if(r!=0):
        r = int((r-1)/6 + 1)
    print(2*q + r)

Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
    s	= int(input().split()[0])
    q =	int(s / 11)
    r =	s % 11
    if(r!=0):
	r = int((r-1)/6 + 1)
    print(2*q + r)

Fixed submission:
if __name__=="__main__":
    [s] = map(int, input().split())
    q = int(s / 11)
    r = s % 11
    if(r!=0):
        r = int((r-1)/6 + 1)
    print(2*q + r)

Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
    [s]	= map(int, input().split())
    q =	int(s / 11)
    r =	s % 11
    if(r != 0):
	r = int((r-1)/6 + 1)

    print(2*q + r)

Fixed submission:
if __name__=="__main__":
    [s] = map(int, input().split())
    q = int(s / 11)
    r = s % 11
    if(r!=0):
        r = int((r-1)/6 + 1)
    print(2*q + r)
Buggy python submission (verdict: Time Limit Exceeded):
if __name__=="__main__":
    n = int(input())
    As = list(map(int,input().split()))
    Non_dup_As = list(set(As))
    count = 0
    for a in Non_dup_As:
        count+=As.count(a)-1
    if(count % 2 == 0):
        print(len(As) - int(count))
    else:
        print(len(As) - int(count+1))


Fixed submission:
if __name__=="__main__":
    n = int(input())
    As = list(map(int,input().split()))
    Non_dup_As = list(set(As))
    count = len(Non_dup_As)
    if(count % 2 == 0):
        print(count - 1)
    else:
        print(count)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__=="__main__":
    n = int(input())
    As = list(map(int,input().split()))
    Non_dup_As = list(set(As))
    As.sort()
    count = 0
    for a in Non_dup_As:
        count+=As.count(a)-1
    if(count % 2 == 0):
        print(len(As) - int(count))
    else:
        print(len(As) - int(count+1))


Fixed submission:
if __name__=="__main__":
    n = int(input())
    As = list(map(int,input().split()))
    Non_dup_As = list(set(As))
    count = len(Non_dup_As)
    if(count % 2 == 0):
        print(count - 1)
    else:
        print(count)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import ceil

def main():
  n = int(input())
  for i in range(n):
    t, a = map(int, input().split())
    if i == 0:
      nt, na =  t, a
      continue
    cands = list(filter(lambda x: x[0] >= nt and x[1] >= na, [(ceil(nt/t)*t, ceil(nt/t)*a), (ceil(na/a)*t, ceil(na/a)*a)]))
    nt, na = min(cands)
  print(nt + na)

if __name__=='__main__':
  main()



Fixed submission:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def ceil(a, b):
  return (a + b - 1) // b

def main():
  n = int(input())
  nt, na = 1, 1
  for i in range(n):
    t, a = map(int, input().split())
    r = max([ceil(nt, t), ceil(na, a)])
    nt, na = r*t, r*a
  print(nt + na)

if __name__=='__main__':
  main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))

i = 0
cnt = 0
while len(A) > i:
    if A[i] != i + 1:
        A.pop(i)
        cnt += 1
    else:
        i += 1
if cnt == n:
    print(-1)
else:
    print(cnt)



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

i = 1
cnt = 0
for a in A:
    if a != i:
        cnt += 1
    else:
        i += 1
if cnt == n:
    print(-1)
else:
    print(cnt)
Buggy python submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A,B,C,D = map(int,input().split())
lcm = lcm(C,D)
print((B - A + 1) - ((B // D - (A - 1) // D) + (B // C - (A - 1) // C) - (B // lcm - (A - 1) // lcm)))

Fixed submission:
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

A,B,C,D = map(int,input().split())
lcm = lcm(C,D)
print((B - A + 1) - ((B // D - (A - 1) // D) + (B // C - (A - 1) // C) - (B // lcm - (A - 1) // lcm)))
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
#print(A)
X = [0 for i in range(N)]
CB = []
for i in range(M):
    b,c = map(int,input().split())
    CB.append([c,b])
CB.sort(reverse=True)
#print(CB)
index = 0
for i in range(M):
    for j in range(CB[i][1]):
        A[index] = max(A[index],CB[i][0])
        index += 1
        if index != N - 1:
            continue
        else:
            print(sum(A))
            exit()
print(sum(A))

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
#print(A)
X = [0 for i in range(N)]
CB = []
for i in range(M):
    b,c = map(int,input().split())
    CB.append([c,b])
CB.sort(reverse=True)
#print(CB)
index = 0
for i in range(M):
    for j in range(CB[i][1]):
        A[index] = max(A[index],CB[i][0])
        if index != N - 1:
            index += 1
            continue
        else:
            print(sum(A))
            exit()
print(sum(A))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
#print(A)
CB = []
for i in range(M):
    b,c = map(int,input().split())
    CB.append([c,b])
CB.sort(reverse=True)
#print(CB)

ans = 0
for i in range(M):
    if A[CB[i][1]-1] < CB[i][0]:
        ans += CB[i][0] * CB[i][1]
        for j in range(CB[i][1]):
            A.pop(0)
    else:
        for j in range(CB[i][1]):
            if A[0] < CB[i][0]:
                ans += CB[i][0]
                A.pop(0)
                continue
            else:
                ans += sum(A)
                A = []
                break
        break

if len(A) != 0:
    ans += sum(A)

print(ans)

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
#print(A)
X = [0 for i in range(N)]
CB = []
for i in range(M):
    b,c = map(int,input().split())
    CB.append([c,b])
CB.sort(reverse=True)
#print(CB)
index = 0
for i in range(M):
    for j in range(CB[i][1]):
        A[index] = max(A[index],CB[i][0])
        if index != N - 1:
            index += 1
            continue
        else:
            print(sum(A))
            exit()
print(sum(A))
Buggy python submission (verdict: Runtime Error):
x = []
y = []
for i in range(5):
    a = int(input())
    if a % 10 != 0:
        y.append(a % 10)
    if a % 10 != 0:
        a = a + (10 - (a % 10))
    x.append(a)

ans = sum(x)
s = 10 - min(y)

ans -= s

print(ans)

Fixed submission:
x = []
y = []
for i in range(5):
    a = int(input())
    if a % 10 != 0:
        y.append(a % 10)
    if a % 10 != 0:
        a = a + (10 - (a % 10))
    x.append(a)

ans = sum(x)
if len(y) != 0:
    s = 10 - min(y)
    ans -= s

print(ans)
Buggy python submission (verdict: Runtime Error):
A = str(input())
S = []
for s in A:
    S.append(s)
ACGT = ["A","C","G","T"]
X = []
cnt = 0
ans = []
for i in range(len(S)):
    if S[i] in ACGT:
        cnt += 1
        continue
    else:
        ans.append(cnt)
        cnt = 0

print(max(ans))


Fixed submission:
A = str(input())
S = []
for s in A:
    S.append(s)
ACGT = ["A","C","G","T"]
X = []
cnt = 0
ans = []
for i in range(len(S)):
    if S[i] in ACGT:
        cnt += 1
        continue
    else:
        ans.append(cnt)
        cnt = 0
ans.append(cnt)
print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import copy
S = list(input())
counter = 0
while(True):
    idxs = []
    flag = 0
    
    for i in range(len(S)-1):
        if flag == 1:
            flag = 0
            continue
        if S[i] != S[i+1]:
            idxs.append(i)
            idxs.append(i+1)
            flag = 1
    
    Scopy = []
    for i in range(len(S)):
        if i not in idxs:
            Scopy.append(S[i])
    S = copy.copy(Scopy)
    counter += len(idxs)
    #print(len(idxs))

    if len(idxs) == 0:
        break

print(counter)

Fixed submission:
import copy
S = list(map(int,input()))
cnt0 = 0
cnt1 = 0
for i in range(len(S)):
    if S[i] == 0:
        cnt0 += 1
    else:
        cnt1 += 1

ans = cnt0 + cnt1 - abs(cnt0-cnt1)
print(ans)
Buggy python submission (verdict: Runtime Error):
import copy
N,M = map(int,input().split())
A = list(map(int,input().split()))
x = A.pop(0)
for i in range(N-1):
    B = list(map(int,input().split()))
    B.pop(0)
    y = len(A)
    C = copy.deepcopy(A)
    for j in range(y):
        if C[j] not in B:
            A.pop(j)
    if len(A) == 0:
        break

print(len(A))

Fixed submission:
N,M = map(int,input().split())
A = [0 for i in range(M)]
for i in range(N):
    B = list(map(int,input().split()))
    B.pop(0)
    for j in range(len(B)):
        A[B[j]-1] += 1

cnt = 0
for i in range(M):
    if A[i] == N:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
Alist = []
Blist = []
sumlist = []

for i in range(N):
    a,b = map(int,input().split())
    Alist.append(a)
    Blist.append(b)
    sumlist.append(a+b)

counter = 0
takahasi = 0
aoki = 0
for i in range(N):
    if counter == 0:
        index = sumlist.index(max(sumlist))
        takahasi += Alist[index]
        sumlist[index] = 0
        counter = 1
        continue
    if counter == 1:
        index = sumlist.index(max(sumlist))
        aoki += Blist[index]
        sumlist[index] = 0
        counter = 0
        continue

print(takahasi-aoki)


Fixed submission:
import numpy as np

N = int(input())
Alist = []
Blist = []
sumlist = []

for i in range(N):
    a,b = map(int,input().split())
    Alist.append(a)
    Blist.append(b)
    sumlist.append(a+b)

index = np.argsort(sumlist)

sumlist = np.sort(sumlist)




counter = 0
takahasi = 0
aoki = 0

for i in range(N)[::-1]:
    if counter == 0:
        takahasi += Alist[index[i]]
        counter = 1
        continue
    if counter == 1:
        aoki += Blist[index[i]]
        counter = 0
        continue

print(takahasi-aoki)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
Alist = []
Blist = []
sumlist = []

for i in range(N):
    a,b = map(int,input().split())
    Alist.append(a)
    Blist.append(b)
    sumlist.append(a+b)

counter = 0
takahasi = 0
aoki = 0
for i in range(N):
    if counter == 0:
        takahasi += Alist[sumlist.index(max(sumlist))]
        sumlist[sumlist.index(max(sumlist))] = 0
        counter = 1
        continue
    if counter == 1:
        aoki += Blist[sumlist.index(max(sumlist))]
        sumlist[sumlist.index(max(sumlist))] = 0
        counter = 0
        continue

print(takahasi-aoki)




Fixed submission:
import numpy as np

N = int(input())
Alist = []
Blist = []
sumlist = []

for i in range(N):
    a,b = map(int,input().split())
    Alist.append(a)
    Blist.append(b)
    sumlist.append(a+b)

index = np.argsort(sumlist)

sumlist = np.sort(sumlist)




counter = 0
takahasi = 0
aoki = 0

for i in range(N)[::-1]:
    if counter == 0:
        takahasi += Alist[index[i]]
        counter = 1
        continue
    if counter == 1:
        aoki += Blist[index[i]]
        counter = 0
        continue

print(takahasi-aoki)
Buggy python submission (verdict: Time Limit Exceeded):
X,Y = map(int,input().split())
i = 1
if X == Y:
    print(-1)
    exit()
while True:
    if X * i % Y != 0:
        break
    if X * i > 10**18:
        print(-1)
        exit()
    i += 1
print(X * i)

Fixed submission:
X,Y = map(int,input().split())
i = 1
if X % Y == 0:
    print(-1)
    exit()
while True:
    if X * i % Y != 0:
        break
    if X * i > 10**18:
        print(-1)
        exit()
    i += 1
print(X * i)
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
found = False
for i in range(1,B+1):
    if A * i % B == C:
        found = True
if found = True:
    print("YES")
else:
    print("NO")


Fixed submission:
A,B,C = map(int,input().split())
i = 1
ans = "NO"
modlist = []
while True:
    if (B * i + C) % A == 0:
        ans = "YES"
        break
    else:
        modlist.append((B * i + C) % A)
        i += 1
    if len(modlist) != len(set(modlist)):
        break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
A = list(map(int, input().split()))
 
s = A[0]
for i in range(1, n):
  s *=A[i]
 
if s <= 1000000000000000000:
  print(s)
elif s > 1000000000000000000:
  print(-1)

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

  if 0 in A:
    print(0)
    return

  p = 1
  for a in A:
    p *= a
    if p > 10 ** 18:
      print(-1)
      return

  print(p)
main()

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

s = A[0]
for i in range(1, n):
  s *=A[i]

if s <= 1000000000000000000:
  print(s)
elif s > 1000000000000000000:
  print(-1)

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

  if 0 in A:
    print(0)
    return

  p = 1
  for a in A:
    p *= a
    if p > 10 ** 18:
      print(-1)
      return

  print(p)
main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for _ in range(N)]
uniqued = []
for x in S:
  if not x in uniqued:
    uniqued.append(x)
print(len(uniqued))

Fixed submission:
N = int(input())
S = [input() for _ in range(N)]
uniqued = list(set(S))
print(len(uniqued))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for _ in range(N)]
uniqued = []
for x in S:
  if not x in uniqued:
    uniqued.append(x)
print(len(uniqued))

Fixed submission:
N = int(input())
S = [input() for _ in range(N)]
uniqued = list(set(S))
print(len(uniqued))
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
b = 0
if X == 1:
  print(0)
else:
  while b <= N: 
    N = abs(N - X)
    b = abs(N - X)
  print(N)

Fixed submission:
X, Y, Z = input().split()
print(Z, X, Y)
Buggy python submission (verdict: Time Limit Exceeded):
N, X = map(int, input().split())
b = 0
if X == 1:
  print(0)
else:
  while b <= N: 
    N = abs(N - X)
    b = abs(N - X)
  print(N)

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

K = N%X
k = X - K

if K == 0:
  print(0)
elif K >= k:
  print(k)
else:
  print(K)

Buggy python submission (verdict: Time Limit Exceeded):
N, X = map(int, input().split())
b = 0
if X == 1:
  print(0)
else:
  while b <= N: 
    N = abs(N - X)
    b = abs(N - X)
  print(N)

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

K = N%X
k = X - K

if K == 0:
  print(0)
elif K >= k:
  print(k)
else:
  print(K)
Buggy python submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
print(A)
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0

for l in B:
  if l % 5 == 0 or l % 3 == 0:
    C = C + 1
 
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')



Fixed submission:
N = int(input())
*A, = map(int, input().split())
B = []
C = 0
for i in A:
  if i % 2 == 0:
    B.append(i)
    if i % 5 == 0 or i % 3 == 0:
      C += 1
 
if C == len(B):
  print('APPROVED')
else:
  print('DENIED')

Buggy python submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
print(A)
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 5 == 0 or l % 3 == 0:
    C = C + 1
 
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')

Fixed submission:
N = int(input())
*A, = map(int, input().split())
B = []
C = 0
for i in A:
  if i % 2 == 0:
    B.append(i)
    if i % 5 == 0 or i % 3 == 0:
      C += 1
 
if C == len(B):
  print('APPROVED')
else:
  print('DENIED')

Buggy python submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())

B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 5 == 1 or l % 3 == 0:
    C = C + 1
 
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')

Fixed submission:
N = int(input())
*A, = map(int, input().split())
B = []
C = 0
for i in A:
  if i % 2 == 0:
    B.append(i)
    if i % 5 == 0 or i % 3 == 0:
      C += 1
 
if C == len(B):
  print('APPROVED')
else:
  print('DENIED')

Buggy python submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 5 == 1 or l % 3 == 0:
    C += C + 1

if C/len(B) ==1:
  print('APPROVED')
else:
  print('DENIED')

Fixed submission:
N = int(input())
*A, = map(int, input().split())
B = []
C = 0
for i in A:
  if i % 2 == 0:
    B.append(i)
    if i % 5 == 0 or i % 3 == 0:
      C += 1
 
if C == len(B):
  print('APPROVED')
else:
  print('DENIED')

Buggy python submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
B = []
C = 1

for i in A:
  if i % 2 == 0:
    B.append(i)

for l in B:
  if l % 3 == 1 or l % 5 == 0:
    C += C + 1
    
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')

Fixed submission:
N = int(input())
*A, = map(int, input().split())
B = []
C = 0
for i in A:
  if i % 2 == 0:
    B.append(i)
    if i % 5 == 0 or i % 3 == 0:
      C += 1
 
if C == len(B):
  print('APPROVED')
else:
  print('DENIED')