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()))
ans = []
if len(a) == n:
    for i in a:
        if i % 2 == 0:
            if i % 3 == 0 or i % 5 == 0:
                ans.append(1)
            else:
                ans.append(2)
    print("DENIED") if 2 in ans else print("APPROVED")

Submission status: Accepted

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

for i in range(n):
    if li[i] % 2 == 1:
        continue
    if li[i] % 3 == 0 or li[i] % 5 == 0:
        continue
    else:
        print("DENIED")
        exit()
else:
    print("APPROVED")

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 (A[i] % 3) * (A[i] % 5) != 0:
            ans += 1

print("DENIED" if ans >= 1 else "APPROVED")

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
x=0
y=0
for i in range(len(a)):
    if(a[i]%2==0):
        x+=1
        if(a[i]%3==0 or a[i]%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()))

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=[0]*n
a=list(map(int,input().split()))
flag=0
for i in range(n):
  if (a[i]%2==0 and a[i]%3!=0 and a[i]%5!=0):
    flag=1
print("APPROVED" if (flag==0) else "DENIED")

Submission status: Accepted

Solution code:
# 入力の取得
# 数値:1行1件
n = int(input())
# 数値:1行_N件_件数指定有
input_data = list(map(int, input().split()))[0:n]

# 処理
isApproved = True

# ループ_INDEX必要
for index, item in enumerate(input_data):
    # print("インデックス：" + str(index) + ", 値：" + item)
    if item % 2 == 0 and item % 3 != 0 and item % 5 != 0:
        isApproved = False

# 結果出力
if isApproved:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

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

ans = 'APPROVED' if check(a) else 'DENIED'
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
flg = True
for number in numbers:
    if number % 2 == 0 and number % 3 != 0 and number % 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()))

ans = 0

for i in range(n):
  ai = a[i]
  if ai % 2 == 0:
    if (ai % 3) * (ai % 5) != 0:
      ans += 1
      
if ans >= 1:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Accepted

Solution code:
n=int(input())
an=list(map(int,input().split()))
for a in an:
    if a%2==1:
        continue
    if a%3==0 or a%5==0:
        continue
    print("DENIED")
    exit()
print("APPROVED")

Submission status: Accepted

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

A_ = [a for a in A if a % 2 == 0 and a % 3 != 0 and a % 5 != 0]

if len(A_) > 0:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

Solution code:
# 初期入力
N = int(input())
A = list(map(int, input().split()))

#２の倍数か
gusu =[i for i in A if i % 2 ==0]
x = 0
for i in gusu:
    if i % 3 ==0 or i % 5 ==0:
            x += 1          # 偶数の内３または５で割り切れるものを数える  
if len(gusu) == x:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
import sys

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

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

print('APPROVED')

Submission status: Accepted

Solution code:
print("APPROVED"if int(input())==sum([1 for e in[int(a)for a in input().split(" ")]if not(e%2==0 and e%3!=0 and e%5!=0)])else"DENIED")

Submission status: Accepted

Solution code:
print("APPROVED" if int(input()) == sum([1 for e in [int(a) for a in input().split(" ")] if not(e % 2 == 0 and e % 3 != 0 and e % 5 != 0)]) else "DENIED")

Submission status: Accepted

Solution code:
n = int(input())
x = sum([1 for e in [int(a) for a in input().split(" ")] if not(e % 2 == 0 and e % 3 != 0 and e % 5 != 0)])
print("APPROVED" if n == x else "DENIED")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineerin College
    Date:24/03/2020
'''

def main():
    
    # for _ in range(ii()):
    n=int(input())
    a=list(map(int,input().split()))
    f=0
    for i in a:
        if(i%2==0):
            if(i%3!=0 and i%5!=0):
                f=1
                break
    if(f):
        print('DENIED')
    else:
        print('APPROVED')
        
















    
    
if __name__ =="__main__":
    main()

Submission status: Accepted

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

#  偶数列
A = [a for a in _A if (a % 2 == 0)]
# 承認列
ans = [a for a in A if (a % 3 == 0 or a % 5 == 0)]

print("APPROVED" if len(A) == len(ans) else "DENIED")

Submission status: Accepted

Solution code:
x = int(input())

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

def cal(n):
    count = 0
    for i in range(len(n)):
        if n[i] % 2 == 0:
            if n[i] % 3 == 0 or n[i] % 5 == 0:
                count += 1
        else:
            count += 1
    if count == len(n):
        print("APPROVED")
    else:
        print("DENIED")
cal(n)

Submission status: Accepted

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

flg = 0
for i in range(n):
    if a[i - 1] % 2 == 0:
        if (a[i - 1] % 3 == 0) or (a[i - 1] % 5 == 0):
            continue
        else:
            flg += 1
if flg > 0:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
         
for a in A:
      if a % 2 == 1:
         continue
      if a % 3 == 0:
         continue
      if a % 5 == 0:
         continue
      print("DENIED")
      exit()

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 not ((i % 3 == 0) or (i % 5 == 0)):
      print("DENIED")
      break
else:
  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%3!=0 and i%5!=0:
      print("DENIED")
      exit()
print("APPROVED")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
list_num = list(map(int, input().split()))
flg = False
for i in range(n):
  if list_num[i] % 2 == 1 or (list_num[i] % 2 == 0 and (list_num[i] % 3 == 0 or list_num[i] % 5 == 0)):
    flg = True
  else:
    flg = False
    break

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

Submission status: Accepted

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

for i in range(n):
  if a[i]%2==0:
    even+=1
    if a[i]%3==0 or a[i]%5==0:
      count+=1

if even==count:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:

x = int(input())

n = []
# for i in range(x):
#     n[i] = int(input())
n = [int(e) for e in input().split()]

def cal(n):
    count = 0
    for i in range(len(n)):
        if n[i] % 2 == 0:
           if n[i] % 3 == 0 or n[i] % 5 == 0:
                count += 1
        else:
            count += 1
    if count == len(n):
        print("APPROVED")
    else:
        print("DENIED")

cal(n)

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()))

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())
c=list(map(int, input().split()))

x = 0

for i in range(n):
    if c[i] % 2 == 0:
        if c[i] % 3 != 0 and c[i] % 5 != 0:
            x = 1
            break

if x == 0:
    print("APPROVED")
elif x == 1:
    print("DENIED")

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    i = 0
    while i < N:
        if A[i] % 2 == 0:
            if (A[i] % 3) != 0 and (A[i] % 5) != 0:
                return("DENIED")
                break
        i += 1
    return("APPROVED")
print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

i = 0
A = input().split()
ans = 'APPROVED'

while i < N:
  a = A[i]
  if int(a) % 2 == 0:
    if not ((int(a) % 5 == 0) or (int(a) % 3 ==0)):
      ans = 'DENIED'

  if ans == 'DENIED':
    break

  i += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
lst = input().split(' ')
for v in lst:
  good = False
  if int(v) % 2 != 0:
    good = True
  elif int(v) % 3 != 0 and int(v) % 5 != 0:
    print('DENIED')
    break
  else:
    good = True
if good:
  print('APPROVED')

Submission status: Accepted

Solution code:
N = int(input())
A = map(int,input().split())
A_even = [i for i in A if i % 2 == 0]
baisuu = [i for i in A_even if i % 3 == 0 or i % 5 == 0]
if A_even == baisuu:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().strip().split()))
def border_judge(N,A):
    judge=True
    for n in range(len(A)):
        if A[n]%2==0:
            if A[n]%5==0 or A[n]%3==0:
                judge=True
            else:
                judge=False
                break
        else:
            pass

    if judge==True:
        return "APPROVED"
    elif judge==False:
        return "DENIED"

print(border_judge(N,A))

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:
# 200216 B

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())
a = map(int, input().split())
for i in a:
    if i % 2 == 0:
        if not(i % 3 == 0 or i % 5 == 0):
            print("DENIED")
            exit(0)
print("APPROVED")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

flag = False
for x in xs:
    if x % 2 == 0:
        if x % 3 == 0 or x % 5 == 0:
            pass
        else:
            flag = True
            break

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

print('APPROVED')

Submission status: Accepted

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

cnt=0
for value in data:
    if value%2==0:
        if (value % 3 ==0) or (value % 5 == 0):
            None
        else:
            cnt+=1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#155_B
n = int(input())
A = list(map(int, input().split()))
flg = all(a%3==0 or a%5==0 for a in A if a%2==0)
print('APPROVED' if flg else 'DENIED')

Submission status: Accepted

Solution code:
_ = input()
l = map(int, input().split())

def chk_valid(i):
    if i % 2 == 1:
        return False
    if i % 3 == 0 or i % 5 == 0:
        return False
    return True

f = filter(chk_valid, l)
print('APPROVED' if len(list(f)) == 0 else 'DENIED')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in 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())
a = list(map(int, input().split()))
ans = "APPROVED"
for i in range(n):
    if a[i] % 2 == 0 and 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()))
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()))
res='APPROVED'
B=[]
for a in A:
    if a%2==0:
        B.append(a)

if len(B)==0:
    res='APPROVED'
if 0<len(B):
    for b in B:
        if (b%3!=0)&(b%5!=0):
            res='DENIED'
print(res)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int, input().split()))
    ok = True
    for a in A:
        if a%2 == 0 and a%3 != 0 and a%5 != 0:
            ok = False
            break
    
    if ok:
        print("APPROVED")
    else:
        print("DENIED")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
##======================================python3
''' ===========================================
## null
##
##
=========================================== '''
import sys
from sys import stdin #read(), readline()
input = stdin.readline
import heapq #heappush(trgt, val) heappop(trgt) trgt[0] __lt__<
sys.setrecursionlimit(10**6)
INF = 1<<50

if __name__ == '__main__':
    n = int(input())
    
    chk = True;
    
    iip = list(map(int, input().split(' ')))
    for i in range(n):
        a = iip[i]
        if a&1 == 0:
            if a%3 == 0 or a%5 == 0:
                continue;
            else:
                chk = False;
                break;
        else:
            continue;
    
    if chk == True:
        print("APPROVED")
    else:
        print("DENIED")

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]

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

print('APPROVED')

Submission status: Accepted

Solution code:
n = int(input())
ls = map(int, input().split())
a = []
b = 0
for i in ls:
    if i % 2 == 0:
        a.append(i)
    else:
        continue
for j in a:
    if (j % 3 == 0) or (j % 5 == 0):
        b += 1
    else:
        continue
if b == len(a):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
def im():
    a=int(input())
    b=input()
    b=b.split()
    b1=list(map(int,b))
    for i in b1:
        if i%2==0 and i%3!=0  and i%5!=0:
            return "DENIED"
    return "APPROVED"
print(im())

Submission status: Accepted

Solution code:
x=int(input())
y=input()
z=y.split()
e=0
for i in z:
    w=int(i)
    if w%2 == 0:
        if w%5 == 0:
            continue
        elif w%3 ==0:
            continue
        else:
            e=1
        
if e == 1:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

Solution code:
n=int(input())
A=list(map(int,input().split()))
for i in A:
  if i%2==1 or i%6==0 or i%10==0:
    continue
  print("DENIED")
  exit()
print("APPROVED")

Submission status: Accepted

Solution code:
import os

def main():
    count = int(input())
    NumList = list(map(int, input().split()))
    ansList = []
    ansCount = 0

    for num in NumList:
        if num % 2 == 0:
            ansList.append(num)
            if ((num % 3 == 0) or (num % 5 == 0)):
                ansCount += 1
            else:
                pass
        else:
            pass

    if len(ansList) != ansCount:
        print("DENIED")
    else:
        print("APPROVED")

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 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()))

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
approve=0
for k in range(0,n):
  if a[k]%2==0:
    if (a[k]%3==0)or(a[k]%5==0):
      approve=approve+0
    else:
      approve=approve+1

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

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

Submission status: Accepted

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

flag = True
for a in Ai:
  if a%2 == 0:
    if not (a%3 ==0 or a%5 == 0):
      flag = False
      break
    

if flag is True:
  print('APPROVED')
else:
  print("DENIED")

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
A = map(int, input().split())
for a in A:
    if a % 2 == 0:
        if not (a % 3 == 0 or a % 5 == 0):
            print('DENIED')
            break
else:
    print('APPROVED')

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
#print(N,A)
flg = True
cnt = 0
for i in range(N):
  if (A[i] % 2) == 0:
    cnt += 1
    if (A[i] % 3) != 0 and (A[i] % 5) != 0:
      flg = False
      break
if cnt == 0 or flg:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

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

for j in range(len(num2)):
    if len(num2) == 0:
        flg = True
        break        
    elif num2[j] % 3 == 0 or num2[j] % 5 == 0:
        continue
    else:
        flg = True
        break


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

Submission status: Accepted

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

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 and a[i] % 3 != 0 and a[i] % 5 != 0:
        count+=1
if count == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

N= int(input())

# スペース区切りの整数の入力
list = list(map(int, input().split()))


flag=True


for num in range(N):
    q, mod = divmod(list[num], 2)
    if mod==0:
        q, mod3 = divmod(list[num], 3)
        q, mod5 = divmod(list[num], 5)
        if mod3!=0 and mod5!=0:
           flag=False


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

Submission status: Accepted

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

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:
        if a[i]%3 != 0 and a[i]%5 != 0:
            flag = False

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

Submission status: Accepted

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

Submission status: Accepted

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

ret = "APPROVED"

for i in b:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            ret = "DENIED"
            break
print(ret)

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:
import sys
import os

OK = 'APPROVED'
NG = 'DENIED'


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.buffer.readline().rstrip())
    A = list(map(int, sys.stdin.buffer.readline().split()))

    ret = OK
    for a in A:
        if a % 2 == 0 and a % 3 != 0 and a % 5 != 0:
            ret = NG

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
'''input
3
28 27 24
'''
n = input()
a = map(int, input().split())

ok = 1
for i in a:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			ok = 0

if ok == 1:
	print("APPROVED")
else:
	print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = (int(x) for x in input().split())
count2 = 0
count = 0
for num in a:
    if (num % 2) == 0:
        count2 += 1
        if (num % 3) == 0 or (num % 5) == 0:
            count += 1

if count2== count  :
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

isapp = [ i % 2 == 1 or i % 6 == 0 or i % 10 == 0 for i in nums]
if(all(isapp)):
  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 and 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 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())
aa = list(map(int, input().split(' ')))

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

print(result)

Submission status: Accepted

Solution code:
A=input().split()
x = input().split()
target ="APPROVED"
for i in x:
  if int(i)%2 == 0:
    if int(i)%3 > 0 and int(i)%5 > 0:
      target = "DENIED"
      break
print(target)

Submission status: Accepted

Solution code:
N=input().split()
LIST=input().split()
FLUG=0

for num in LIST:
  if int(num)%2==0 and int(num)%3!=0 and int(num)%5!=0 :
    FLUG=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
a = na()
flag = True
for x in a:
    if x % 2 == 1:
        continue
    if x % 2 == 0:
        if x % 3 == 0 or x % 5 == 0:
            continue
        else:
            flag = False
if flag:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
def papers_please(a_list:list) -> str:
    approved_list = []      
    for x in a_list:
        if x % 2 == 0:
            if x % 3 == 0 or x % 5 == 0:
                approved_list.append("APPROVED")
            else:
                approved_list.append("DENIED")
        else:
            approved_list.append("APPROVED")
    if "DENIED" in approved_list:
        return("DENIED")
    else:
        return("APPROVED")

n = int(input())
a_list = list(map(int, input().split()))
print(papers_please(a_list))

Submission status: Accepted

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

immigre = 'APPROVED'
for num in list:
  if num % 2 == 0:
    if (num % 3 != 0) and (num % 5 != 0):
      immigre = 'DENIED'
print(immigre)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
A_list = []
ans = 0

N = int(input())
A = input()
A_list = A.split(' ')

for n in range(N):
    if (int(A_list[n]) % 2 == 0):
        if (int(A_list[n]) % 3 == 0) | (int(A_list[n]) % 5 == 0):
            ans = ans + 0
        else:
            ans = ans + 1
if ans == 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
flag = False
for i in l:
  if i%2==0:
    if i%3!=0 and i%5!=0:
      flag=True
      break
if not flag:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
flag = False
for i in l:
  if i%2==0:
    if i%3!=0 and i%5!=0:
      flag=True
      break
if not flag:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

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

for ni in range(rangeNum):
    if n[ni]%2 == 0:
        if n[ni]%3 == 0:
            continue
        elif n[ni]%5 == 0:
            continue
        else:
            print("DENIED")
            exit()
    else:
        continue
print("APPROVED")