Problem:


Score: 200 points

Problem Statement

You are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.

According to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:

All even numbers written on the document are divisible by 3 or 5.

If the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.

Notes

The condition in the statement can be rephrased as "If x is an even number written on the document, x is divisible by 3 or 5".
Here "if" and "or" are logical terms.

Constraints

All values in input are integers.

1 \leq N \leq 100

1 \leq A_i \leq 1000

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 \dots A_N

Output

If the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.

Sample Input 1

5
6 7 9 10 31

Sample Output 1

APPROVED

The even numbers written on the document are 6 and 10.

All of them are divisible by 3 or 5, so the immigrant should be allowed entry.

Sample Input 2

3
28 27 24

Sample Output 2

DENIED

28 violates the condition, so the immigrant should not be allowed entry.



Sample input:
5
6 7 9 10 31


Sample output:
APPROVED

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
even = []
for i in A:
    if i%2 == 0:
        even.append(i)
for j in even:
    if j%3 == 0 or j%5 == 0:
        approved = True
    else:
        approved = False
        break
if approved:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
a = [ int(input()) for i in range(int(input()))]
flag = True
for i in a:
  if i % 2 == 0:
    if i%3 != 0 and i%5 != 0:
      flag = False
      break
print('APPROVED' if flag else 'DENIED')

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
a = list(map(int, input().split()))
a = np.array(a)
a = a[a%2==0]

for i in range(n):
    if a[i]%3 != 0 and a[i]%5 != 0:
        return print("APPROVED")

return print("DENIED")

Submission status: Runtime Error

Solution code:
N = int(input())
A = map(int, input().split())

a = list(filter(lambda i: i%3 != 0 and i%5 != 0 and i % 2 == 0, A)))
print("APPROVED" if len(a) == 0 else "DENIED")

Submission status: Runtime Error

Solution code:
a=input()
s=list(map(int, input().split()))
bad=0
for i in s:
    if s%2==0:
        if s%3!=0 or s%5!=0:
            bad+=1
if bad>0:
    print('DENIED') 
else:
    print('APPROVED')

Submission status: Runtime Error

Solution code:
a=input()
s=list(map(int, input().split()))
bad=0
for i in s:
    if s%2==0:
        if s%3!=0 or s%5!=0:
            bad+=1
if bad>0:
    print('DENIED') 
    else:
        print('APPROVED')

Submission status: Runtime Error

Solution code:
import numpy as np
 
stdin = open(0)
data = np.fromstring(stdin.read(), np.int32, sep=' ')
N = data[0]
A = data[1]

flag = True
for a in A:
  if a%2 == 0:
    if a%3 != 0 or a%5 != 0:
      flag = False

if flag:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
n=int(input)
A=list(map(int,input().split()))
for a in A:
    if a%2==0:
        if a%3!=0 and a%5!=0:
            print('DENIED')
            exit()
print('APPROVED')

Submission status: Runtime Error

Solution code:
N = int(input())
A = map(int,input().split())
for a in A:
  if a % 2 == 0 and A % 3 != 0 and A % 5 != 0:
    print('DENIED')
    exit()
print('APPROVED')

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
  if (a[i]%2==0):
    if(a[i]/3!=0 or a[i]/5!=0):
   		 print("DENIED")
    else:
		 print("APPROVED")

Submission status: Runtime Error

Solution code:
N = int(input())
X = list(map(int,input().split()))

i = 0
a = 0
b = 0

for i in range(N):
  if X[i] // 2 == 0:  
    a = a + 1
    if X[i] // 3 == 0 or X[i] // 5 == 0:
      y = y + 1
    else:
      break
  else:
    b = b + 1

if b == 0 and N == y:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
a = int(input())
b = set(map(int,input().split()))
c = 0
d = 0
for int(i) in b:
  if i%2==0:
    c+=1
    if i%a==0:
      d+=1
if c!=d:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Runtime Error

Solution code:
a = int(input())
b = set(map(int,input().split()))
c = 0
d = 0
for int(i) in b:
  if i%2==0:
    c+=1
    if i%a==0:
      d+=1
if c==d:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
A= map(int,input().split())
for i in range(n):
    if(A[i]%2==0):
        if(A[i]%5!=0 or A[i]%3!=0):
            print("DENIED")
            exit()
print("APPROVED")

Submission status: Runtime Error

Solution code:
a = int(input())
b = list(map(int,input().split()))
c = 0
d = 0
for int(i) in b:
  if i%2==0:
    c=c+1
    if i%a==0:
      d=d+1
if c==d:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
a = int(input())
b = map(int,input().split())
c = 0
d = 0
for int(i) in b:
  if i%2==0:
    c=c+1
    if i%a==0:
      d=d+1
if c==d:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
N = int(input().strip())
array = list(map(int, input().strip().split()))
for i in array:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      fg = True
    else:
      fg = False
      print('DENIED')
      break
if fg:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      ans = 'APPROVED'
    else:
      print('DENIED')
      exit()
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input().strip())
array = list(map(int, input().strip().split()))
for i in array:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      fg = True
    else:
      fg = False
      print('DENIED')
      break
if fg:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())

for i in range(a):
  lis = list(map(int, input().split()))
  judge = True
  if (lis[i] % 2 == 0):
    if (lis[i] % 3 != 0) and (lis[i] % 5 != 0):
      judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
def fun(li):
  for i in li:
    if i%2 == 0:
      if i%3 == 0 or i%5 ==0:
        continue;
      else:
        return "DENIED"
	return "APPROVED"      
n = int(input())
li = [int(num) for num in input().split(" ")]
print(fun(li))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
for i in range(a):
  b = int(input())
  judge = True
  if (b % 2 == 0):
    if (b % 3 != 0) and (b % 5 != 0):
      judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
wk = wk1 = 0

for i in range(n):
    if a[i]%2 == 0:
        b.append(a[i])

for j in range(len(b)):
    if b[j]%3 == 0 or b[j]%5 == 0:
        wk = 1
    else:
        wk1 = 1
if wk1 == 1:
    print('DENIED')
else:5
    print('APPROVED')

Submission status: Runtime Error

Solution code:
import sys
n = int,input()
listA = list(map(int,input().split()))
listEven = []
for A in listA:
    if A % 2 == 0:
        listEven.append(A)

for even in listEven:
    if not (even % 3 == 0 or even % 5 == 0):
        print('DENIED')
        sys.exit(1)
print('APPROVED')

Submission status: Runtime Error

Solution code:
def fun(li):
  for i in li:
    if i%2 == 0:
      if i%3 == 0 or i%5 ==0:
        continue;
      else:
        return "DENIED"
return "APPROVED"      
n = int(input())
li = [int(num) for num in input().split(" ")]
print(fun(li))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0):
    if (b % 3 != 0) and (b % 5 != 0):
      judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
def fun(li):
  for i in li:
    if i%2 == 0:
      if i%3 == 0 or i%5 ==0:
        continue;
      else:
        return "DENIED"
return "APPROVED"      
n = int(input())
li = [int(num) for num in input.split(" ")]
print(fun(li))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0)
    if (b % 3 != 0) and (b % 5 != 0):
      judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
def fun(li):
  for i in li:
    if i%2 == 0:
      if i%3 == 0 or i%5 ==0:
        continue;
      else:
        return "DENIED"
return "APPROVED      
n = int(input())
li = [int(num) for num in input.split(" ")]
print(fun(li))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0)
    if (b % 3 != 0) or (b % 5 != 0):
      judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
a,b,c = map(int, input().split())
if (a==b or a==c) and (b!=c):
    print('Yes')
elif (b==a or b==c) and (a!=c):
    print('Yes')
elif (c==a or c==b) and (a!=b):
    print('Yes')
else:
    print('No')



n = int(input())
flag=0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i%2==0 and i%3!=0 and i%5!=0:
        flag=1 
    else:
        continue
if flag==1:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0) and (b % 3 != 0) and (b % 5 != 0):
    judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
if (A == B or A == C) and (B != C):
    print('Yes')
elif (B == A or B == C) and (A != C):
    print('Yes')
elif (C == A or C == B) and (A != B):
    print('Yes')
else:
    print('No')

n = int(input())
flag = 0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flag = 1
    else:
        continue
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0) and ((b % 3 != 0) or (b % 5 != 0)):
    judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
status = "DENIED"
count =True
for i in range(n):
  m = int(input())
  if (m%2==0):
    if(m%3==0) or (m%5==0):
      status = "APPROVED"
    else:
      count = False
 
if count:
  print(status)
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0) and ((b % 3 == 0) or (b % 5 == 0)):
    judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

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

count = 0
if len([i for i in A if i%2 == 0 ]) ==0:
    print("APPROVED")
else:
    a = [i for i in A if i%2 == 0 ]
    for j in a:
        if j%3 == 0 or j%5 == 0:
            count += 1
    
if count == len(a):
    print("APPROVED")

else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
N = int(input()) 
s = [input() for i in range(N)] 
f = list(filter(lambda x: x % 2 == 0, s))
f2 = list(filter(lambda x: x % 3 == 0, f))
f3 = list(filter(lambda x: x % 5 == 0, f))
  if f2 >= 0:
    print('APPROVED')
  elif F3 >= 0:
    print('APPROVED')
  else :
    print('DENIED')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0) & ((b % 3 == 0) or (b % 5 == 0)):
    judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
l = [int(x) for x in input().split() if x % 2 != 0]

flag = True

for x in l:
  if x % 3 or x % 5:
    flag = False
  else:
    continue

if flag:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
a = int(input())

b=[]
for i in range(a):
	b.append(int(input()))
x = 0
 
if (a==0) :
	print('DENIED')
elif (b.count(0) > 0):
	print('DENIED')
else:
  for i in b:
      if i % a == 0:
          x += 1
  if x == len(b):
      print('APPROVED')

Submission status: Runtime Error

Solution code:

n = int(input())
l = [int(x) for x in input().split() if not x % 2]

flag = True

for x in l:
  if x % 3 or x % 5:
    flag = False
  else:
    continue

if flag:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
n = int(input())
status = "No"
count =True
for i in range(n):
  m = int(input())
  if (m%2==0):
    if(m%3==0) or (m%5==0):
      status = "Yes"
    else:
      count = False

if count:
  print(status)
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
arr = []
for i in range(n):
    arr.append(int(input())) 
if arr[i]%2 :
    if arr[i]%3 or arr[i]%5 :
      print("Approved")
else: 
  print("Denied")

Submission status: Runtime Error

Solution code:
N = int(input()) 
s = [int(input()) for i in range(N)] 
if s % 2 == 0:
  if s % 3 == 0:
    print('APPROVED')
  elif s % 5 == 0:
    print('APPROVED')
  else :
    print('DENIED')
else :
  print('DENIED')

Submission status: Runtime Error

Solution code:
N = input()
A = [int(x) for x in input().split()]
x=0
for i in A:
  if A%2==0:
    if not A%3==0 or A%5==0:
      print("DENIED")
      x=1
      break
    
  else:
   	continue
  break
if x !=0:
	print("APPROVED")

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
N = int(input())
AN = list(map(int, input().split()))

AN2 = AN[AN % 2 == 0]
(AN % 2 == 0).size
if AN2[AN2 % 3 == 0].size + AN2[AN2 % 5 ==0].size - AN2[AN2 % 15 ==0].size == AN2.size:
    print('APPROVED')

else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
from functools import reduce

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

R = reduce(lambda x, y: x and y, [n % 3 == 0 or n % 5 == 0 for n in AL if n % 2 == 0])

if R:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
a = int(input())
b=[]
b.append(int(input()))
x = 0
 
if (a==0) :
	print('DENIED')
elif (b.count(0) > 0):
	print('DENIED')
else:
  for i in b:
      if i % a == 0:
          x += 1
  if x == len(b):
      print('APPROVED')
  else:

Submission status: Runtime Error

Solution code:
n = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) == N:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
import sys
n = input().split()
ln = list(map(int, input().split()))
for l in ln:
  if l % 2 == 1:
    continue
  if l % 3 != 0 and l % 5 != 0:
    print("DENIED")
    sys.exit(1)
print("APPROVED")

Submission status: Runtime Error

Solution code:
n = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) = N:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
x = 0
 
if (a==0) :
	print('DENIED')
elif (b.count(0) > 0):
	print('DENIED')
else:
  for i in b:
      if i % a == 0:
          x += 1
  if x == len(b):
      print('APPROVED')
  else:
      print('DENIED')

Submission status: Runtime Error

Solution code:
N = int(input()) 
s = [input() for i in range(N)] 
if s % 2 == 0:
  if s % 3 == 0:
    print('APPROVED')
  elif s % 5 == 0:
    print('APPROVED')
  else :
    print('DENIED')
else :
  print('DENIED')

Submission status: Runtime Error

Solution code:
a = int(input())
b = input()
x = 0

if (a==0) :
	print('DENIED')
elif (b.count(0) > 0):
	print('DENIED')
else:
  for i in b:
      if i % a == 0:
          x += 1
  if x == len(b):
      print('APPROVED')
  else:
      print('DENIED')

Submission status: Runtime Error

Solution code:
N = input()
N = int(N)
A = list(map(int,input().split()))
B = [ i for i in A if i % 2 == 0 or ]
C = [ d for d in B if i % 3 == 0 or i % 5 == 0]
R = len(C)
if R == 0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
a = int(input())
b = map(int, input().split())
x = 0

if (a==0) :
	print('DENIED')
elif (b.count(0) > 0):
	print('DENIED')
else:
  for i in b:
      if i % a == 0:
          x += 1
  if x == len(b):
      print('APPROVED')
  else:
      print('DENIED')

Submission status: Runtime Error

Solution code:
a=int(input())
Papers=list(map(int,input().split()))
m=0
for i in range (a):
  if Papers[i] %2==0:
    if not (Papers[i] %3==0 or Papers[i] %5==0):
      m=m+1

if not m=0:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Runtime Error

Solution code:
#import sys
a=input()
b=list(map(int,input().split()))
a=int(a)
c=1
for i in range(1,a-2):
  if b[i-1] % 2 == 1:
    b.remove(b[i-1])
  else:
    pass
#print(b)
for i in range(len(b)):
  if b[i] % 3 ==0:
    pass
  elif b[i] % 5 == 0:
    pass
  else:
    print('DENIED')
    c=2
    break
if c==1:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
n = input()
a = list(map(int,input().split()))
ans = 0
for i in range(n):
  if (a[i] % 3 == 0 or a[i] % 5 == 0) and a[i] %2 ==0:
    ans +=1
if ans == n:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int[] myArray = new int[N];
        for(int i=0;i<N;i++)
        {
            myArray[i] = input.nextInt();
        }
        for(int i : myArray)
        {
            if(i%3==0||i%5==0)
                System.out.println("APPROVED");
            else
                System.out.println("DENIED");
        }

    }
}

Submission status: Runtime Error

Solution code:
n =int(input())
A = [0 if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 
    for x in input().split()]]
if not A:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Runtime Error

Solution code:
rt numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = list[list%2 == 0]
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))

if len(A) ==0:
        print('APPROVED')
elif len(B) ==0:
    print('DENIED')
else:
    if len(A) == len(B) :
        print('APPROVED')
    else:
        print('DENIED')

Submission status: Runtime Error

Solution code:


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 == 0:
            if i % 3 == 0:
                ret = "APPROVED"
            elif i % 5 == 0:
                ret = "APPROVED"
            else:
                ret  = "DENIED"
                break
        else:
            continue
    print(ret)

Submission status: Runtime Error

Solution code:
N = int(input())
c = 0
for i in range(N):
  a = int(input())
  if a%2 == 0:
    if a%3 == 0 or a%5 == 0:
      pass
    else:
     c += 1 
if c == 0:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
a = int(input())
b = list(map(int, input().split()))
flag = True
for i in range(len(b)):
  if i%2==1:
    if b[i]%!=0 or b[i]%5!=0:
      flag = False
      
if flag == True:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 == 0:
            if i % 3 == 0 or i % 5 == 0:
                ret = "APPROVED"
            else:
                ret  = "DENIED"
                break
        else:
            continue
    print(ret)

Submission status: Runtime Error

Solution code:
n=int(input())
lst=[]
a,b,c=map(int,input().split())
lst.append(a)
lst.append(b)
lst.append(c)
for i in range(0,n):
    if lst[i]%2==0:
        if lst[i]%3==0 or lst[i]%5==0:
            print("APPROVED")
        else:
            print("DENIED")

Submission status: Runtime Error

Solution code:
N = int(input())
AN = list(map(int, input().split()))

AN2 = AN[AN % 2 == 0]
(AN % 2 == 0).size
if AN2[AN2 % 3 == 0].size + AN2[AN2 % 5 ==0].size - AN2[AN2 % 15 ==0].size == AN2.size :
    print('APPROVED')

else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
n = input()
a = list(map(int,input().split()))
ans = 0
for i in range(n):
  if a[i] % 3 == 0 or a[i] % 5 == 0:
    ans +=1
if ans == n:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
a = int(input())
b = map(int, input().split())
x = 0

for i in b:
	if i % a == 0:
		x += 1
if x == len(b):
	print('APPROVED')
else:
	print('DENIED')

Submission status: Runtime Error

Solution code:
N = int(input())

a = [int(i) for i in range(N)]

x=[]
for i in range(N):

  if a[i] %2 ==0:
    x.append(a[i])
  
for i in x:
  if x[i] %3 ==0 or x[i] %5 ==0:
    print("APPROVED")
  else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
import numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = list[list%2 == 0]
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))
print(A)
print(B)

if (A == B).any() :
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
N = input()
_list = input().split(" ")
_list = [int(a) for a in _list]
aspect = [a for a in _list if a % 2==0]
ans = []
for a in even:
    if a % 3 == 0 or a % 5 == 0:
        ans.append(True)
if len(aspect) ==len(ans):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
import sys

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

for i in A:
    if i % 2 == 0:
        if i % 3 !=0 and i % 5 !=0:
            print('DENIED')
            sys.exit(1)
print('APPROVED')

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(int(i) for i in input().split())

for i in range(n-1):
    if a[i]%2 == 0:
        b = a[i]%3
        c = a[i]%5
        if b == 0 :
            ans = "APPROVED"
        elif c == 0:
            ans = "APPROVED"
    else: 
        ans = "DENIED"
print(ans)

Submission status: Runtime Error

Solution code:


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 == 0:
            if i % 3 == 0 or i % 5 == 0:
                ret = "APPROVED"
            else:
                ret  = "DENIED"
                print(i)
                break
        else:
            continue
    print(ret)

Submission status: Runtime Error

Solution code:
import numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = list[list%2 == 0]
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))


if (A == B).all() :
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
n = int(input())
arr = []
for i in range(n):
    arr.append(int(input())) 
if arr[i]%2==0 and arr[i]%3==0 or arr[i]%2==0 and arr[i]%5==0:
  print("Approved")
else: 
  print("Denied")

Submission status: Runtime Error

Solution code:
a=int(input())
Paper=list(map(int,input().split()))
m=0
for i in range (a):
  if Paper[i]%2==0:
    if not Paper[i]%3==0 or Paper[i]%5==0:
      m=m+1
return m

if not m==0:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Runtime Error

Solution code:
num = int(input())
num2=1
num3=0
for i in range(num):
    num1 = int(input())
    if num % 2 == 0:
      if num % 3 == 0 and num % 5 == 0:
        num2=0
	  else:
        num3=1

        
if num2==0:
  if num3=1:
    print("DENIED")
  else:
    print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
arr = []
for _ in range(n):
    arr.append(int(input())) 
if arr[i]%2==0 and arr[i]%3==0 or arr[i]%2==0 and arr[i]%5==0:
  print("Approved")
else: 
  print("Denied")

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int, input().split())
         
L = [i for i in l if i % 2 == 0]

K = [i for i in L if i % 3 != 0]

J = [i for i in K if i % 5 != 0]
         
if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
A = np.array([int(val) for val in A])

A_even = set(A[A%2==0])
A_three = set(A[A%3==0])
A_five = set(A[A%5==0])

A_approve = A_even & (A_three | A_five)

if A_even == A_approve:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
n=int(input())
lst=[]
for i in range(0,n):
    ele=int(input())
    lst.append(ele)

for i in range(0,n):
    if lst[i]%2==0:
        if lst[i]%3==0 or lst[i]%5==0:
            print("APPROVED")
        else:
            print("DENIED")

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int, input().split()))
tmp = 0

for i in range(n):
    if a[i] % 2 == 0 and (a[i] % 3 != 0 and a[i] % 5 != 0):
        print('DENIED')
        tmp = 1
        break

if tmp == 0:
    rint('APPROVED')

Submission status: Runtime Error

Solution code:
n=int(input())
l = list(map(int, input().split())
i= [k for k in l if l[k]%2==0 or l[k]%5==0]        
j = [k for k in i if i[k]%3==0 or i[k]%5==0]   
if len[i]==len[j]:
         print("APPROVED")
else:
         print("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
lis = list(map(int,input().split()))

for i in lis:
    if i % 2 == 0:
        if i%3 == 0 or i%5 == 0:
            A = 0
        else:
            A = 1
            print("DENIED")
            break
if A == 0:
    print("APPROVED")

Submission status: Runtime Error

Solution code:
import numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = list[list%2 == 0]
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))
if A == B :
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
N=int(input())

s=map(int,input().split())
for i in s:
  if i%2==0:
    if i%3==0 or i%5==0:
      print("APPROVED")
    else:
      print("DENIED")
	else:
      print("DENIED")

Submission status: Runtime Error

Solution code:
from functools import reduce
from operator import and_
N = int(input())
ans = reduce(and_, [(i%3==0) or (i%5==0) for i in map(int,input().split()) if i%2==0])
print("APPROVED" if ans else "DENIED")

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int, input().split())
         
L = [i for i in l if i % 2 == 0]

K = [i for i in L if i % 3 != 0]

J = [i for i in K if i % 5 != 0]
         
if len(J) == 0:
         print("APPROVED")
else:
         print("DENIED")

Submission status: Runtime Error

Solution code:
N = input()
l = input().split()
 
flag = "APPROVED"
for n in l:
  if n % 2 == 0 and n%3 != 0 and n%5 != 0:
    flag = "DENIED"
    
print(flag)

Submission status: Runtime Error

Solution code:
input()
A = map(int, input().split())
for a in A:
  if A % 2 == 0:
    if A % 3 != 0 and A % 5 != 0:
      print('DENIED')
      exit()
print('APPROVED')

Submission status: Runtime Error

Solution code:
n = int(input())
l = [int(x) for x in input().split() if not x % 2]

flag = True

for x in l:
  if x % 3 or x % 5:
    flag = False
  else:
    continue

if flag:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
import sys
N=int(input())
A=list(map(int,input().split()))
flag=True
for i in range(N):
    if A[i]%2==0:
        if A[i]%3!=0 or A[i]%5!=0:
            flag=False
if flag==True:
    print('APPROVED')
else:
    print('DENIED'

Submission status: Runtime Error

Solution code:


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    even_ls = [i for i in A if i%2 == 0 ]
    for i in even_ls:
        if i % 3 == 0 or i % 5 == 0:
            ret = "APPROVED"
        else:
            ret  = "DENIED"
            break
    print(ret)

Submission status: Runtime Error

Solution code:
N=int(input())
data=list(map(int,input().split()))

for i in range(N):
    mo2=data[i]%2
    mo6=data[i]%6
    mo10=data[i]%10
    if mo2==0:
        if mo6==0 or mo10==0:
            ans="APPROVED"

        else:
            ans="DENIED"
            break

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans="APPROVED"
for i in range n:
  if a[i]%2==0:
    if a[i]%15!=0:
      ans="DENIED"
    
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
L = list(map(int,input().split()))
L = [x for x in L if x%2 ==0]
for i in range(len(L)):
    if L[i]%3 == 0 or L[i]%5== 0:
        flag = True
    else:
        flag =False
        break
#print(L)
if flag:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
a=int(input())
Paper=list(map(int,input().split()))
m=0
for i in range (a):
  if Paper[i]%2==0:
    if not Paper[i]%3==0 or Paper[i]%5==0:
      m=m+1
return m

if not m=0:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))

b=[i//2 for i in a if i%2==0]

for j in b:
    if j%3==0 :
        ans=True
    elif j%5==0:
        ans=True
    else:
        ans=False
        break
if ans:
    print('APPROVED')
else:
    print('DENIED')