SP15891 SNGPG - Prime Generator The Easiest Question Ever

Description

Prime number questions are always being favorite to everyone. This question is extension to the problem [PRIME GENERATOR](../PRIME1/). The question is very very simple and easier than that you cannot imagine. You have to count total number of such primes p in the range **\[a >= 0, b > 0\]** so that **(p $ ^{2} $ + 1) or/and (p $ ^{2} $ + 2) is/are prime(s)****.**

Input Format

First line of input is t, **(t < 100)** total number of test cases. Next t lines contains two integers a and b seperated by space. **a < 50001, b < 100001 and b > a**.

Output Format

In each line print total numbers of such prime numbers.