A Shady Problem

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

There are \(N\) objects each with a value \(v_i\). An object \(i\) is defined as shady if \(v_i\) has a prime number of digits, and the sum of its digits is prime.

Output whether each object is a shady object or not!

Input Specification

The first line will contain the integer \(N\ (1 \le N \le 1000)\).

The next \(N\) lines will each contain one integer, \(v_i\ (1 \le v_i < 10^{1000})\), the values of the objects.

Output Specification

Output \(N\) lines, the \(i^{th}\) line is YES if the \(i^{th}\) object is shady, and NO otherwise.

Sample Input

3
59
2132
3920393

Sample Output

NO
NO
YES

Comments

There are no comments at the moment.