954_G. Castle Defense
Today you are going to lead a group of elven archers to defend the castle that is attacked by an army of angry orcs. Three sides of the castle are protected by impassable mountains and the remaining side is occupied by a long wall that is split into n sections. At this moment there are exactly ai archers located at the i-th section of this wall. You know that archer who stands at section i can shoot orcs that attack section located at distance not exceeding r, that is all such sections j that |i - j| ≤ r. In particular, r = 0 means that archers are only capable of shooting at orcs who attack section i.

Denote as defense level of section i the total number of archers who can shoot at the orcs attacking this section. Reliability of the defense plan is the minimum value of defense level of individual wall section.

There is a little time left till the attack so you can't redistribute archers that are already located at the wall. However, there is a reserve of k archers that you can distribute among wall sections in arbitrary way. You would like to achieve maximum possible reliability of the defence plan.

Input

The first line of the input contains three integers n, r and k (1 ≤ n ≤ 500 000, 0 ≤ r ≤ n, 0 ≤ k ≤ 1018) — the number of sections of the wall, the maximum distance to other section archers can still shoot and the number of archers yet to be distributed along the wall. The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109) — the current number of archers at each section.

Output

Print one integer — the maximum possible value of defense plan reliability, i.e. the maximum possible value of minimum defense level if we distribute k additional archers optimally.

Examples

Input

5 0 6
5 4 3 4 9


Output

5


Input

4 2 0
1 2 3 4


Output

6


Input

5 1 1
2 1 2 1 2


Output

3
```python
import sys

border = 1 << 30


def build(x=0):
    res = [0, 0]

    i = 0
    while x and i < 30:
        if x & 1:
            res[1] += (1 << i)
        x >>= 1
        i += 1

    i = 0
    while x:
        if x & 1:
            res[0] += (1 << i)
        x >>= 1
        i += 1

    return res


n, r, k = map(int, sys.stdin.buffer.readline().decode('utf-8').split())
a = list(map(int, sys.stdin.buffer.readline().decode('utf-8').split()))

k_big, k_small = build(k)
left = build(sum(a[:r]))
minus_big, minus_small = [0]*n, [0]*n
w = 2*r+1


def solve(level_big, level_small):
    used_big = used_small = 0
    acc_big, acc_small = left

    for i in range(n):
        if minus_small[i] or minus_big[i]:
            acc_big -= minus_big[i]
            acc_small -= minus_small[i]
            if acc_small < 0:
                acc_small += border
                acc_big -= 1
            elif acc_small >= border:
                acc_small -= border
                acc_big += 1

            minus_big[i] = minus_small[i] = 0

        acc_small += (a[i+r] if i+r < n else 0) - (a[i-r-1] if i-r >= 1 else 0)
        if acc_small >= border:
            acc_small -= border
            acc_big += 1
        elif acc_small < 0:
            acc_small += border
            acc_big -= 1

        if acc_big < level_big or acc_big == level_big and acc_small < level_small:
            used_big += level_big - acc_big
            used_small += level_small - acc_small
            if used_small >= border:
                used_small -= border
                used_big += 1
            elif used_small < 0:
                used_small += border
                used_big -= 1

            if used_big > k_big or used_big == k_big and used_small > k_small:
                break
            if i+w < n:
                minus_big[i+w] = level_big - acc_big
                minus_small[i+w] = level_small - acc_small

            acc_big = level_big
            acc_small = level_small

    for i in range(i+1, n):
        if minus_small[i] or minus_big[i]:
            minus_small[i] = minus_big[i] = 0

    return used_big < k_big or used_big == k_big and used_small <= k_small


ok, ng = min(a), k + sum(a) + 1
while abs(ok - ng) > 1:
    mid = (ok + ng) >> 1
    if solve(*build(mid)):
        ok = mid
    else:
        ng = mid

print(ok)

```