SP12241 HS12PRIM - Classification from Erdős and Selfridge

Description

Erdős Pál and John Selfridge classified prime numbers in this way: for a prime **p**, if the largest prime factor of **p-1** is **2** or **3**, then **p** is in class one. Otherwise, **p** is in class **c+1** where **c** is the largest of the classes of the prime factors of **p-1**. We put **p=2** in class one. For example, **p=89** is in class three, because **p-1=2^3\*11** and here **2** is in class one, but **11** is in class two (because **11-1=2\*5** and here **2** and **5** are in class one). Your task is to count the number of primes in each class up to class thirteen for a given (closed) interval.

Input Format

The first line contains the number of test cases _T_, where _T. Each of the following _T_ lines contains two integers **a,b** where 0. There are 4 input sets for 10 points._

Output Format

Output the case number, followed by the distribution of the primes in each class up to class **13** in the (closed) interval _\[a,b\]_. See the sample input/output for the correct format!