- All Contests
- ProjectEuler+
- Project Euler #50: Consecutive prime sum

# Project Euler #50: Consecutive prime sum

# Project Euler #50: Consecutive prime sum

_{This problem is a programming version of Problem 50 from projecteuler.net}

The prime , can be written as the sum of six consecutive primes:

This is the longest sum of consecutive primes that adds to a prime below one-hundred.

The longest sum of consecutive primes below one-thousand that adds to a prime, contains terms, and is equal to .

Which prime, , can be written as the sum of the most consecutive primes?

**Note:** You have to print prime as well as the length of consecutive chain whose sum is prime. If such primes are more than 1, print the least.

**Input Format**

The first line contains an integer , i.e., number of test cases.

Next lines will contain an integer .

**Constraints**

**Output Format**

Print the values corresponding to each test case in a new line.

**Sample Input**

```
2
100
1000
```

**Sample Output**

```
41 6
953 21
```