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: Wrong Answer

Solution code:
import math


def readints():
    return list(map(int, input().split()))


n = int(input())
a = readints()


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

Submission status: Wrong Answer

Solution code:
number = int(input())
list_number = input().split()

def evennumber (num):
    if num % 2 == 0:
        return num
    else:
        return False
ok = 0
for i in list_number:
    status = evennumber(int(i))
    if status != False:
        if int(i) % 3 == 0 or int(i) % 5 == 0:
            pass
        else:
            ok = 1
            print("DENIED")

if ok == 0:
    print("APPROVED")

Submission status: Wrong Answer

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

c = [0] * n

for i in range(n):
    if (a[i] % 2 == 0):
        if (a[i] % 3 != 0) and (a[i] % 5 != 0):
            c[i] = 1
            
if (len(set(c)) == 1):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())

A = sorted([int(x) for x in input().split()])
flag = True
isOk = False
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            isOk = True
        else:
            isOk = False
            flag = False
            break
    else:
        pass


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

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = [int(e) for e in input().split()]
for i in range(N):
    if nums[i]%2 == 1:
        pass
    else:
        if nums[i]%3 == 0 or nums[i]%3 == 0:
            pass
        else:
            print("DENIED")
            break
    if i == N-1:
        print("APPROVED")
    else:
        pass

Submission status: Wrong Answer

Solution code:
time=int(input())
nums=[int(i) for i in input().split()]
odd=0
even=0
even35=0
for j in range(time):
    if nums[j]%2==0:
        even+=1
        if nums[j]%3!=0 and nums[j]%5!=0:
            continue
        else:
            even35+=1
    else:
        odd+=1
        
if even35==even==0:
    print("DENIED")
elif even35==even:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if flg == 1:
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
amount = int(input())
inputl = input().split()

flag = True

for i in range(0, amount-1):
    a = int(inputl[i])
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            flag = False

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

Submission status: Wrong Answer

Solution code:
a = input()
num = [int(x) for x in input().split()]
for x in num:
  if x % 2 == 0:
    if x % 3 != 0 and x % 5 != 0:
      print('DENIED')
      exit()
print('APPROVE')

Submission status: Wrong Answer

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

chk = 0
for i in range(0,N):
    if A[i]%2 == 0:
        if A[i]%3 == 0 or A[i]%5 == 0:
            continue
        else:
            chk += 1

if chk == 0:
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

count = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
for i in B:
    if i % 3 == 0 or i % 5 == 0:
         bcount += 1
if acount != bcount:
    print('DENIED')
elif acount == 0:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
amount = int(input())
inputl = input().split()

flag = True

for i in range(0, amount-1):
    a = int(inputl[i])
    print(a)
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            flag = False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math


def readints():
    return list(map(int, input().split()))


n = int(input())
a = readints()


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

Submission status: Wrong Answer

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

def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    ans = 'APPROVED'

    for i in a_list:
        if divide(i, 2):
            if not divide(i, 3) and not divide(i, 5):
                print(i)
                ans = 'DENIED'
                break
    
    print(ans)

def divide(x, k):
    if x % k == 0:
        return True
    return False

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

chk = 0
for i in range(0,N):
    if A[i]%2 == 0:
        if A[i]%3 == 0 or A[i]%5 == 0:
            break
        else:
            chk += 1

if chk == 0:
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
s = int(input())

arr = [int(i) for i in input().split(maxsplit=(s - 1))]

a = []

for i in arr:
    if i % 2 == 0:
        a.append(i)


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

if len(a) != 0:
    print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

F = 0

for i in range(N):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 or a[i] % 5 != 0:
      F = 1
      
if F == 1:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Wrong Answer

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

c = 0

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

result = "APPROVED"

for i in range(N):
    if (A[i] % 2 == 1) or ((A[i] % 2 == 0) and (A[i] % 3 == 0 or A[i] % 5 == 0)):
        break
    else:
        result ="DENIED"
        break

###########　出力
print(result)

Submission status: Wrong Answer

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

f = False
for a in aa:
  if a % 2 == 0:
    if (a % 3 != 0) or (a % 5 != 0):
      print('DENIED')
      f = True
      break
if not f:
  print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

L = []
for i in range(N):
    if A[i] % 2 == 1:
        L.append("A")
    elif A[i] % 2 == 0 and A[i] % 3 == 0:
        L.append('A')
    elif A[i] % 2 == 0 and A[i] % 5 == 0:
        L.append('A')
    else:
        L.append('D')
if len(set(L)) == 1:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

is_True = True
for p in people:
    if p % 2 == 0:
        if p % 3 != 0 or p % 5 != 0:
            is_True = False
            break

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

Submission status: Wrong Answer

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

for i in a:
    if i % 2 == 0:
        if i % 3 == 0:
            pass
        elif i % 5 == 0:
            pass
        else:
            print('DENIED')
            break
        
if i == a[-1]:
    print('APPROVED')

Submission status: Wrong Answer

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

result = "APPROVED"

for i in range(N):
    if (A[i] % 2 == 1) or ((A[i] % 2 == 0) and (A[i] % 3 == 0 or A[i] % 3 == 0)):
        break
    else:
        result ="DENIED"
        break

###########　出力
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math


def readints():
    return list(map(int, input().split()))


n = int(input())
a = readints()

for j in range(n):
    if a[j] % 2 != 0:
        exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

flag = 0
for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5 == 0:
            flag = 1
        else:
            flag = 0
            break

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

Submission status: Wrong Answer

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

count = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

temp = [ele for ele in list_number if ele % 2 == 0]
check = None
if len(temp) == 0:
    print("DENIED")
else:
    for ele in temp:
        if ele % 3 == 0 or ele % 5 == 0:
            check = True
        else:
            check = False
            break
if check:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
amount = int(input())
inputl = input().split()

flag = True
ex = False

for i in range(0, amount-1):
    a = int(inputl[i])
    if a % 2 == 0:
        ex = True
        if a % 3 == 0 or a % 5 == 0:
            continue
        else:
            flag = False

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

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
even=[]
for a in A:
    if a%2==0:
        even.append(a)
    
if len(even)==0:
    print("APPROVED")
    exit()
    
ans=False
    
for e in even:
    if e%3==0 or e%5==0:
        ans=True
    else:
        break

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

Submission status: Wrong Answer

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

for i in range(a):
  if int(list[i])%2 == 0:
    if int(list[i])%3 !=0 and int(list[i])%5 !=0:
      print('DENIED')

print('APPROVED')

Submission status: Wrong Answer

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

aa = [i for i in a if i%2 == 0]

flag = 0
for i in aa:
    if i%3 != 0 and i%5 != 0:
        print('DENIED')
        flag = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if count == 0:
  print("DENIED")

Submission status: Wrong Answer

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

flag = 0
for i in applist:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      flag = 1
    else:
      flag = 0
      break

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

Submission status: Wrong Answer

Solution code:
time=int(input())
nums=[int(i) for i in input().split()]
odd=0
even=0
even35=0
for j in range(time):
    if nums[j]%2==0:
        even+=1
        if nums[j]%3!=0 and nums[j]%5!=0:
            continue
        else:
            even35+=1
    else:
        odd+=1
        
if odd==time:
    print("DENIED")
    
else:
    if even35==even:
        print("APPROVED")
    else:
        print("DENIED")

Submission status: Wrong Answer

Solution code:
import sys
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 or a[i]%5 == 0):
            print(end="")
        else:
            print("DENITED")
            sys.exit()
print("APPROVED")

Submission status: Wrong Answer

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

for i in lis:
    print(A)
    if i % 2 == 0:
        if i%3 == 0 or i%5 == 0:
            A = True
        else:
            A = False
    else:
        continue

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

Submission status: Wrong Answer

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

c = [0] * n

for i in range(n):
    if (a[i] % 2 == 0):
        if (a[i] % 3 == 0) or (a[i] % 5 == 0):
            c[i] = 0
        else:
            c[i] = 1
            
if (len(set(c)) == 1):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
import sys

input()
input_line = [int(i) for i in input().split(" ") if int(i) % 2 == 0]

if input_line == []:
  print("DENIED")
  sys.exit()

for i in input_line:
  if i % 3 == 0:
    continue
  if i % 5 == 0:
    continue
  print("DENIED")
  sys.exit()
print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def dfs():
    for i in range(n):
        if a[i]%2 ==0:
            if a[i]%3 == 0 or a[i]%5==0:
                return True
            else:
                return False
                break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

flag = 0
for num in range(N):
    tmp = A[num]
    flag = 0 if (tmp%2==0 and (tmp%3==0 or tmp%5==0)) or tmp%2==1 else 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ALis = list(map(int,input().split()))
Flag = True

for i in range(N):
    if ALis[i] % 2 == 0:
        if ALis[i] % 3 != 0 and ALis[i] % 5 != 0:
           Flag = False

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

Submission status: Wrong Answer

Solution code:
import math


def readints():
    return list(map(int, input().split()))


n = int(input())
a = readints()

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

Submission status: Wrong Answer

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

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


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 or a[i] % 5 == 0:
            break
        else:
            Flag = False
            break
if Flag == True:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
amount = int(input())
inputl = input().split()

flag = True

for i in range(0,amount-1):
    a = int(inputl[i])
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            continue
        else:
            flag = False

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
A = input()
N = [int(i) for i in input().split()]
flag1, flag2 = 0, 0
for i in N:
    if i %2 == 0:
        if i %3 == 0:
            flag1 = 1
        if i % 5 ==0:
            flag2 =1

if flag1 ==1 and flag2 ==1:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

ans = ''
for i in A:
  if i%2==0:
    #print(i)
    #print(i%3, i%5)
    if i%3==0 or i%5==0:
      ans = 'APPROVED'
    else:
      ans = 'DENIED'
      break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import numpy as np


N = int(input().strip())
x = [int(str) for str in input().strip().split()]

x = np.array(x)
odd = x[x % 2 == 0]

result = np.all((odd % 3 == 0) | (odd % 5 == 0))

print('APPROVED' if result and len(odd) else 'DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
bomb = []
hako = list(map(int, input().split()))
for h in hako:
  if h % 2 != 0 and h % 3 != 0 and h % 5 != 0:
    bomb.append(1)
if len(bomb) == 0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

    ans = "APROVED"
    for ai in A:
        if ai%2 == 0:
            if ai%3 > 0 and ai%5 > 0:
                ans = "DENIED"
                break
    print(ans)

    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split(" ")))
S = []
for a in A:
    if a % 2 == 0:
        S.append(a)
    else:
        pass
flag = True
for s in S:
    if s % 3==0 or s% 5==0:
        pass
    else:
        flag = False
        print("DENIED")
if flag==True:
    print("APPROVED")

Submission status: Wrong Answer

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

a_list_even = [i for i in a_list if i % 2 == 0]

for a in a_list_even:
    if a % 3 == 0 or a % 5 == 0:
        continue
    else:
        print("DENIDE")
        exit()

print("APPROVED")

Submission status: Wrong Answer

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

for i in range(n):
    if a[i]%2 == 0:
        if a[i]%3 != 0 or a[i]%5 != 0:
            print("DENIED")
            k += 1
            break
        else:
            continue
    else:
        continue

if k == 0:
    print("APPROVED")

Submission status: Wrong Answer

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

f = False
for a in aa:
  if a % 2 == 0:
    if a % 3 != 0:
      print('DENIED')
      f = True
      break
    elif a % 5 != 0:
      print('DENIED')
      f = True
      break
if not f:
  print('APPROVED')

Submission status: Wrong Answer

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

test = True
for i in a:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      continue
    else:
      test = False
      break
if test:
  print('APPROVAL')
else:
  print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
	# n,m = map(int,input().split())
	n = int(input())
	a = list(map(int,input().split()))
	ans = 0
	den = 0
	for i in range(len(a)):
		if a[i] % 2 == 0:
			if a[i] % 3 == 0 or a[i] % 5 == 0:
				ans = 1
			else:
				den = 1
	if ans == 1 and den == 0:
		print("APPROVED")
	else:
		print("DENIED")
	
 
if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

flag = False

for i in range(N):
  if nums[i]%2 == 0 :
    if nums[i]%3 == 0:
      continue
    elif nums[i]%5 == 0:
      continue
    else:
      flag = True
      print('DENIED')
  else:
    continue

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if count == 0:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
#coding:utf-8
n = int(input())
a = list(map(int, input().split()))
num = []

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

if len(num) == 0:
    print('DENIED')
    exit()
else:
    for j in range(0, len(num)):
        if num[j] % 3 != 0 and num[j] % 5 != 0:
            print('DENIED')
            exit()

print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(s) for s in input().rstrip().split(' ')]
k = 1
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 != 0 or A[i] % 5 != 0:
      k = 0
if k == 1:
  print("APPROVED")
elif k == 0:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
oddNum = set()

for x in list(map(int, input().split())):
    if (x % 2 == 0):
        oddNum.add(x)

for o in range(len(oddNum)):
    if ((o % 3 != 0) | (o % 5 != 0)):
        print("DENIED")
        exit()

print("APPROVED")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
num = [x for x in A if x %2==0]
ans = True
for i in num:
    if i % 3 ==0 or i %5 ==5:
        pass
    else:
        ans = False
if ans:
    print("APPROVED")
else:
    print("DENIED")