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:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = LI()

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

for i in lst:
    if i % 3 == 0:
        continue
    if i % 5 == 0:
        continue
    print('DENIED')
    quit()
print('APPROVED')

Submission status: Accepted

Solution code:
from collections import deque
from itertools import chain, combinations
import json
import numpy as np


def main():
    N = int(input())
    A = [int(a) for a in input().split()]

    l = all((a % 5 == 0 or a % 3 == 0) for a in A if a % 2 == 0)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

N = int(stdin.readline())
l = list(map(int, stdin.readline().rstrip().split()))
ans = 'APPROVED'
for i in l:
	if(i&1 == 0 and not(i%3 == 0 or i%5 == 0)):
		ans = 'DENIED'
		break
# ans = solve(l)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:







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

else:
    print('APPROVED')

Submission status: Runtime Error

Solution code:
n, *a = map(int, open(0).read().split())
print(["APPROVED", "DENIED"][sum((i % 3) * (i % 5) for i in a if i % 2 == 0)])

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:
            result = 'APPROVED'
        else:
            result = 'DENIED'
        break

print(result)

Submission status: Runtime Error

Solution code:
N, A= int(input())


if N % 3 and N % 5 == 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
S_list = [input() for i in range(2)]
S_list_1 = S_list[1].split()

for i in S_list_1:   
    if int(i) % 2 == 0 :
        if i % 3 !=0 and i % 5 !=0 :
            result="DENIED"
            break
    else:
        result="APPROVED"        
print(result)

Submission status: Runtime Error

Solution code:
S_list = [input() for i in range(2)]
S_list_1 = S_list[1].split()
even_list = []
for i in S_list_1:   
    if int(i) % 2 == 0:
        even_list.append(int(i))
for i in even_list:
    if i % 3 ==0 or i % 5 ==0 :
        result="APPROVED"
    else:
        result="DENIED"
        break
print(result)

Submission status: Runtime Error

Solution code:
x = str(input())

if x % 3 == 0:
    print('APPROVED')
elif x % 5 == 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
# 155b

def atc_155b(input_value: str) -> str:
    N = int(input_value[0])
    Ai = [int(ai) for ai in input_value[1].split(" ")]
    for i in range(0, N):
        if Ai[i] % 2 == 0 and Ai[i] % 3 != 0 and Ai[i] % 5 != 0:
            return "DENIED"
    return "APPROVED"

N = input()
Ai = input()
print(atc_155b[N, Ai])

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
def main():
    a = np.fromstring(read(), np.int64, sep=' ')[1:]
    a = a[a % 2 == 0]
    if np.all((a % 3 == 0) or (a % 5 == 0)):
        print('APPROVED')
    else:
        print('DENIED')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 'APPROVED'
for i in range(N):
  if N[i] % 2 == 0:
    if N[i] % 3 != 0 or N[i] % 5 != 0:
      ans = 'DENIED'
      break
      
print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = map(int, input().split())

success =
for a in A:
    if a % 2  == 0 and (a % 3 == 0 or a % 5 ==0):
        print("DENIED")

print("APPROVED")

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include<ctime>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<cfloat>
#include<functional>
#include<tuple>
#include<math.h>
#include<bitset>
#include<stack>
#include<set>
#include<random>
#include<stdlib.h>
#define rip(i,n) for(int i=0;i<n;i++)
#define Rip(i,n) for(int i=1;i<=n;i++)
#define RIP(i,a,b) for(int i=a;i<b;i++)
#define all(V) V.begin(),V.end()
#define sec  setprecision;
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops");
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
using ll = long long;
using ld = long double;
using Pair = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
bool isOK(ll index, ll key,vector<ll>a) {
    if (a[index] >= key) return true;
    else return false;
}
// 汎用的な二分探索のテンプレ
ll binary_search(ll key) {
    ll left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
    ll right = (ll)a.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
    /* どんな二分探索でもここの書き方を変えずにできる！ */
    while (right - left > 1) {
        ll mid = left + (right - left) / 2;
        if (isOK(mid, key)) right = mid;
        else left = mid;
    }
    /* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
    return right;
}
ll gcd(ll a, ll b)
{if (a % b == 0)return(b);
else return(gcd(b, a % b));}
ll lcm(ll a, ll b)
{return a * b / gcd(a, b);}
ll pow(ll a,ll b){
	ll ans=0;
	if(b==0)return(1);
	if(b==1)return(a);
	if(n%2==0)return(pow(a*a,b));
	else return(pow(a*b-1)*a);
}
ll modpow(ll x, ll n, ll mod) {
	x %= mod;
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return (pow((x * x) % mod, n / 2, mod) % mod);
	else
		return (x * pow(x, n - 1, mod) % mod);
}
ll sum(vector<ll>a){
    int k=a.size();
    ll ans=0;
    rip(i,k)ans+=a[i];
    return(ans);
}
// 深さ優先探索
int N,M;
vector<bool> seen;
void dfs(const Graph &G, int v) {
    cin>>N>>M;
     // グラフ入力受取 (ここでは無向グラフを想定)
    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    // 頂点 0 をスタートとした探索
    seen.assign(N, false); // 全頂点を「未訪問」に初期化
    dfs(G, 0);
    seen[v] = true; // v を訪問済にする
    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v); // 再帰的に探索
    }
}
vector<ll>bfs(ll n,ll m,Graph G(n)){
    // グラフ入力受取 (ここでは無向グラフを想定)
    //Graph G(N);
    //for (int i = 0; i < M; ++i) {
      //  int a, b;
        //cin >> a >> b;
        //G[a].push_back(b);
        //G[b].push_back(a);
    //}
    // BFS のためのデータ構造
    vector<int> dist(N, -1); // 全頂点を「未訪問」に初期化
    queue<int> que;
    // 初期条件 (頂点 0 を初期ノードとする)
    dist[0] = 0;
    que.push(0); // 0 を橙色頂点にする
    //今回は出発点を0とする
    // BFS 開始 (キューが空になるまで探索を行う)
    while (!que.empty()) {
        int v = que.front(); // キューから先頭頂点を取り出す
        que.pop();

        // v から辿れる頂点をすべて調べる
        for (int nv : G[v]) {
            if (dist[nv] != -1) continue; // すでに発見済みの頂点は探索しない

            // 新たな白色頂点 nv について距離情報を更新してキューに追加する
            dist[nv] = dist[v] + 1;
            que.push(nv);
        }
    }
   return(dist);
}
signed main(){
 	int n;cin>>n;
  	vector<int>a(n);
  	rip(i,n)cin>>a[i];
  	rip(i,n){
      if(a[i]%2==0&&(a[i]%3==0||a[i]%5==0)){
        cout<<"DENIED"<<endl;
        return 0;
      }
  	}
   cout<<"APPROVED"<<endl;
}

Submission status: Runtime Error

Solution code:
n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
    		flag = "DENIED"
    
print(flag)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
q = list(map(int,input().split()))
alm = 0
for i in q:
  if i%2 == 0:
    alm = i
  	if alm%3 != 0 or alm%5 != 0:
    	print("DENIED")
        exit()

print("APPROVED")

Submission status: Runtime Error

Solution code:
n = int(input())
q = list(map(int,input().split()))
alm = 0
for i in q:
  ans = []
  if i%2 == 0:
    ans.append(i)
  	if ans[0]%3 != 0 or ans[0]%5 != 0:
    	print("DENIED")
        exit()
    ans.pop(0)

print("APPROVED")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
numbers =["10,16,20,30"]

for number in numebers:
  if number %3==0:
    print(f'APPROVED')
    
  else:
      
      if number %5==0:
        print (f'APPROVED')
      
      else:
      if number i:
        print(f'DENIED)

Submission status: Runtime Error

Solution code:
N = int,input()

count = 0
for i in range (1,N+1):
  if i % 3 == 0 or i % 5 == 0:
    count += i
  print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [i for i in map(int,input().split())]
Check = Fasle
check_list=[]
for s in range(n):
  if a[s]%2 == 0:
    check_list.append(a[s])
for t in range(len(check_list)):
  if check_list[t]%3 == 0 or check_list[t]%5==0:
    Check =True
if Check:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
import sys

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split())
flag = True
for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
        continue
    flag = False

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

flg = True
for i in range(n):
  if a[i]%2 == 0:
    cnt += 1
    if a[i]%3 == 0 or a[i]%5 == 0:
      pass
    else:
      flg = False
if flg: print("APPROVED")
else: print("DENIED")

Submission status: Runtime Error

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

even_numbers = []
for i in numbers:
  if i % 2 == 0:
    even_numbers.append(i)

answers = []
for i in even_numbers:
  if i % 3 == 0 or i % 5 == 0:
    answers.append(i)

if even_numbers == answers:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
for _ in  A:
    if _ % 2 == 0:
        if _ % 3 == 0 or _ % 5 == 0:
            ans *= 1
        else:
            ans *= 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
ans='APPROVED'
for i in range(n):
  x=int(input())
  if x%2==0:
    if x%3!=0 and x%5!=0:
      ans='DENIED'
      break
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

#A内の奇数を0にする
for i in range(len(A)):
  if A[i]%2 != 0:
    A.pop(A[i]) 
#A内偶数をチェックする
for t in range(len(A)):
  if A[i]%3 == 0 or A[i]%5 == 0:
    A_count +=1
print("APPROVED" if A_count == len(A) else "DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率


def input(): return sys.stdin.readline()[:-1]
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    #N = int(input())
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列


    A,B,C=map(int, input().split())

    if A==B and B!=C:
        print('Yes')
    
    elif A==C and B!=C:
        print('Yes')
    
    elif C==B and A!=C:
        print('Yes')
    
    else: print('No')


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from statistics import mean, median #median(list)で中央値

def input(): return sys.stdin.readline()[:-1]
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    N = int(input())
    #N, K = map(int, input().split())
    A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    flag=1
    for a in A:
        if a%2==1 or a%3==0 or a%5==0:
            pass
        else:
            flag=0
            break
    if flag:print('APPROVED')
    else: print('DENIED')





if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N=int(input())
a=list(map(int,input().split()))
arr=[]
for A in a:
    if A%2==0:
        arr.append(A)
    else:
        pass

for n in arr:
    if n%3==0 or n%%==0:
        pass
    else:
        print('DENIED')
        exit()
print('APPROVED')

Submission status: Runtime Error

Solution code:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Submission status: Runtime Error

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:
                pass
            else:
                flag = False

    if flag:
        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:
        even_num.append(i)
for j in range(len(even_num)):
    if even_num[j] % 3 != 0 and even_num[j] % 5 != 0:
        print('DENIED')
        exit()
print('APPROVED')

Submission status: Runtime Error

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

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

    print("APPROVED")


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
for i in range(2):
  input = input()
  lines.append(int(input))
searchList = []  
for i in range(lines[0]):
  split = lines[1].split()
  if split[i] % 2 == 0:
    searchList.appned(split[i])
out = "APPROVED"
for s in searchList:
  if s % 3 != 0 and s % 5 != 0:
    out = "DENIED"
    print(out)
    break
print(out)

Submission status: Runtime Error

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

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

print('APPROVED')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=map(int,input().split())
for i in a:
    if i%2==0:
        if i%3!=0 or i%5!=0:
            result='DENIDE'
        else:
            result='APROVED'
print(result)

Submission status: Runtime Error

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

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:
	  continue
    else:
      print("DENIED")
  else:
    continue
  print("APPROVED")

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
n=int(input())
nl=list(map(int, input().split(" ")))

for i in range(n):
 if nl[i]%2==0 :
　　if  nl[i]%6!=0 or nl[i]%10!=0:
          print("DENIED")
           sys.exit()
 

print("APPROVED")

Submission status: Runtime Error

Solution code:
N = int(input())

#リストにするとき
A_list = list(map(int,input().split()))

for i in A_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: Runtime Error

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

Submission status: Runtime Error

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

flag = 0

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

Submission status: Runtime Error

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

flag = 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

f = 'True'

for i in range(n):
  a = int(input())
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      f = 'False'

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print('APPROVED')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
A = list(map(str, input().split()))
B=[]
l=[]
m=[]
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 not int(B[a])%3==0 or int(B[a])%5==0:
       C.append(B[a])
    else:
       C=[0]
if C==0:
   print("DENIED")
else:
   print("APPROVED")

Submission status: Runtime Error

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

Flag=True
for i in range(N):
    print(i)
    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: Runtime Error

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

for i in l:
  if i%2==0:
    if (i%5==0 or i%3==0):
      flag=1
    else:
      flag=0
      break
if flag==1:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = [0 for _ in range(N)]
count = 0
for i in range(N):
  if A[i] % 2 == 0:
    B[i] = A[i]
    count += 1
B.remove(0)
flag = 0
for i in range(count):
  if B[i] % 3 != 0 and B[i] % 5 != 0:
    flag += 1
if flag == 0:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
from sys import exit
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")