We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

Loading...

- All Contests
- ProjectEuler+
- Project Euler #8: Largest product in a series

# Project Euler #8: Largest product in a series

# Project Euler #8: Largest product in a series

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

Find the greatest product of consecutive digits in the digit number.

**Input Format**

First line contains that denotes the number of test cases.

First line of each test case will contain two integers & .

Second line of each test case will contain a digit integer.

**Constraints**

**Output Format**

Print the required answer for each test case.

**Sample Input 0**

```
2
10 5
3675356291
10 5
2709360626
```

**Sample Output 0**

```
3150
0
```

**Explanation 0**

- For and selecting consequetive digits, we have , , , , and . Where gives maximum product as
- For , lies in all selection of consequetive digits hence maximum product remains