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: Runtime Error

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: Runtime Error

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)
    
    for p in l:
        if p%3==0 or p%5==0:
            a.append(p)
        else:
            b.append(p)

    if len(a)==len(l):
        print("APPROVED")
    else:
        print("DENIDE")

Submission status: Runtime Error

Solution code:
3
28 27 24

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
flag = True
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):
            flag = False
            break
        
if flag==True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

result="DENIED"
for a in range(As):
  if a%2==0 and a%3!=0 and a&5!=0:
    result="APPROVED"
print(result)

Submission status: Runtime Error

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

result="DENIED"
for a in range(As):
  if a%2==0 and a%3!=0 and a&5!=0:
    result="APPROVED"
print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
    n= int(input())
    lista=[]
    listanova=[]
    for x in input().split():
    	x= int(x)
    	if x %2 ==0:
    		lista.append(x)
    for x in lista:
    	if x %3==0 or x%5==0:
    		listanova.append(x)
     
    if len(lista)==len(listanova):
    	print('APPROVED')
    else:
    	print('DENIED')

Submission status: Runtime Error

Solution code:
n = int(input())
a = 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("DENIED")
      exit()
print("APPROVED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=input1()
A=input_array()
flag=True
for x in A:
	if x%2==0:
		if x%3==0 or x%5==0:
			continue
		else:
			flag=False
			break
if flag:
	print("APPROVED")
else:
	print("DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

j = True
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] %3 == 0 or A[i] % 5 ==0:
            pass
        else:
            j = False
            exit()
            
if j == Ture:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
N=int(input())
As=list(map(int, input().split()))
rejected=false
for A in As:
  if A%2==0:
    if A%3*(A%5)!=0:
      rejected=true
if rejected:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Runtime Error

Solution code:
n=int(input())
a = list(map(int,input().split()))
i = 0
while True:
    if a[i]%2==0 and not (a[i]%3==0 and a[i]%5==0):
        print('DENIED')
        break       
    elif i==n:
        print('APPROVED')
        break
    else:
        i+=1

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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:
            answer='APPRPVED'
        else:
            answer='DENIED'
            break

print(answer)

Submission status: Runtime Error

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

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

for j in range(len(B)):
    if B[j]%3==0:
        answer='APPRPVED'
        continue
    elif B[j]%5==0:
        answer='APPRPVED'
        continue
    else:
        answer='DENIED'
        break

print(answer)

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split()))
l2 = [i for i in l if i % 2 == 0]
l3 = [i for i in l2 if i % 3 == 0]
l4 = [i for i in l2 if i % 5 == 0]
l5 = list(set(l4+l3))
elif len(l5) != len(l2):
    if len(l2) != 0:
        print('DENIED')
    else:
        print('APPROVED')
else:
    print('APPROVED')

Submission status: Runtime Error

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

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

print('APPROVED')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

cnt = 0
for e in even:
    if e % 3 == 0 or e % 5 == 0:
        cnt += 1
if cnt == len(even):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
N = int(input())
array = [int(x) for x in input().split()]
for i in array:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      fg = True
    else:
      fg = False
if fg: print('APPROVED')
else: print('DENIED')

Submission status: Runtime Error

Solution code:
N = int(input())
array = [int(x) for x in input().split()]
for i in array:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      fg = True
    else:
      fg = False
      print('DENIED')
      break
if fg:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
N = int(input().strip())
array = [int(x) for x in input().split()]
for i in array:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      fg = True
    else:
      fg = False
      print('DENIED')
      break
if fg:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
flag = “ok”
for i in a_list:
  if i%2 == 0: 
    if i%3 != 0 or i%5 != 0:
      flag = “ng”
if flag == “ok”
  print(“APPROVED”) 
else:
  print(“ DENIED”)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main()
{    
    int  n;
    cin>>n;
    int a[n];
    bool ok=1;
    for(int i = 0; i < n; ++i)
    {  
        cin>>a[i];
        if(a[i]%2==0)
        {
            if(a[i]%3==0 || a[i]%5==0)
            {
                continue ;
            }
            else
            {
                ok=0;
                break;
            }
        }      
    } 
    cout<<(ok? "APPROVED":"DENIED")<<endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
def resolve():
    N = int(input())
    arr = list(map(int, input.split()))
    for num in arr:
        if not num % 2 and not (num % 3 == 0 or num % 5 == 0):
            print('DENIED')
            quit()
    print('APPROVED')

resolve()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(N):

    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
        else:
            print("DENIED")
            exit(0)

print("APPROVED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
for item in A:
    if item%2==0:
        B.append(item)
cnt = 0
ans = ''
for item in B:
    if item%3!=0:
        if item%5!=0:
            ans = 'DENIED'
if ans!='DENIED':
    ans = 'APPROVED'
print(ans)

Submission status: Runtime Error

Solution code:
print("APPROVED" if int(input()) == xsum([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: Runtime Error

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 or i%5!=0):
                f=1
                break
    if(f):
        print('DENIED')
    else:
        print('APPROVED')
        
















    
    
if __name__ =="__main__":
    main()

Submission status: Runtime Error

Solution code:
int x=input()
n=[]
for i in range(x):
  n[i] = input()

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

cal(n)

Submission status: Runtime Error

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: Runtime Error

Solution code:
x = input()
n = []
for i in range(x):
    n[i] = input()

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

cal(n)

Submission status: Runtime Error

Solution code:
x = input()
n = []
for i in range(x):
    n[i] = input()

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

cal(n)

Submission status: Runtime Error

Solution code:
N=int(input())
ans=0
m=0
for i in range(N):
    A=int(input())
    if A%2==0:
        m=m+1
        if A%3==0 or A%5==0:
            ans=ans+1
if m==ans:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
N=int(input())
ans=0
m=0
for i in range(N):
  A=int(input())
  if A%2==0:
    m=m+1
    if A%3==0 or A%5==0:
    　　ans=ans+1
if m==N:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

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

for i in range(n):
    if a[i] % 6 == or a[i] % 10:
        print('APPROVED')
        break

print('DENIED')

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if a%2==0:
        if a%3==0 or a%5==0:
            ans = 1
        else:
            ans = 0

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
data = input().split()

ans = "APPROVED"

for i in range(n):
  num = int(data[i])
  if !(num % 6 == 0 or num % 10 == 0):
    ans = "DENIED"
    break

print(ans)

Submission status: Runtime Error

Solution code:
int x=input()
n=[]
for i in range(x):
  n[i] = input()

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

cal(n)

Submission status: Runtime Error

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: Runtime Error

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[1])
      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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A=input().split()
#array = [int(input()) for i in range(int(A))]
x = []
print(x[1])
print(A)
target ="DENIED"
for i in x:
  if x.index[i]%2 == 0:
    if x.index[i]%3 == 0 or x.index[i]%5 == 0:
      target = "APPROVED"
      break
print(target)

Submission status: Runtime Error

Solution code:
A_list = []

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

Submission status: Runtime Error

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

ans = True
for ni in range(rangeNum+1):
    if n[ni] % 2 == 0:
        if n[ni] % 3 == 0:
            break
        elif n[ni] % 5 == 0:
            break
        else:
            ans = False
    else:
        ans = False
if ans==True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#整数の入力
N = int(input())

#複数の入力
input_list = input().split( )

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(){
  cout<<"Hello"<<endl;
}

Submission status: Runtime Error

Solution code:
ans = True
for i in A:
    if i%2 == 0:
        if i%3 == 0 or i%5 == 0:
            continue
        else:
            ans = False
print("APPROVED" if ans==True else "DENIED")

Submission status: Runtime Error

Solution code:
import sys
a=input()
arr = list(map(int, input().split()))
c=False
for i in arr:
	if(i%2==0):
		if(i%3==0 or i%5==0 ):
			c=True	
		else:
			c=False
            break;
if(c==True):
	print("APPROVED")	
else:
	print("DENIED")

Submission status: Runtime Error

Solution code:
N = int(input())
A = (input().split())
i_count = 0
test = []
 for i in A:
  num = int(i) % 2
  if num == 0 :
    test.append(i)
 
 for i in test:
  num3 = int(i) % 3
  num5 = int(i) % 5
  if num3 == 0 or num5 ==0:
    i_count += 1
 
 if i_count == len(test):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
for _ in range(n):
  a = int(input())
  if a % 2 == 0:
    if a % 5 != 0 or a % 3 != 0:
      print('DENIED')
      break
else:
  print('APPROVED')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = (int(num) for num in 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: Runtime Error

Solution code:
N=input();print('DENIED'if any([x%2==0 and(x%3andx%5)for x in map(int,input().split())])else'APPROVED')

Submission status: Runtime Error

Solution code:
N=int(input())
print('DENIED' if any([x%2==0 and (x%3 and x%5) for x in int(input().split())]) else 'APPROVED')

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))(A1,A2...AN)
t=0
for i in b:
	if x % 2 ==0 and x % 3 != 0 and x % 5 != 0:
		t=t+1
if t>0:
	print('DENIED')
else:
	print('APPROVED')

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))(A1,A2...AN)
t=0
for i in A:
	if x % 2 ==0 and x % 3 != 0 and x % 5 != 0:
		t=t+1
if t>0:
	print('DENIED')
else:
	print('APPROVED')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ans = 'APPROVED'

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

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

print(ans)

Submission status: Runtime Error

Solution code:
# 偶数かつ3または5で割り切れる

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

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
a = np.array([int(x) for x in input().split()])

a1 = list(map(lambda x: bool(x/2%1), a))
a2 = list(map(lambda x: bool(x/3%1), a/2))
a3 = list(map(lambda x: bool(x/5%1), a/2))
a4 = list(map(lambda x, y: x and y, a2, a3))
if a1.count(False) == a4.count(False):
    print("APPROVED")
else:
    print("DENIED"

Submission status: Runtime Error

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

a_even = []
for ai in a:
    if ai%2 == 0:
        a_even += [ai]

for a_eveni in a_even:
    if a_eveni%3 != 0 or a_eveni%5 != 0:
        ans = "DENIED"
    else:
        ans = "APPROVED"
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
admission = []
n = int(input())
admission.append(map(int,input().split()))

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

Submission status: Runtime Error

Solution code:
admission = []
n = int(input())
admission.append(map(int,input().split()))

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

Submission status: Runtime Error

Solution code:
admission = []
n = int(input())
admission.append(map(int,input().split()))

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

Submission status: Runtime Error

Solution code:
admission = []
n = int(input())
admission.append(map(int,input().split()))

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

Submission status: Runtime Error

Solution code:
admission = []
n = int(input())
admission.append(map(int,input().split()))

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

Submission status: Runtime Error

Solution code:
admission = []
n = int(input())
admission.append(map(int,input().split()))

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

Submission status: Runtime Error

Solution code:
admission = []
n = int(input())
admission.append(map(int,input().split()))

for i in range(n):
    if admission[n] % 2 == 0:
        if admission[n] % 3 == 0 or admission[n] % 5 == 0:
            print("APPROVE")
        else:
            print("DENIED")

Submission status: Runtime Error

Solution code:
admission = []
n = int(input())
admission.append(map,int(input().split()))

for i in range(n):
    if admission[n] % 2 == 0:
        if admission[n] % 3 == 0 or admission[n] % 5 == 0:
            print("APPROVE")
        else:
            print("DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    N = I(); A = LI(); judge=True
    for i in A:
        if A%2==0:
            if A%3!=0 or A%5!=0:
                judge=False
    if judge:
        print('APPROVED')
    else:
        print('DENIED')
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(int, input().split())
for i in A:
    if not(i % 3 == 0 or i % 5 == 0):
        print("DENIED")
        break
else:
    print("APPROVED")