BETA

Difficulty Level: Basic

Submissions: 7923 Accuracy:

11.67%

Sum of all prime numbers between 1 and N.
     

Given a positive integer N, calculate the sum of all prime numbers between 1 and N.

Input:
The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N.

Output:
Print the sum of all prime numbers between 1 and N.

Constraints:
1 ≤ T ≤ 50
1 ≤ N ≤ 1000000

Example:
Input:
2
5
10

Output:
10
17

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

Author: Shubham Joshi 1

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.