Amagi Brilliant Contests runs a business making and hosting contests on its online platform for competitive programmers who want to run their own contests.
Making a problem for a contest is a multi-step process. One of the steps involves having someone other than the problem writer independently solve the problem to make sure the author's test data and solution are correct.
One problem that has not yet been tested is as follows:
You are given three numbers , , and . How many numbers between and , inclusive, have exactly factors?
To refresh your memory, a factor of a number is a number such that and the remainder of the division is .
For this particular problem, there are a lot of cases the problem writer wants to test. Therefore, the problem tester will have to solve the aforementioned problem times.
You are the head of the number theory department at Amagi Brilliant Contests, and so you have been tasked with testing out this problem.
There will be a number of subtasks for this problem:
|Test Case Batch||Points (%)|
The first line of input will have , the number of instances of the problem you need to solve.
Each of the next lines will contain three integers each separated from one another by a single space, , , and .
There should be lines of output. Each line should be a single integer, the answer to the problem with the given input.
3 1 1 30 2 1 30 3 1 30
1 10 3
Explanation for Sample Output
For the first case, the only number that has factor is .
For the second case, the numbers that have factors are , , , , , , , , , and .
For the third case, the numbers that have factors are , , and .
For users using the Python language, it is advised to use fast input/output methods such as those described on the tips page.