AtCoder Beginner Contest 155
B
Papers, Please
AtCoder
⌀ 0
原题
← AC →
翻译中…

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.

翻译中…

Note

翻译中…
  • 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.

翻译中…

样例

Input #1
5
6 7 9 10 31
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.
Input #2
3
28 27 24
Output #2
DENIED
$28$ violates the condition, so the immigrant should not be allowed entry.
题目信息
题号
abc155_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。