아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Brick towers

시간 제한2초메모리 제한1024 MB

요약
평균이 정확히 k인 가장 긴 연속 부분 배열을 찾아 길이와 시작 위치(1부터)를 출력한다.
난이도

보통10점 중 6점

유형
누적 합, 해시맵, 수학, 배열
정답자
아직 제출이 없습니다

문제

Young Peter has got a wonderful gift for his birthday --- the whole pack of wooden bricks. He has already made nn towers, with heights a_1a\_1, a_2a\_2, …\ldots, a_na\_n bricks, correspondingly.

Peter's favorite number is kk, so he likes towers with height exactly kk bricks. Peter finds a set of consecutive towers good if their average height is equal to exactly kk bricks. He wants to find a good set of towers containing as many consecutive towers as possible.

Help Peter to find the largest good set of towers.

입력

The first line of input file contains two integer numbers nn and kk (1≤n≤1000001 \le n \le 100000; 1≤k≤1091 \le k \le 10^9). The second line of input file contains nn integer numbers a_ia\_i (1≤a_i≤1091 \le a\_i \le 10^9) --- heights of the towers.

출력

Output two integer numbers ll and mm --- amount of towers in the largest good set and number of the first tower in this set. Towers are numbered from 11 in order of appearance in the input file. If there are multiple answers, output any of them. If there is no good set output single number 00.

예제3

  1. 예제 1

    입력
    3 2
    2 1 3
    
    예상 출력
    3 1
    
  2. 예제 2

    입력
    5 3
    1 2 3 4 6
    
    예상 출력
    3 2
    
  3. 예제 3

    입력
    4 3
    1 2 5 6
    
    예상 출력
    0