TRCSTRPR - Prime Names
Mina and Raju are playing a game. They will provide a list which contains a name and a number to each
other. They have to add the number to the ASCII values of the names character. Then they have to check
that if any of the new added number is prime or not. If for any character of the name the added number is
prime then the name will be considered as prime name. Can you help Mina and Raju to find the prime
Suppose the list contains two names Mina and Raju. The list will be as following,
For the first name ASCII values are: 77 105 110 97
After addition the values will be: 97 125 130 117
As 97 is prime number so Mina is a Prime Name.
First line of input will be the size of the list L(L<100). Next L line contains S(name) and
N(number) pairs separated by space. Name is a string with less than 20 characters. The number will be less than 1000.
For every name print “YES” if it is prime name, else print “NO”
Shimul 60 Output: YES