Three Slices

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

You are given an array A_0A\_{0}, A_1A\_{1}, A_2A\_{2}, ...... , A_N1A\_{N-1} of NN positive integers. Also, you are given an positive integer KK. Your task is to find the largest positive integer MM such that the following condition is satisfied:

  • There exists an integer 0iN3M0 \le i \le N-3M such that

    1. _j=ii+M1A_jK\sum\_{j=i}^{i+M-1}A\_{j} \le K
    2. _j=i+Mi+2M1A_jK\sum\_{j=i+M}^{i+2M-1}A\_{j} \le K
    3. _j=i+2Mi+3M1A_jK\sum\_{j=i+2M}^{i+3M-1}A\_{j} \le K

입력

The first line contains two integers, NN and KK. The second line contains NN integers, the array AA given in order.

출력

Output a single positive integer denoting the largest possible MM. If there is no such MM, output 00.

제한

  • 1N5×1051 \le N \le 5 \times 10^{5}
  • 1K1091 \le K \le 10^{9}
  • 1A_i1091 \le A\_{i} \le 10^{9}