Four Distinct Factors
Practice
3.6 (5 votes)
Basic math
C++
Math
Problem
90% Success 2247 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Bunty has a favorite number \(4\). He calls a number his favorite if it has exactly \(4\) distinct factors greater than \(0\). So Bunty wonders how many favorite numbers are there in the range \([l, r]\). Can you help him find that?

Input format

  • The first line contains an integer \(T\) denoting the number of test cases.
  • The only line of each test case contains two space-separated integers - \(l\) and \(r\).

Output format

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

Constraints

\(1 ≤ T ≤ 10^5\)
\(1 ≤ l ≤ r ≤ 10^6\)

 

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
1 votes
Tags:
Medium
Points:30
Tags:
Medium
Points:30
1 votes
Tags:
Medium