Problem: A set of positive integers is called beautiful if, for every two integers and from this set, either divides or divides (or both).
You are given two integers and . Consider all beautiful sets consisting of integers not less than and not greater than . You have to print two numbers:
- the maximum possible size of a beautiful set where all elements are from to ;
- the number of beautiful sets consisting of integers from to with the maximum possible size.
Since the second number can be very large, print it modulo .
Input Format: The first line contains one integer () — the number of test cases.
Each test case consists of one line containing two integers and ().
Output Format: For each test case, print two integers — the maximum possible size of a beautiful set consisting of integers from to , and the number of such sets with maximum possible size. Since the second number can be very large, print it modulo .
Note: In the first test case, the maximum possible size of a beautiful set with integers from to is . There are such sets which have the maximum possible size:
- ;
- ;
- ;
- .