Houses on the Han River

Count the integers below N that have as many divisors as N and whose smallest prime factor is at least M.

Hard8Number theoryCombinatoricsNo attempts yetTime limit5sMemory limit512 MB

Problem

In 2011 the Ministry of the Interior and Safety started a new address system that numbers buildings along each road. Decades later, building houses on the water along the Han River became popular. The houses stand in one line. The picture below shows only their address numbers.

north bank
---------------------------------------------------------------
(downstream)  2  3  4  5  6  7  8  9  10  11  12  13  ...  N  (upstream)
---------------------------------------------------------------
south bank

Addresses start at 2. Going upstream, the following houses take 3, 4, 5 and so on, and the last house is number NN. There is no house number 1.

These houses keep an unusual custom. If one address number is a multiple of another address number, the two houses are brothers: the larger number is the older brother and the smaller number is the younger brother. House 6 is the older brother of house 2 and house 3, and houses 2 and 3 are younger brothers of house 6. The younger brother with the smallest number is the youngest child, so the youngest child of house 6 is house 2.

Two houses with the same number of younger brothers are sisters. House 6 has houses 2 and 3 as younger brothers, and house 8 has houses 2 and 4 as younger brothers, so the two houses are sisters. The larger number, house 8, is the older sister, and the smaller number, house 6, is the younger sister.

House NN is where an old programmer lives. Long ago he put the new address system into an internet map service. He decided to send a gift box to every house that is a younger sister of his own house, to thank them for the sisterhood. If such a house has at least one younger brother and the address number of its youngest child is MM or more, he also puts one special gift into that box.

How many special gifts does the programmer have to prepare?

Input

The first line has the number of test cases TT. Each of the next TT lines holds one test case with two natural numbers NN and MM separated by a space.

N M

NN is the address number of the house whose special gifts are counted, and MM is the lower bound that the address number of the youngest child has to meet.

Constraints

  • 1T1001 \le T \le 100
  • 2MN10122 \le M \le N \le 10^{12}
  • NM×106N \le M \times 10^{6}

Output

For each test case print one line in the form Case #x: y, where xx is the test case number starting at 1 and yy is the number of special gifts needed for that case.