Problem Statement
Given an unsorted array of non-negative integers, find a continuous subarray which adds to a given number S. If found, print the 1-based start and end indices. If multiple exist, print the first one found. If none, print -1.
Example
Input:
5 12 1 2 3 7 5
Output:
2 4
(2+3+7 = 12. Indices 2 to 4)