Professor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his way. 

In total there are *n* piles of boxes, arranged in a line, from left to right, *i*-th pile (1 ≤ *i* ≤ *n*) containing *a*<sub class="lower-index">*i*</sub> boxes. Luckily, *m* students are willing to help GukiZ by removing all the boxes from his way. Students are working simultaneously. At time 0, all students are located left of the first pile. It takes one second for every student to move from this position to the first pile, and after that, every student must start performing sequence of two possible operations, each taking one second to complete. Possible operations are:
1.  If *i* ≠ *n*, move from pile *i* to pile *i* + 1;1.  If pile located at the position of student is not empty, remove one box from it.
GukiZ's students aren't smart at all, so they need you to tell them how to remove boxes before professor comes (he is very impatient man, and doesn't want to wait). They ask you to calculate minumum time *t* in seconds for which they can remove all the boxes from GukiZ's way. Note that students can be positioned in any manner after *t* seconds, but all the boxes must be removed.
The first line contains two integers *n* and *m* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>), the number of piles of boxes and the number of GukiZ's students. 

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ... *a*<sub class="lower-index">*n*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) where *a*<sub class="lower-index">*i*</sub> represents the number of boxes on *i*-th pile. It's guaranteed that at least one pile of is non-empty.
n, m = map(int, input().split())

arr = list(map(int, input().split()))

h = {}

k_count = 0
for i in range(n):
    h[i] = arr[i]
    k_count += arr[i]

def solve():
    if m > k_count:
        return n + 1
    else:
        count = 0

        for i in h:
            count += 1
            if h[i] == 0:
                continue
            if h[i] - m <= 0:
                count += 1
            if count > n:
                break
        return count

print(solve())
