Palindromic Prime

4.2

12 votes
Problem

Consider the palindromic prime numbers(Numbers which are palindrome as well as prime).Let p be the product of non zero digits of a nth palindromic prime number.Let product of digits of a palindromic prime is multiplied by a number m to generate number q(q=p*m).Your task is simple; you have to find number of divisors of q.

INPUT:

First Line contains number of test cases t. Second line contains two space separated numbers n and m.

OUTPUT:

Output each test case in new line number of divisors of q.

CONSTRAINTS:

t<=10000 n<=113 1<=m<=100

Time Limit: 0
Memory Limit: 256
Source Limit:
Explanation

2nd palindromic prime is 3 value of m is 1 so value of q is 3.Numbers of divisors of 3 is 2(1 and 3)

Editor Image

?