Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Prime String

By Rifat_MU47 · Limits 2s, 512 MB

We know that a prime number is a number that is divisible only by itself and $1$ (e.g. $2, 3, 5, 7, 11$).

Alice has a string $S$ of size $n$. She calls a string good if the sum of ASCII values of all characters is a prime number. For example, let she has a string “$abb$”. Now the sum of the ASCII values of ‘$a$’, ‘$b$’, and ‘$b$’ is $(97+98+98) =293$ — which is a prime number. Then we can consider the string “$abb$” as a good string.

Now your task is to help Alice to find out the string is good or not.

Input

Each test contains multiple test cases. The first line contains the number of test cases $t \hspace{.1cm} (1 \leq t \leq 100)$. The description of the test cases follows.

The first line of each test case contains only one integer $n \hspace{.1cm} (1 \leq n \leq 100)$ — the length of the string.

The next line contains the string $S \hspace{.1cm} (|S| = n)$. It is given that $S$ consists of both English uppercase and lowercase letters.

Output

For each input first print “Case #X: ” (where $X$ is the case number). Then, print “Yes” if the string is good, or, print “No”. Always print without quotes.

Sample

InputOutput
2
3
abb
3
aba
Case #1: Yes
Case #2: No

Note

$|S|$ denotes the length of $S$.

    Discussion

    Statistics


    96% Solution Ratio

    steinumEarliest, 1w ago

    steinumFastest, 0.0s

    cloud007Lightest, 0 B

    abid1729Shortest, 317B

    Submit

    Login to submit