Feb
13
Project Euler+ #8
Hey guys,
Hope you all are doing great. I am back with another problem of Project Euler on
Project Euler #8: Largest product in a series
Find the greatest product of KK consecutive digits in the NN digit number.
Input Format
First line contains TT that denotes the number of test cases.
First line of each test case will contain two integers NN & KK.
Second line of each test case will contain a NN digit integer.
Output Format
Print the required answer for each test case.
Constraints
1≤T≤1001≤T≤100
1≤K≤71≤K≤7
K≤N≤1000K≤N≤1000
Sample Input
2 10 5 3675356291 10 5 2709360626 Sample Output
3150 0
Algorithm:
As easy can it get, this is a simple problem to directly multiply the sequence of number.
Hope you all are doing great. I am back with another problem of Project Euler on
Project Euler #8: Largest product in a series
Find the greatest product of KK consecutive digits in the NN digit number.
Input Format
First line contains TT that denotes the number of test cases.
First line of each test case will contain two integers NN & KK.
Second line of each test case will contain a NN digit integer.
Output Format
Print the required answer for each test case.
Constraints
1≤T≤1001≤T≤100
1≤K≤71≤K≤7
K≤N≤1000K≤N≤1000
Sample Input
2 10 5 3675356291 10 5 2709360626 Sample Output
3150 0
Algorithm:
As easy can it get, this is a simple problem to directly multiply the sequence of number.