Partial Average

0

0 votes
Problem

Test-1 is just over. Your instructor has given you the marks of students roll number wise and has asked you to find the average marks in the class.

You being a dishonest person decide to alter the average. What you can do is select a group of students whose marks have the average, which you want. Also, you can only select students whose roll numbers are consecutive.


INPUT
The first line contains a single integer N and X. N is the number of students registered in the course. X is the desired mean.
The third line contains exactly N integers (A1 to An), the marks of students arranged roll number-wise from 1 to N

OUTPUT
-1 if it is not possible.
M N, if the mean, X is possible
M is the starting roll number and N is ending roll number
You have to include maximum number of students possible in your answer.
Also in case of multiple answers, print the answer, where M and N are maximum.

CONSTRAINTS
1 <= N <= 10000
1 <= X <= 10^9
0<= A1,...,An <= 10^9

Sample Test Case #1
Input
5 6
3 7 2 9 9
Output
2 4
Explanation: Mean of 7, 2, 9 = 6

Sample Test Case #2
Input
6 19
6 18 20 20 37 1
Output
4 5
Explanation: Mean of roll numbers 2 and 3 = 19 (18 and 1)
Mean of roll numbers 4 and 5 = 19 (37 and 1)
Select the largest value of M and N

Sample Test Case #3
Input
5 6
3 7 9 9 7
Output
-1
Explanation: You cannot have 6 as your mean for any consecutive numbers.

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?