Bob needs to do a lot of practice with prime numbers for homework. Being a curious student, he will ask you questions. Each of these questions will be of the form: what is the sum of all prime numbers between and (inclusive)?
Input Specification
The first line contains a single integer:
Each of the next lines contains two space-separated integers: ,
Output Specification
Output the answer to each question on a separate line.
Constraints
Subtasks
Subtask 1 [20%]
Subtask 2 [80%]
No additional constraints.
Sample Input
3
1 2
5 11
3 19
Sample Output
2
23
75
Comments
true but pointless...
is it possible not to TLE on C# for this question
Use sieve of eratosthenes.
why am i getting array index out of bounds exception?
Possible overflow on line 25
It is because your array index is out of bounds.
very true actually orz