Need help in this Number Theory Problem

Revision en3, by UnlLucky_Girl, 2020-03-12 07:09:14

Give me idea for the following problem.

The positive divisor function is defined as a function that counts the number of positive divisors of an integer N, including 1 and N. If we define the positive divisor function as D(N), then, for example: D(24) = 8 (Because 24 has 8 divisors and they are 1, 2, 3, 4, 6, 8, 12, 24) Calculating D(N) is a classical problem and there are many efficient algorithms for that. But what if you are asked to find something different? Given a range and an integer K, can you find out for how many N in the given range, D(N) equals K?

Input:

In the very first line, you’ll have an integer called T. This is the number of test cases that shall follow. Every test case contains three integers, L, R, and K. L and R represent the range and are inclusive.

Constraints:

● 1 ≤ T < 31

● 1 ≤ L ≤ R < 2^31

● 1 ≤ K < 2^31

Output:

For every test case, you must print the case number, followed by the count of numbers with exactly K divisors in the range.

Tags #number theory, divisor function

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English UnlLucky_Girl 2020-03-12 07:09:14 6
en2 English UnlLucky_Girl 2020-03-12 07:08:16 16
en1 English UnlLucky_Girl 2020-03-12 07:06:37 1037 Initial revision (published)