Four Distinct Factors

3.6

5 votes
Basic Math, , C++, Math
Problem

Bunty has a favorite number . He calls a number his favorite if it has exactly distinct factors greater than . So Bunty wonders how many favorite numbers are there in the range . Can you help him find that?

Input format

  • The first line contains an integer  denoting the number of test cases.
  • The only line of each test case contains two space-separated integers -  and .

Output format

For each test case, print an integer - the number of favorite numbers in the given range.

Constraints


 

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation
  • In the first test case, the 3 favorite numbers are 6, 8 and 10.
  • In the second test case, the 10 favorite numbers are 10, 14, 15, 21, 22, 26, 27, 33, 34 and 35.

 

Editor Image

?