1012_C. Hills
Welcome to Innopolis city. Throughout the whole year, Innopolis citizens suffer from everlasting city construction. 

From the window in your room, you see the sequence of n hills, where i-th of them has height ai. The Innopolis administration wants to build some houses on the hills. However, for the sake of city appearance, a house can be only built on the hill, which is strictly higher than neighbouring hills (if they are present). For example, if the sequence of heights is 5, 4, 6, 2, then houses could be built on hills with heights 5 and 6 only.

The Innopolis administration has an excavator, that can decrease the height of an arbitrary hill by one in one hour. The excavator can only work on one hill at a time. It is allowed to decrease hills up to zero height, or even to negative values. Increasing height of any hill is impossible. The city administration wants to build k houses, so there must be at least k hills that satisfy the condition above. What is the minimum time required to adjust the hills to achieve the administration's plan?

However, the exact value of k is not yet determined, so could you please calculate answers for all k in range <image>? Here <image> denotes n divided by two, rounded up.

Input

The first line of input contains the only integer n (1 ≤ n ≤ 5000)—the number of the hills in the sequence.

Second line contains n integers ai (1 ≤ ai ≤ 100 000)—the heights of the hills in the sequence.

Output

Print exactly <image> numbers separated by spaces. The i-th printed number should be equal to the minimum number of hours required to level hills so it becomes possible to build i houses.

Examples

Input

5
1 1 1 1 1


Output

1 2 2 


Input

3
1 2 3


Output

0 2 


Input

5
1 2 3 2 2


Output

0 1 3 

Note

In the first example, to get at least one hill suitable for construction, one can decrease the second hill by one in one hour, then the sequence of heights becomes 1, 0, 1, 1, 1 and the first hill becomes suitable for construction.

In the first example, to get at least two or at least three suitable hills, one can decrease the second and the fourth hills, then the sequence of heights becomes 1, 0, 1, 0, 1, and hills 1, 3, 5 become suitable for construction.
```python
''' Hey stalker :) '''
INF = 10**10
def main():
    #print = out.append
    ''' Cook your dish here! '''
    n = get_int()
    li = get_list()
    high = []
    high_li = []
    for i in range(n):
        th = high[:]
        thli = high_li[:]
        for j in range((i)//2 + 1):
            k = 0
            hli = li[i] - 1
            if j>0:
                k = low[j-1] + max(0, -li[i] + low_li[j-1] +1)
            elif i>0:
                k = max(0, li[i-1]-li[i]+1)
            if i+1<n:
                k += max(0, li[i+1] - li[i] + 1)
                hli = min(li[i+1], hli)
            #print(i,j,k,hli)
            if j == (i)//2 and i%2==0:
                high.append(k)
                high_li.append(hli)
            else:
                if k<=high[j]:
                    high[j] = k
                    high_li[j] = hli
                else:
                    high_li[j] = li[i+1] if i+1<n else li[i]-1
        low, low_li = th, thli
        #print(i, high, high_li, low, low_li)
    print(" ".join(map(str, high)))





''' Pythonista fLite 1.1 '''
import sys
#from collections import defaultdict, Counter
#from functools import reduce
#import math
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')



```