Game of Numbers
Practice
3.9 (8 votes)
Mathematics
Medium
Problem
46% Success 6617 Attempts 30 Points 3s Time Limit 256MB Memory 1024 KB Max Code

Game of numbers is a game where you are given two integers (X and Y), and you have to print the number of special numbers between X and Y both inclusive.
The property of a special numbers is as follows:
A special number is not divisible by any number of the form ZZ* where (\(Z\; >\; 1\)).

Input:
T, the number of test cases. Each test case consists of two space separated integers denoting X and Y.

Output: The required answer in one line for each test case.

Constraints:
\(1 \le T \le 10\)
\(1 \le X,Y \le 10 ^ 9\)
\(0 \le |X-Y| \le 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
Tags:
MathematicsMediumApprovedFactorization
Points:30
1 votes
Tags:
mathsprime factorizationsieveMedium
Points:30
2 votes
Tags:
MediumPrime FactorizationMathematicsOpenApprovedFactorization