Answer to Question #314893 in Functional Programming for Akash srivastava

Question #314893

Simple Prime (Contest)

Time Limit: 2 sec

Memory Limit: 128000 kB

Problem Statement

Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.

Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].

Input

The first line of the input contains an integer T denoting the number of test cases.

The next T lines contain two integers L and R.


Constraints

1 <= T <= 50000

1 <= L <= R <= 50000

Output

For each test case, print one line corresponding to the required value



0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS