SP17125 TBATTLE - Thor vs Frost Giants
Description
Thor is caught up in a fierce battle with Loki's army. This army consists of frost giants that have magical powers with them. Their strength levels gets multiplied when they are together. Giants are not highly skilled in the arts of combat, but their sheer size and strength make them formidable opponents even for the Asgardian gods. Thor is no exception. They recover very fast from physical injury but their recovery slows down when they are exposed to extreme heat.
Thor's hammer can generate heat only in multiples of heat quantum **N**. Frost giants get killed only when their combined strength level is exactly equal to the heat level of the hammer. Thor is interested in killing a continuous stretch of frost enemies with a throw of his hammer with a preference to kill closer enemies first.
**Continuous stretch** is defined as a set of consecutive elements.
Help Thor to determine the minimum stretch of frost giants that could be killed in a throw. In case of multiple minimal stretches, output the indices of that stretch that has lowest starting index. If there is no such continuous stretch possible then print -1.
Input Format
The first line will contain **N**, the number of Frost Giants in Loki's army and the Heat quantum.
The second line will contain **N** integers **(a\_0, a\_2....., a\_n-1)** - the strength of each frost giant.
Minimum stretch of the army should be 1.
- **1** N 100000
- **1** a\_i 100000
Output Format
Output the range of the minimum stretch of frost giants that could be killed in a throw. In case of multiple minimal stretches, output the indices of that stretch that has lowest starting index.
If there is no such continuous stretch possible then print -1.