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: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))  # 入力のときに N を使う必要はありません

flag = "APPROVED"
for n in A:
  if n % 2 == 0 and n%3 != 0 and n%5 != 0:
    flag = "DENIED"
    
print(flag)

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int, input().split()))
i = 0 

for _ in lst:
  if _ % 2 == 0:
    if _ % 3 != 0 and _ % 5 != 0:
      i += 1
      break

if i == 0:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B=[0]*N
    for i in range(N):
        if A[i]%2==0:
            B[i]=2
            if A[i]%3==0 or A[i]%5==0:
                B[i]=1

    for i in range(N):
        if B[i]==2:
            print("DENIED")
            return
    print("APPROVED")
    return
    
    
main()

Submission status: Accepted

Solution code:
N = int(input())
inList = list(map(int, input().split(" ")))
 
evenList = list([])
 
for item in inList:
  if item % 2 == 0:
    evenList.append(item)

jdgList = list([])
 
for evenItem in evenList:
  if ((evenItem % 3) == 0) or ((evenItem % 5) == 0):
    jdgList.append(evenItem)

if len(jdgList) == len(evenList):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = "APPROVED"
for i in range(len(A)):
    flag = 1
    if A[i]%2 == 0:
        if A[i]%3 != 0:
            flag = flag - 1
        if A[i]%5 != 0:
            flag = flag - 1  
        if flag < 0: 
            ans = "DENIED"
print(ans)

Submission status: Accepted

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

A_even = [i for i in A if i % 2 == 0]

A_even_35 = [i for i in A_even if i % 3 != 0and i%5!=0]
if len(A_even_35)==0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:
n= input()
n = int(n)
nums= input().split()
#map(int,input().split())
state = 1
for i in range(n):
    if int(nums[i]) &1 == 0 :
        if int(nums[i])%3 ==0 or int(nums[i])%5 ==0:
            continue
        else:
            state= 0
            #print("DENIED")
            break
if state == 1:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split())) 
E = []
for i in range(N):
    if A[i] % 2 == 0:
        E.append(A[i])

K = True
for j in range(len(E)):
    if E[j] % 5 == 0 and E[j] % 3 == 0:
        pass
    elif E[j] % 5 == 0:
        pass
    elif E[j] % 3 == 0:
        pass
    else:
        K = False

print('APPROVED' if K == True else 'DENIED')

Submission status: Accepted

Solution code:
N=input()
c=0
ll=list(map(int,input().split()))
for i in ll:
    if i%2==0:
        if i%3 ==0 or i%5==0:
            pass
        else:
            print("DENIED")
            exit(0)

print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8


def main():
    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:
                return "DENIED"

    return "APPROVED"


print(main())

Submission status: Accepted

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: Accepted

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

result = True
for n in L:
    if n % 2 == 0:
        if ((n % 6) != 0) and ((n % 10) != 0):
            result = False
            break

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

Submission status: Accepted

Solution code:
N = input()
A = list(map(int, input().split()))
flag = 0
for a in A:
  if(a % 2 == 0):
    if( not(a % 3 == 0 or a % 5 == 0)):
      print('DENIED')
      flag = 1
      break
if(flag == 0):
  print('APPROVED')

Submission status: Accepted

Solution code:
n = int(input())
numbers = [int(x) for x in input().split()]
flag = 'APPROVED'
for number in numbers:
  if number%2==0 and (number % 3 == 0 or number % 5 == 0):
    continue
  elif number%2 != 0: continue
  else:
      flag = 'DENIED'
      break
print(flag)

Submission status: Accepted

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

    for i in range(N):
        if (A[i]%2==1):
            continue
        elif(A[i]%3!=0 and A[i]%5!=0):
            print("DENIED")
            return
    print("APPROVED")
    return

solve()

Submission status: Accepted

Solution code:
n=int(input())
a=[int(x) for x in input().split()]
s=[]
ans=0
for i in range(len(a)):
    if a[i]%2==0:
        s.append(a[i])
for i in range(len(s)):
    if s[i]%3==0:
        ans+=1
    elif s[i]%5==0:
        ans+=1
if ans==len(s):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n=int(input())
a=[0]*n
a=list(map(int,input().split()))
judge=True
for i in range(0,n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      pass
    else:
      judge=False
      print("DENIED")
      sys.exit()
if judge==True:
  print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ls = map(int, input().lower().split())
even = []
for i in ls: 
  if i % 2 == 0:
    even.append(i)

count = 0
for i in even: 
  if i % 3 == 0 or i % 5 == 0:
    count = count + 1
    
if count == len(even):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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] % 3 != 0) and (A[i] % 5 != 0):
      ans = "DENIED"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
D = 0
for A in L:
  if A % 2 == 0:
    if A % 3 == 0 or A % 5 == 0:
      continue
    else:
      print("DENIED")
      D = 1
      break
  else:
    continue
if D != 1:
  print("APPROVED")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n):
    if a[i] %2 == 0:
        b.append(a[i])

d = len(b)
if d == 0:
    print('APPROVED')
    exit()

bool == True
for c in b:
    if (c %3 != 0) and (c %5 != 0):
        bool = False
        break
    else:
        bool = True

if bool == True:
    print('APPROVED' )
else:
    print('DENIED')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
c = 0
c_1 = 0
for i in range(N):
    if A[i] % 2 == 0:
        c += 1
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            c_1 += 1
if c == c_1:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
n = int(input())
a=list(map(int, input().split()))
b = True
for i in a:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            b = False
            print("DENIED")
            break
if b == True:
    print("APPROVED")

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A = [int(x) for x in input().split()]
A = np.array(A)
index = [i for i in A if i % 2 == 0]
t = 0

for i in range(len(index)):
  if (index[i] % 3 == 0) or (index[i] % 5 == 0):
    t += 1
  else:
    pass

if t == len(index):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

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

res = "APPROVED"
## DENIED

for i in range(a):
    if b[i] % 2 == 0 and (b[i] % 3 != 0 and b[i] % 5 != 0):
        res = "DENIED"
        break
    
print(res)

Submission status: Accepted

Solution code:
#python3

def f(num):
    if num % 3 == 0:
        return True
    if num % 5 == 0:
        return True
    return False

def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    e = [i for i in a if i%2 == 0]
    flag = True

    for i in e:
        if f(i):
            pass
        else:
            flag = False

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(" ")))
flag = True
for i in a:
  if (i%2==0):
    if not (i%3==0 or i%5==0):
      flag=False
if flag==True:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:
a=input()
b = list(map(int,input().split()))
t=0
for i in range(int(a)):

    if(b[i]%2==0):
        if(b[i]%3==0 or b[i]%5==0):
            t+=1
    else:
        t+=1
if t==int(a):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

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

def dfs():
    for i in range(n):
        if  a[i]%2 ==0:
            if a[i]%3 != 0 and a[i]%5 != 0:
                return False
                    
            

if dfs() != False:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = input()
A = LIST()

flag = 0
for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            print('DENIED')
            flag += 1
            break

if flag == 0:
    print('APPROVED')

Submission status: Accepted

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

in_flag = True
for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            in_flag = True
        else:
            in_flag = False
            break
    else:
        pass

if in_flag:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input('')
a=input('')
n=int(n)

a=a.split(' ')

for b in range(n):
    a[b]=int(a[b])

d=0
for c in a:
    if c%2==1:
        d=d+1
    elif c%2==0:
        if c%3==0 or c%5==0:
            d=d+1
        else:
            d=d+0

if d==n:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import numpy as np
stdin = open(0)

A = np.fromstring(stdin.read(), np.int64, sep=' ')[1:]
A = A[A % 2 == 0]
if np.all((A % 3 == 0) | (A % 5 == 0)):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

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

error = 0
warikireru_3 = 0
warikireru_5 = 0

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0:
            warikireru_3 = 1
        if A[i] % 5 == 0:
            warikireru_5 = 1
        if not(warikireru_3 == 1 or warikireru_5 == 1):
            error += 1
    warikireru_3 = 0
    warikireru_5 = 0

if error == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = []
C = []
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:
    C.append(B[j])
if len(B) == len(C):
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

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] % 3 != 0 and A[i] % 5 != 0:
            ans = "DENIED"
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
flag = 0
for i in a:
  if i%2==0:
    if i%3!=0 and i%5!=0:
      flag = 1
if flag ==1:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
#     print(N)
#     print(A)
    for num in A:
        if num % 2 == 0:
            if num % 3 == 0 or num % 5 == 0:
                pass
            else:
                print("DENIED")
                exit()
    print("APPROVED")


main()

Submission status: Accepted

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

cnt = 0
ret = 0
for i in a:
    if i % 2 == 0:
        cnt += 1
        if i % 3 == 0 or i % 5 == 0:
            ret += 1
if cnt == ret:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
n = int(input())

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

A = []
ans = int(0)

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

for i in range(len(A)):
    x = A[i] % 3
    y = A[i] % 5
    if x != 0 and y != 0:
        ans += 1
        continue


if ans == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
for i in range(n):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 and a[i] % 5 != 0:
      print("DENIED")
      break
  else:
    pass
  if i == n-1:
    print("APPROVED")

Submission status: Accepted

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
guu=[]

result="APPROVED"
for i in range(N):
    if A[i]%2==0:
        guu.append(A[i])
for i in range(len(guu)):
    if (guu[i]%3!=0)and(guu[i]%5!=0):
            result="DENIED"
            break

print(result)

Submission status: Accepted

Solution code:
n = int(input()) 
a = list(map(int,input().split()))
ans = "APPROVED"
for i in a:
  if not i%2:
    if i%3 and i%5:
      ans = "DENIED"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'APPROVED'
for i in range(0, n) :
  if a_list[i]%2 == 0 :
    if (a_list[i]%3)*(a_list[i]%5) != 0 :
      ans = 'DENIED'
      break
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ok = True
for x in a:
    if x %2 == 0:
        if x %3!=0 and x %5 != 0:
            ok = False
            break
if ok:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
ans = "APPROVED"
for i in range(n):
    if a[i] % 2 != 0:
        continue
    if a[i] % 3 != 0 and a[i] % 5 != 0:
        ans = "DENIED"
        break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = []
x = 0
for i in A:
    if i % 2 == 0:
        B.append(i)

for j in B:
    if j % 3 != 0:
        if j % 5 != 0:
            x += 1

if x != 0:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Accepted

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

isApproved = True
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 != 0:
            if A[i] % 5 != 0:
                isApproved = False


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

Submission status: Accepted

Solution code:
num = int(input())
xs = [int(x) for x in input().split() if int(x) % 2 == 0]

approved = True
for x in xs:
  if x % 3 ==0 or x % 5 == 0:
    continue
  else:
    print("DENIED")
    approved = False
    break
    
if approved:
  print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split()]

flg = True
for i in l:
    if i % 2:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        flg = False
        break
    
print('APPROVED' if flg else 'DENIED')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int, input().split()))
te=True
for i in range(n):
    if l[i]%2==0:
        if l[i]%3!=0 and l[i]%5!=0:
            te=False
            break

if te==True:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
alist = list(map(int, input().split()))

flag_d = 0 # 'DENIED'
flag_a = 0 # 'APPROVED'
for a in alist:
    if a % 2 == 0:
        if a % 3 == 0 or a %5 == 0:
            flag_a += 1
        else:
            flag_d += 1

if flag_d >= 1:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Accepted

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

even_list = [i for i in num_list if i % 2 == 0]

approved = True

for j in even_list:
    if (j % 3 != 0) and (j % 5 != 0):
        approved = False

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

Submission status: Accepted

Solution code:
n = input()
num = input().split()
flag = 0

for i in num:
    i = int(i)
    if i%2==0:
        if i%3 != 0 and i%5 != 0:
            flag = 1
if flag == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
new_list = []
count = 0

for i in a:
    if i % 2 == 0:
        new_list.append(i)
    else:
        continue
for i in new_list:
    if i % 3 == 0 or i % 5 == 0:
        count += 1
if count == len(new_list):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
N = int(input()) 
s = input().split()

cnt1 = 0
cnt2 = 0
for i in range(N):
    if int(s[i]) % 2 == 0:
        cnt1 += 1
    if int(s[i]) % 2 == 0 and (int(s[i]) % 3 == 0 or int(s[i]) % 5 == 0):
        cnt2 += 1

if cnt1 == cnt2:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = list(map(int, input().split()))
kekka = 0

for i in range(N):
    if s[i]%2 == 0:
        if s[i]%3 != 0 and s[i]%5 != 0:
            kekka =1

if kekka == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
for val in A:
    if val % 2 == 1:
        continue
    elif val % 2 == 0:
        if val % 3 == 0:
            continue
        elif val % 5 == 0:
            continue
        else:
            print('DENIED')
            break
else:
    print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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


def is_all_approved(numArry):
    for num in numArry:
        if num % 2 == 0:
            if num % 3 != 0 and num % 5 != 0:
                return False
    return True


if is_all_approved(A):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

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

cnt1 = 0
cnt2 = 0

for i in range(n):
    if a[i]%2 == 0:
        cnt1 += 1
        if a[i]%3 == 0 or a[i]%5 == 0:
            cnt2 += 1
        else:
            continue
    else:
        continue

if cnt1 == cnt2:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
temp_list = []
flag = 1

for i in range(N):
  if A[i] % 2 == 0:
    temp_list.append(A[i])

for i in range(len(temp_list)):
  if not (temp_list[i] % 3 == 0 or temp_list[i] % 5 == 0):
    flag = 0
    
if flag == 1:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

Solution code:
import numpy as np
Nnum=int(input())
An=np.array([int(i) for i in input().split()])
Ane=An[An%2==0]
Ane3=Ane%3
Ane5=Ane%5
Ane3or5=Ane3*Ane5

if(np.sum(Ane3or5)==0):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ls = tuple(map(int, input().split()))
a = 0
b = 0
for N in ls:
    if N%2==0:
        a += 1
        if N%3==0 or N%5==0:
            b += 1
print('APPROVED' if a == b else 'DENIED')

Submission status: Accepted

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

ans = "APPROVED"
for a in al:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            ans = "DENIED"
            break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
X = 0
Y = 0
for i in range(0,N):
  if A[i] % 2 == 0:
    X += 1
    if ((A[i] / 2) % 3 == 0) or ((A[i] / 2) % 5 == 0):
      Y += 1
if X == Y:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = list(map(int, input().split()))

flag = True
for i in range(N):
  if(A[i] % 2 == 0):
    if not(A[i] % 3 == 0 or A[i] % 5 == 0):
      flag = False
      print('DENIED')
      break

if(flag == True):
  print('APPROVED')

Submission status: Accepted

Solution code:
import sys
# N=5
# A=[6, 7, 9, 10, 31]
N=map(int,input())
A=list(map(int, input().split()))

A_even=[]
for i in A:
    if  (i%2)==0:
        A_even.append(i)
for i in A_even:
    if (i%3)!=0 and (i%5)!=0:
        print("DENIED")
        sys.exit()
print("APPROVED")

Submission status: Accepted

Solution code:
n = input()
line = input()
a = line.split(" ")
a = [int(i) for i in a]
even_list = []

for i in range(len(a)):
    if a[i] % 2 == 0:
        even_list.append(a[i])
flag = 0
for num in even_list:
    if num % 3 == 0 or num % 5 == 0:
        flag = 0
    else:
        flag = 1
        break
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

Solution code:
N = int(input())
Aj = list(map(int, input().split()))
flg = True
for A in Aj:
	if A%2==0 and (A%3!=0 and A%5!=0):
		print('DENIED')
		flg = False
		break
if flg:
	print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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

odd = filter(lambda x: x % 2 == 0, AS)
result = filter(lambda x: not (x % 3 == 0 or x % 5 == 0), odd)

if len(list(result)) == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N = int(input())
li = list(map(int,input().split()))
even_li = [x for x in li if x%2 == 0]
ap = 0
for i in even_li:
    if i % 3 == 0 or i % 5 == 0:
        ap += 1
if even_li == []:
    print("APPROVED")
elif ap == len(even_li):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
import math
n = input()
a = list(map(int, input().split()))
ans = "APPROVED"
for i in a:
    if (i % 2) == 0 :
      if ((i % 3) != 0) and ((i % 5) != 0):
        ans = "DENIED"
print(ans)

Submission status: Accepted

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

ans = 'APPROVED'
for i in a:
  if i%2 == 0 and i%3 != 0 and i%5 != 0:
      ans = 'DENIED'
      break

print(ans)

Submission status: Accepted

Solution code:

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

res= 0
for aa in a:
    if aa%2==0:
        if aa %3 ==0:
            res+=1
            continue

        elif aa%5 ==0:
            res+=1
            continue
    else: 
        res+=1
        continue
            
if res==n:
    print ('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

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

flag = False
for i in range(N):
    if A[i] % 2 == 0:
        if (A[i] % 3 == 0) or (A[i] % 5 == 0):
            flag = True
        else:
            flag = False
            break
    else:
        flag = True

if flag == True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

check = True
for i in A:
    if(i % 2 == 0):
        if(i % 3 != 0 and i % 5 != 0):
            check = False

if(check):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_ = input()
a=map(int,input().split())
flag = True
for i in a:
  if i%2 == 0:
    if i%3 != 0:
      if i%5 != 0:
        flag = False
        break
if flag:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

ans = "APPROVED"
for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            ans = "DENIED"
            break
print(ans)