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

for i in range(0, n):
    if a_list[i] % 2 == 0:
        new_list.append(a_list[i])

if all(elem % 3 == 0 or elem % 5 == 0 for elem in new_list):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N=int(input())
A=input().split()
cnt=0
for i in range(N):
    if int(A[i])%6==0 or int(A[i])%10==0:
            cnt += 1
sum=0
for i in range(N):
    if int(A[i])%2==0:
        sum += 1
if cnt==sum:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

# check
app_fl = True
for Ai in [a for a in A if a % 2 == 0]:
    if Ai % 3 != 0 and Ai % 5 != 0:
        app_fl = False
        break

if app_fl is True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N = input()
A = list(map(str, input().split()))
B=[]
C=[]
l=[]
m=[]
n=0
i=0
for a in range(int(N)):
    if int(A[a])%2==0:
       B.append(A[a])
       i=i+1
for a in range(int(i)):
    if int(B[a])%3==0 or int(B[a])%5==0:
       n=n+1
if n==i:
   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:
        if a[i]%3 != 0 and a[i]%5 != 0:
            approved = False
            break

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

Submission status: Accepted

Solution code:
N = int(input())
num = list(map(int, input().split()))
even = list(filter(lambda x: x % 2 == 0, num))
ans = "APPROVED"
for i in even:
  if i % 3 != 0 and i % 5 != 0:
    ans = "DENIED"
  
print(ans)

Submission status: Accepted

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

Flag=True
for i in range(N):
    if Alist[i]%2==0:
        if Alist[i]%3==0 or Alist[i]%5==0:
            continue
        else:
            Flag=False

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

Submission status: Accepted

Solution code:
#########行列読み込み ##############################################
"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""
##################################################################
#########入力系####################################################
"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""
##################################################################
n = int(input())
A = list(map(int,input().split()))	
B = []
cnt = 0

for i in A:
    if i%2==0:
        B.append(i)
for i in B:
    if i%3==0 or i%5==0:
        cnt +=1
if cnt==len(B):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
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")
            sys.exit(0)
else:
    print("APPROVED")

Submission status: Accepted

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

for num in numList:
    if num % 2 == 0:
        evenCount += 1
    if num % 2 == 0 and (num % 3 == 0 or num % 5 == 0):
        count += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

isDenyed = False

for x in l :
   if x % 2 == 0 :
       if (x % 3 == 0) or (x % 5 == 0) :
           continue
       else :
           isDenyed = True
           break

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

Submission status: Accepted

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

result = "APPROVED"

for x in A:
    if (x%2 == 0):
        if(x%3 == 0 or x%5 == 0):
            pass
        else:
            result = "DENIED"
            break

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = lr()
bl = all(x % 3 == 0 or x % 5 == 0 for x in A if x % 2 == 0)
print('APPROVED' if bl else 'DENIED')

Submission status: Accepted

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

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    N = II()
    A= LI()
    ans = 0

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

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




if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

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")
        sys.exit()
print("APPROVED")

Submission status: Accepted

Solution code:
approved = True
N = input()
for num in input().split():
    num = int(num)
    if (num % 2 == 0) and (num % 3 != 0 and num % 5 != 0):
        approved = False
if approved:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())
f=1
for i in a:
  if i%2==0:
    if i%3!=0 and i%5!=0:
      f=0
if f:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

Solution code:
N = int(input())
count=0
total_count=0

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

for x in list:
    if int(x)%2==0:
        if int(x)%3==0 or int(x)%5==0:
            total_count +=1
    else:
        total_count+=1
    count+=1

if total_count==int(N):
    print('APPROVED')

else:
    print('DENIED')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

L = list(map(int, input().split()))
S=set()
for i in range(n):
	if L[i]%2==0:
		S.add(L[i])
p=0
for s in S:
	if s%3!=0 and s%5!=0:
		print('DENIED')
		p+=1
		break

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

Submission status: Accepted

Solution code:
x = input()
y = input()
list = y.split()
even_list = []
result = ''

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
  else:
    result = "APPROVED"
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APPROVED"
  else:
    result = "DENIED"
    break
    
print(result)

Submission status: Accepted

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

#print(n,a)

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

c=[]
for i in range(0,len(b)):
    if b[i]%3==0 or b[i]%5==0:
        c.append(b[i])
#print(c)

if len(b)==len(c):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

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

Submission status: Accepted

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

flag = 0
for x in a:
  if x%2==0 and (x%3 and x%5):
    flag = 1
if flag:
  print("DENIED")
else :
  print("APPROVED")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = list(map(int, input().split()))
f = 0
for i in A:
    if i%2 == 0:
        if i%3 == 0 or i%5 ==0:
            pass
        else:
            f = 1
            break
if f == 1:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

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

ans = "APPROVED"
for i in range(N):
  if L[i]%2 == 0:
    if L[i]%3 == 0 or L[i]%5 == 0:
      pass
    else:
      ans = "DENIED"
      break
      
print(ans)

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 == 1:
        continue
    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 = 1
for num in A:
    if num % 2== 0:
        if num % 3 ==0 or num % 5 ==0:
            continue
        else:
            flag =0

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

Submission status: Accepted

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

evens = [i for i in Papers if i %2==0]

flg = 0

for j in evens:
    if j%3==0 or j%5==0:
        flg += 0
    else:
        flg+=1

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

Submission status: Accepted

Solution code:
import sys

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')
			sys.exit()

print('APPROVED')

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int,input().split()))
lie = [i for i in li if i % 2 == 0]
for i in range(len(lie)):
    if lie[i] % 3 == 0 or lie[i] % 5 == 0:
        pass
    else :
        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:
    if a[i]%3==0 or a[i]%5==0:
        continue
    else:
      ans='DENIED'
      break
  else:
    continue
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
M=list(map(int,input().split()))
S=[]
T=[]
for i in range(0,len(M))  :
  if M[i]%2==0:
    T.append(M[i])
    S.append(M[i])
for j in range(0,len(S)):
  if S[j]%3!=0 and S[j]%5!=0:
      T.remove(S[j])
    
if len(S)==len(T):
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
# = map(int, input().split())
a = list(map(int, input().split()))
# = [int(input()) for _ in range()]
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
print("APPROVED" if cnt1 == cnt2 else "DENIED")

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 not (i % 3 == 0 or i % 5 == 0):
      print('DENIED')
      sys.exit()
print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
n = int(input())
li = list(map(int, input().split()))
for i in li:
    if (i % 2 == 1):
        continue
    else:
        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()))

b=0
for i in range(n):
  if a[i]%2==1:
    b +=0
  else:
    if a[i]%3 ==0 or a[i]%5==0:
      b +=0
    else:
      b +=1
      
if b == 0:
  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 == 0 and not (a % 3 == 0 or a % 5 == 0):
        print("DENIED")
        exit()
print("APPROVED")

Submission status: Accepted

Solution code:
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#=======================================================================
import math as M
n=int(input())
bool=True
A=INPUT()
for i in range(n):
    if A[i]%2==0:
        if A[i]%3==0 or A[i]%5==0:
            continue
        bool=False
        break
if bool:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
n = int(input())
a = input().split()
even = []
even_counter = 0
div = 0
 
for i in a:
  int_a = int(i)
  if int_a % 2 == 0:
    even.append(int_a)
    even_counter += 1
 
for i in range(even_counter):
  if int(even[i]) % 3 == 0 or int(even[i]) % 5 == 0:
    div += 1
 
if div == even_counter:
  print("APPROVED")
else:
  print("DENIED")

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()
        else:
            continue
    else:
        continue

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
if all(i%3==0 or i%5==0 for i in A if i%2==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 a:
  if i%2 ==0 and (i%3 !=0 and i%5 != 0):
    ans += 1
  else:
    pass
  
if ans >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==0 and 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()))
ok = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

even_nums = [int(num) for num in input().split() if int(num) % 2 == 0]
approve_nums = [num for num in even_nums if any([num % 6 == 0, num % 10 == 0, num % 30 == 0])]
print('APPROVED') if len(approve_nums) == len(even_nums) else print('DENIED')

Submission status: Accepted

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

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

if a>0:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Accepted

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

cou = 0
ans = 0
for i in A:   
    if i % 2 == 0:
        cou += 1
        if i % 3 == 0 or i % 5 == 0:
            ans += 1

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)

for i in range(n):
    if a[i]%2 == 0 and ((not a[i]%3 == 0) and (not a[i]%5 == 0)):
        print("DENIED")
        break
    if i == n-1:
        print("APPROVED")
        break

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

Submission status: Accepted

Solution code:
def solve():
    for ai in a:
        if ai % 2 == 0 and (not (ai % 3 == 0 or ai % 5 == 0)):
            print("DENIED")
            exit()
    print("APPROVED")


n = int(input())
a = [int(s) for s in input().split(" ")]
solve()

Submission status: Accepted

Solution code:

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

for i in range(n):
    if a[i] % 2 == 1:
        pass
    else:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

Submission status: Accepted

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

B=[]
for a in A:
  if a%2==0:
    B.append(a)
    
cnt=0
for b in B:
  if (b%3==0 or b%5==0):
    continue
  else:
    cnt=1
    
if cnt==0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(sys.stdin.readline().rstrip())
li = list(map(int, sys.stdin.readline().split()))
flag = True
for i in li:
  if not i % 2:
    if i % 3 and i % 5:
      flag = False
print('APPROVED' if flag else 'DENIED')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def main():
    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"
    print(ans) 

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

l_1 = []
l_2 = []
for i in L:
    if i%2 == 0:
        l_1.append(i)
for i in l_1:
    if i%3 == 0 or i%5 == 0:
        l_2.append(i)
if len(l_1) == len(l_2):
    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 == 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()))

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()))
if all(v%2==1 or v%3==0 or v%5==0 for v in A):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

N = int(input())
A = list(map(int, input().split()))
A_even = [i for i in A if i % 2 == 0]

if all(i%3 == 0 or i%5 == 0 for i in A_even):
    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 == 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()))
#2で割り切れるものいれるリスト,要素として0は入らないのでとりあえず0
B = [0 for _ in range(N)]
#2で割り切れるリストの数カウント
count = 0
#2で割り切れるリストに偶数要素を代入&要素数カウント
for i in range(N):
  if A[i] % 2 == 0:
    B[i] = A[i]
    count += 1
#0は後からいれた要素ではありえないので削除
C = [i for i in B if i != 0]
#3と5のどちらでも割り切れない場合はだめ
flag = 0
for i in range(count):
  if C[i] % 3 != 0 and C[i] % 5 != 0:
    flag += 1
if flag == 0:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

Solution code:
import sys
N = input()
As = [int(n) for n in input().split()]

for A in As:
    if A % 2 == 0:
        if not(A % 3 == 0 or A % 5 == 0):
            print('DENIED')
            sys.exit(0)

print('APPROVED')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
'''
おぐに聞く
a_list = []
'''
a_count = 0
count = 0
#print(a)
for i in range(n):
    if a[i]%2==0:
        a_count+=1
        #print(a[i])
        if a[i]%3==0 or a[i]%5==0:
            count+=1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            cnt += 1
    else:
        cnt += 1
if cnt == N:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
n = int(input())
a = input()
b = a.rstrip().split()
d = 0
for e in b:
  c = int(e)
  if c%2 == 0:
    if c%3 != 0 and c%5 != 0:
      d += 1
if d == 0:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
f = True
for i in range(len(A)):
    if A[i]%2 == 0:
        if A[i]%3 == 0 or A[i]%5 == 0:
            continue
        else:
            f = False

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
def check(n):
    if (n%3==0) | (n%5==0):
        return 0
    else:
        return n

n = int(input())
s = list(map(int, input().split()))
p = [i for i in s if i%2 == 0]
q = map(check,p)

if sum(q)==0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
ans = True
for x in A:
    if x & 1 == 0:
        if x % 3 != 0 and x % 5 != 0:
            ans = False
            break
print('APPROVED' if ans else 'DENIED')

Submission status: Accepted

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

for i in A:
    if i%6==0 or i%10==0 or i%2 == 1:
        continue
    else:
        print('DENIED')
        exit()

print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# d = list(map(int, input().split()))
n = int(input())
a = input().split()
even = []
even_counter = 0
div = 0
 
for i in a:
  int_a = int(i)
  if int_a % 2 == 0:
    even.append(int_a)
    even_counter += 1
 
for i in range(even_counter):
  if int(even[i]) % 3 == 0 or int(even[i]) % 5 == 0:
    div += 1
 
if div == even_counter:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

def main():
    *A, = map(int, open(0).read().split())
    N = A[0]
    A = A[1:]

    C = []
    B = [i for i in A if i % 2 == 0]
    for i in B:
        if (i % 3 == 0 or i % 5 == 0):
            C.append(0)
        else:
            C.append(1)
    
    if sum(C) == 0:
        print("APPROVED")
    else:
        print("DENIED")



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)and(A[i]%5!=0)):
      print('DENIED')
      break
  if(i==N-1):
    print('APPROVED')

Submission status: Accepted

Solution code:
n = int(input())
a = input().split()
even = []
even_counter = 0
div = 0

for i in a:
  int_a = int(i)
  if int_a % 2 == 0:
    even.append(int_a)
    even_counter += 1

for i in range(even_counter):
  if int(even[i]) % 3 == 0 or int(even[i]) % 5 == 0:
    div += 1

if div == even_counter:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:
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")
			sys.exit()

print("APPROVED")

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
flag = True
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            continue
        else:
            flag = False
            break

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
checker=0
count=0
for i in range(len(a)):
  if a[i]%2==0:
    checker+=1
    if a[i]%3==0 or a[i]%5==0:
      count+=1
if checker==count:
  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 and (i%3 == 0 or i%5 == 0):
        continue
    elif i%2 == 0 and (i%3 != 0 or i%5 != 0):
        Flag = False

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

Submission status: Accepted

Solution code:
n = int(input())
for a in list(map(int, input().split())):
    if not a % 2 and a % 3 and a % 5:
        print("DENIED")
        break
else: 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 or i % 5 == 0:
      continue
    else:
      Flag = False

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

Submission status: Accepted

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

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

Submission status: Accepted

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

A_even = [x for x in A if x%2 == 0]
ans = 'APPROVED'
for i in A_even:
    if i%3 == 0 or i%5 == 0:
        ans = 'APPROVED'
    else:
        ans = 'DENIED'
        break
print(ans)

Submission status: Accepted

Solution code:
#ライブラリの読み込み
import math

#入力値の格納
n = int(input())
numbers = input().split()

#変数の初期化
text = "APPROVED"

#計算
for i in numbers:
    if (int(i) % 2 == 0) and (int(i) % 3 != 0) and (int(i) % 5 != 0):
        text = "DENIED"
        break

#表示
print(text)