N-divisors
Submissions: 536   Accuracy:

39.35%

  Difficulty: Easy   Marks: 2

Given three integers a, b, n .Your task is to print number of numbers between a and b including them also which have n-divisors. A number is called n-divisor if it has total n divisors including 1 and itself.
Example:
Input  : a = 1, b = 7, n = 2
Output : 4
There are four numbers with 2 divisors in 
range [1, 7]. The numbers are 2, 3, 5, and 7.

Input:
First line consists of T test cases. The only line of every test case consists of a, b, and n.

Output:
Single line output, print the count of numbers between a and b which have n- divisors.

Constraints:

1<= T <=100

1<= a, b <=100000

1<= n <=16

Example:
Input:

1
1 7 2
Output:
4

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.