Hide

Problem B
Beautiful Subarrays

The Great Lord Pooty has an array of numbers A and a special number K. A is 0-indexed, i.e. the first element has index 0, the second has index 1, and so on. By decree, he defined the beauty of a subarray as the sum of its value minus K multiplied by its length. Formally, for some integers 0LRN1, if we have the subarray A[LR], we define Beauty(L,R)=LR(Ai)(RL+1)×K.

Today, he wants to find a subarray with some beauty B. As such it falls to you, his humble servant, to find such a subarray if it exists, or face his eternal wrath.

Input

The first line contains three integers, N(1N200000), K(0K200000) and B(1013B1013). The second line prints the 0-based indexed array A which is given by N integers (200000Ai200000).

Output

If such a subarray exists, print L and R, the leftmost and rightmost index of the subarray, else print 1. If multiple subarray exist, print the smallest (L,R) lexicographically. This means that we break ties by smallest L, followed by smallest R.

Subtasks

  1. (25 Points): N200.

  2. (15 Points): N3000,K=0

  3. (10 Points): N3000

  4. (10 Points): K=0 and for all 0iN1, 0Ai

  5. (10 Points): For all 0iN1, KAi

  6. (10 Points): K=0

  7. (20 Points): No additional constraint.

Explanation

In the first sample, either (0,1), (1,2), and (2,3) are possible subarrays with beauty B=5 (as K=0). We print the lexicographically smallest subarray: (0,1).

In the second sample, (1,3) is the only possible subarray with beauty B=5 as A1+A2+A3(31+1)×K=3+2+3(31+1)×1=83=5.

In the third sample, there is no such a subarray, so we print 1.

Warning

The I/O files are large. Please use fast I/O methods.

Sample Input 1 Sample Output 1
4 0 5
3 2 3 2
0 1
Sample Input 2 Sample Output 2
4 1 5
2 3 2 3
1 3
Sample Input 3 Sample Output 3
1 3 9
13
-1
Hide

Please log in to submit a solution to this problem

Log in