Given two numbers L and R. Find the count of number N in range [L,R] such that N satisfies given conditions :-
1. N is a prime number. 2. N is a palindromic number. For ex : N = 3 is a valid but N = 23 is not valid as it is not palindromic.
Example
If L = 150 and R = 200. There are 3 such numbers which satisfy the given conditions.
Function Description
Complete the palPrime function provided in the editor. This function takes the following 2 parameters and returns the required answer.
Input First line contain T, number of test cases Next T line contain two space separated integers L R. Output For each test case, output count of valid N possible in given range.
Constrains
2, 3, 5, 7, 11 are first few palindromic prime numbers