Modified Numbers and Queries
Submissions: 292   Accuracy:

10.57%

  Difficulty: Easy   Marks: 2

Atul has stolen your favourite candies and he will only return it to your if you answer is queries. He ask you Q queries. Each of his query is to find the sum of all the numbers between the range L and R. As Atul doesnot like things to be simple, he represents each number by the sum of its prime factors. 

Note : 1 is represented as 1.

Input:

The line contains an integer Q, denoting number of queries. The next Q line contains two integer L and R each.

Output:

For each of the queries print sum all the numbers ( as represented by Atul ) in the given range both L and R included.

Constraints:

1<=Q<=10^6

1<=L<=R<=10^6
Example:

Input:
2
1 2

Output:

3

 

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

Author: ShivamKD


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.