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:
def resolve():
    n = int(input())
    a = list(map(int,input().split()))
    t = True
    for i in a:
        if i % 2 == 0 and (not (i % 3 == 0 or i % 5 == 0)):
            t = False
    if t:
        print("APPROVED")
    else:
        print("DENIED")
resolve()

Submission status: Accepted

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

D1 = 3
D2 = 5

ans = "APPROVED"

for A in A_list:
    if A%2 == 0:
        if (A%D1 != 0) & (A%D2 != 0):
            ans = "DENIED"
            break

print(ans)

Submission status: Accepted

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:
            if a[i]%5 != 0:
                print("DENIED")
                exit()
                
print("APPROVED")

Submission status: Accepted

Solution code:
N = int(input())
An = list(map(int, input().split()))
targ = [(a % 2 !=1) and (a % 3 != 0) and (a % 5 != 0)  for a in An]
key = "APPROVED" if sum(targ) == 0 else "DENIED"
print(key)

Submission status: Accepted

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

Submission status: Accepted

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 and a[i]%5!=0:
            print("DENIED")
            exit()
print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
import numpy as np
import collections
from collections import deque
import queue
import copy

# 最大公約数
def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z

# 幅優先探索(BFS)でスタート座標(x, y)からの最大距離返す
def bfs(SS, x, y, H, W):#入力(座標系(迷路), x, y, xの端, yの端)
  x_next = [0, 0, -1, 1]
  y_next = [1, -1, 0, 0]
  tempx = x
  tempy = y
  mlength = 0
  q = deque()
  xytuple = (x, y, 0)
  q.append(xytuple)


  while q:
    xytuple = q.popleft()
    SS[xytuple[0]][xytuple[1]] = "x" #探索した場所は探索できないようにする
    for i in range(4): #このforで上下左右を調べてる
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      #print(tempx, tempy, xytuple[2])
      #print(S)
      if(0 <= tempx and tempx < H and 0 <= tempy and tempy < W and SS[tempx][tempy] == "."):
        temptuple = (tempx, tempy, xytuple[2]+1)
        SS[temptuple[0]][temptuple[1]] = "x" #探索した場所は探索できないようにする
        mlength = max(mlength, xytuple[2] +1)
        q.append(temptuple)
      #print(q)
  return mlength

def brick(a,n,m,N):#ABC 148
  #n番目以降にmがあるか調べる
  if not m in a[n:]:
    print(N-(m-1))
  else:
    #b = copy.deepcopy(a)
    brick(a,a[n:].index(m),m+1,N)

#X = str(input()).split()
#a = [int(x) for x in input().split()]

N = int(input())
A = [int(x) for x in input().split()]
ans = "APPROVED"
for i in range(N):
    if(A[i]%2 == 0):
        if(A[i]%3 == 0 or A[i]%5 == 0):
            a = 0
        else:
            ans = "DENIED"


print(ans)

Submission status: Accepted

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

flg = True
for a in A:
    if a%2 == 0:
        if not (a%3==0 or a%5==0):
            flg = False
            break
        
if flg:
    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:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            pass
        else:
            print("DENIED")
            break
else:
    print("APPROVED")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
f = 1
for i in a:
    if (i%2)==0:
        if (i%3)==0 or (i%5)==0:
            continue
        else:
            f =0
            break
    
if f:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
read = input 
rn = lambda :list(map(int, read().split()))
rn()
arr = rn()
a1 = filter(lambda x:x%2==0, arr)
flag = True
for x in a1:
    if x % 3 == 0 or x % 5 == 0:
        pass
    else :
        flag = False
print("APPROVED" if flag else "DENIED")

Submission status: Accepted

Solution code:
n = int(input())
lst = [int(x) for x in input().split()]
hasError = False

for i in lst:
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      hasError = True
      break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
flg=0
for i in a:
    if(i%2==0):
        if((i%3==0)or(i%5==0)):
            continue
        else:
            flg=1
            break

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

Submission status: Accepted

Solution code:
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

n = I()
a = LI()

for i in a:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            print("DENIED")
            exit()
print("APPROVED")

Submission status: Accepted

Solution code:

N = int(input())
line = input().split(" ")
A = [int(i) for i in line]

answer = "APPROVED"

for a in A:
    if a % 2 == 1:
        continue
    if a % 3 == 0 or a % 5 == 0:
        continue
    else:
        answer = "DENIED"
        break

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

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')
            break
else:
    print('APPROVED')

Submission status: Accepted

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()
print('APPROVED')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = [a for a in A if a % 2 == 0]
print('APPROVED' if all([a % 3 == 0 or a % 5 == 0 for a in A]) else 'DENIED')

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    aaa = list(map(int, input().split()))

    ans = 'APPROVED'
    for a in aaa:
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                pass
            else:
                ans = 'DENIED'
        else:
            pass
    print(ans)


if __name__ == '__main__':
    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 i%3!=0 and i%5!=0:
      flag=False
      break
if flag:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

flag = True

for x in A:
    mod2 = x % 2
    if mod2 == 0:
        mod3 = x % 3
        mod5 = x % 5
        if mod3 != 0 and mod5 != 0:
            flag = False
if flag == True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

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

for i in a:
    if i%2==0:
        if i%3==0 or i%5==0:
            pass
        else:
            dflag += 1
            
if dflag:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

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 and a[i]%5!=0:
            print('DENIED')
            exit()
        else:
            continue

print('APPROVED')

Submission status: Accepted

Solution code:
n = int(input())
l = map(int, input().split())
def ap(x):
    if x%2==0:
        if x%5==0 or x%3==0:
            return 1
        return 0
    else:
        return 1
print('APPROVED' if sum(map(ap,l))==n else 'DENIED')

Submission status: Accepted

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

even = []

for a in A:
    if a % 2 == 0:
        even.append(a)

ans = []
for e in even:
    if e % 5 == 0:
        ans.append(e)
    elif e % 3 == 0:
        ans.append(e)

if even == ans:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    # Failed to predict input format
    N = int(input())
    A = [int(_) for _ in input().split()]
    ans="APPROVED"
    for a in A:
        if a % 2 == 0 and (a % 3 != 0 and a % 5 != 0):
            ans="DENIED"
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
arr = list(map(int,input().split()))
flag = True
for num in arr:
  if num%2==0:
    if (num%3!=0) and (num%5!=0):
      flag = False

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

Submission status: Accepted

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

Submission status: Accepted

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

judge = True
for i in range(N):
  if (A[i] % 2) == 1:
    continue
  if (A[i] % 3) != 0 and (A[i] % 5) != 0:
    judge = False
    break

print('APPROVED' if judge else 'DENIED')

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    flg = 0
    for i, aa in enumerate(a):
        if aa % 2 == 0:
            if aa % 3 ==0 or aa % 5 == 0:
                continue
            else:
                flg = 1
    if flg == 0:
        print('APPROVED')
    else:
        print('DENIED')
if __name__=='__main__':
    main()

Submission status: Accepted

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:
      continue
    else:
      print('DENIED')
      exit()

print('APPROVED')

Submission status: Accepted

Solution code:
N = int(input())
A = [int(n) for n in input().split() if int(n)%2==0]
print('APPROVED' if all([1  if n%3==0 or n%5==0 else 0 for n in A]) else 'DENIED')

Submission status: Accepted

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

for i in a:
    if i%2==0:
        if i%3==0 or i%5==0:
            continue
        else:
           ans+=1
           break
if ans==0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

flag = True

for i in range(n):
    if a[i] % 2 == 0 and (a[i] % 3 == 0 or a[i] % 5 == 0):
        flag = True
    elif a[i] % 2 == 1:
        flag = True
    else:
        flag = False
        break
print("APPROVED" if flag else "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:
    if a[i]%6!=0 and a[i]%10!=0:
      print("DENIED")
      exit()
  else:
    pass    
print("APPROVED")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N=int(input())
A=list(map(int,input().split()))
a=0
for i in range(N):
    if A[i]%2==0:
        if A[i]%3!=0 and A[i]%5!=0:
            a=1
if a==1:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

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

flag = False
for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            pass
        else:
            flag = True
if flag:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

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

for a in a_li:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            continue
        else:
            print('DENIED')
            exit()
print('APPROVED')

Submission status: Accepted

Solution code:
N = int(input())
box = [int(x) for x in input().split()]
tmp = []
for con in box:
    if con % 2 == 0:
        tmp.append(con)

flg = True
for num in tmp:
    if not ((num % 3 == 0) or (num % 5 == 0)):
        print('DENIED')
        flg = False
        break
if flg:
    print('APPROVED')

Submission status: Accepted

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

flag = True
for a in a_list:
    if a %2 == 0:
        if a%6 == 0 or a%10 == 0:
            pass
        else:
            flag = False
            break
        
if flag:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
N = input()
As = input().split()
e = [int(i) for i in As if int(i)%2 == 0]
c = 0
for i in e:
  if i%3==0 or i%5==0:
    c += 1
if c == len(e):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
data = np.array(list(map(int, input().split())))

ans = 0
for i in range(N):
	if data[i] % 2 == 0:
		if data[i] % 5 == 0:
			ans = 0
		elif data[i] % 3 == 0:
			ans = 0
		else:
			ans = 1
			break

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

n = int(input())
a = list(map(int, input().split()))
ans = 'APPROVED'
flg = True

for i in range(n):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5 == 0:
            pass
        else:
            flg = False

if flg == False:
    ans = 'DENIED'

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 'APPROVED'

for a in map(int, input().split()):
    if a % 2 == 0 and a % 3 != 0 and a % 5 != 0:
        ans = 'DENIED'

print(ans)

Submission status: Accepted

Solution code:
N=int(raw_input())

A = map(int, raw_input().split())

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

Submission status: Accepted

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

ans = 'APPROVED'

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
s=[i for i in a if i%2==0]
t=[i for i in s if i%3>0 and i%5>0]
print('APPROVED' if len(t)==0 else 'DENIED')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())

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

res = []

for i in t:
    if i%2==0:
        res.append(i)

for i in res:
    if i%3!=0 and i%5!=0:
        print('DENIED')
        exit()

print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())
A = [int(i) for i in input().split()]

fl = True
for a in A:
    if a % 2 == 0:
        if not (a % 3 == 0 or a % 5 == 0):
            fl = False

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

Submission status: Accepted

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

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            pass
        else:
            approved = False

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

Submission status: Accepted

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


for i in a:
    if i % 2 == 0:
        if i % 3 == 0:
            continue
        elif i % 5 == 0:
            continue
        else:
            print('DENIED')
            exit()

print('APPROVED')

Submission status: Accepted

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

for i in a:
    if i % 2 == 1:
        continue
    if i % 3 == 0 or i % 5 == 0:
        continue
    else:
        print("DENIED")
        quit()
print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

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

app=1

for i in range(N):
	if AL[i]%2 != 0 or AL[i]%3 == 0 or AL[i]%5 == 0:
		continue
	else:
		app=0
		break

if app == 1:
	print('APPROVED')
else:
	print('DENIED')

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

ans = 0
for i in A:
    if i % 2 == 0:
        if (i % 3 != 0) and (i % 5 != 0):
            ans += 1

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

Submission status: Accepted

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

def answer():
    for ai in A:
        if ai % 2 == 0:
            if ai %3 != 0 and ai % 5 != 0:
                return "DENIED"
    
    return "APPROVED"

print(answer())

Submission status: Accepted

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

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

Submission status: Accepted

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

frag = True

for i in a:
  if i%2==0:
    if i%3 != 0 and i%5 != 0:
      frag = False

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

Submission status: Accepted

Solution code:
judge = 'APPROVED'
N = int(input())
Document = list(map(int, input().split()))
for i in range(len(Document)):
  if Document[i] % 2 == 0:
    if not(Document[i] % 3 == 0 or Document[i] % 5 == 0):
      judge = 'DENIED'
      break
print(judge)

Submission status: Accepted

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

Submission status: Accepted

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

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

for a in A:
    if a%2 == 0 and not(a%3 == 0 or a%5 == 0):
        print('DENIED');
        break
else:
    print('APPROVED');

Submission status: Accepted

Solution code:
n = int(input())
aList = list(map(int, input().split()))
flag = True
for i in aList:
    if i % 2 == 0 and i % 3 != 0 and 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()))
f=all((x%3==0)or(x%5==0) for x in a if x%2==0)
g=all(x%2==1 for x in a)
if g==True:
  print("APPROVED")
else:
  if f==True:
    print("APPROVED")
  else:
    print("DENIED")

Submission status: Accepted

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

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
if cnt1 == cnt2:
     print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

a = [int(i) for i 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')
            exit()

print('APPROVED')

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]

for x in a:
    if x%2 == 0:
        if x%3 != 0 and x%5 != 0:
            print('DENIED')
            exit()
print('APPROVED')

Submission status: Accepted

Solution code:
def solve():
    from sys import stdin
    f_i = stdin
    
    N = int(f_i.readline())
    A = map(int, f_i.readline().split())
    
    for a in A:
        if a % 2 == 0:
            if a % 3 and a % 5:
                print('DENIED')
                break
    else:
        print('APPROVED')

solve()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(lambda x: int(x) % 2 == 1or((int(x) % 2 == 0) and (int(x) % 5 == 0 or int(x) % 3 == 0)),input().split()))
if all(A) == True:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

for a in A:
    if a % 2 != 0:
        continue
    if a % 3 == 0 or a % 5 == 0:
        continue
    else:
        print("DENIED")
        exit(0)
print("APPROVED")

Submission status: Accepted

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


flag=True

for a in a_list:
    if a%2==0:
        if a%3==0 or a%5==0:
            pass
        else:
            flag = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 155: B (2020/02/16)
N = int(input())
l = input().split()
ans = True
for i in range(N):
    A = int(l[i])
    if A % 2 == 0:
        if A % 3 != 0 and A % 5 != 0:
            ans = False
if ans == True:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
n=int(input())
nums=list(map(int,input().split()))
for num in nums:
  if num%2==0 and not (num%3==0 or num%5==0):
    print('DENIED')
    break
else:
  print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'APPROVED'

for x in a:
    if x % 2 == 0:
        if x % 6 != 0 and x % 10 != 0:
                ans = 'DENIED'

print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(input())
As = list(map(int, input().split()))

for i in range(N):
    if As[i] % 2 == 0:
        if As[i] % 3 != 0 and As[i] % 5 != 0:
            print('DENIED')
            sys.exit(0)

print('APPROVED')

Submission status: Accepted

Solution code:
def please(n , a):

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

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(please(n , a))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys


# N, M = map(int, input().split())
# nums = list(map(int, input().split()))
# nums_2d = [list(map(int, input().split())) for _ in range(N)]


def main():
    print(solve())


def solve():
    N = int(input())
    As = list(map(int, input().split()))

    ok = True

    for a in As:
        if a % 2 == 1:
            continue
        if a % 3 == 0:
            continue
        if a % 5 == 0:
            continue
        ok = False

    if ok:
        return 'APPROVED'
    else:
        return 'DENIED'


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import lru_cache
sys.setrecursionlimit(10**9)

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

    denied = False
    for a in A:
        if a % 2 == 0:
            if not(a % 3 == 0 or a % 5 == 0):
                denied = True

    print("DENIED" if denied else "APPROVED")

if __name__ == "__main__":
  main()

Submission status: Accepted

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

f = True
for v in a:
    if v % 2 == 0:
        if v % 3 == 0 or v % 5 == 0:
            pass
        else:
            f = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
even = [i for i in a if i%2==0]
res = 'APPROVED'
for i in even:
    if i%3==0:
        continue
    elif i%5==0:
        continue
    res = 'DENIED'
    break
print(res)

Submission status: Accepted

Solution code:
N = int(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'
            break
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:
        if i%3!=0 and i%5!=0:
            ans="DENIED"
            break
print(ans)

Submission status: Accepted

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

for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            print('DENIED')
            exit()

print('APPROVED')

Submission status: Accepted

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

for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            break
else:
    print("APPROVED")
    exit()
print("DENIED")

Submission status: Accepted

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

judge = True
for A in An:
    if A % 2 == 0:
        if A % 3 == 0 or A % 5 == 0:
            judge = True
        else:
            judge = False
            break

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