#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
const int INF = 1e9;
int dp[N][N][2];
int h[N];
int n;
int solve(int idx, int k, int flag) {
  if (k <= 0) return 0;
  if (idx >= n + 1) return INF;
  int &ret = dp[idx][k][flag];
  if (~ret) return ret;
  ret = INF;
  if (flag) {
    ret = min(ret, solve(idx + 1, k, 0));
    ret = min(ret, solve(idx + 1 +
                             (h[idx] > min(h[idx - 2] - 1, h[idx - 1]) &&
                              h[idx] > h[idx + 1]),
                         k - (h[idx] > min(h[idx - 2] - 1, h[idx - 1]) &&
                              h[idx] > h[idx + 1]),
                         0));
    int bfr = min(h[idx - 2] - 1, h[idx - 1]);
    int cb = bfr >= h[idx] ? bfr - h[idx] + 1 : 0;
    int aft = h[idx + 1];
    int ca = aft >= h[idx] ? aft - h[idx] + 1 : 0;
    ret = min(ret, solve(idx + 2, k - 1, 1) + ca + cb);
  } else {
    ret = min(ret, solve(idx + 1, k, 0));
    ret = min(ret, solve(idx + 1 + (h[idx] > h[idx - 1] && h[idx] > h[idx + 1]),
                         k - (h[idx] > h[idx - 1] && h[idx] > h[idx + 1]), 0));
    int bfr = h[idx - 1];
    int cb = bfr >= h[idx] ? bfr - h[idx] + 1 : 0;
    int aft = h[idx + 1];
    int ca = aft >= h[idx] ? aft - h[idx] + 1 : 0;
    ret = min(ret, solve(idx + 2, k - 1, 1) + ca + cb);
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  h[0] = -INF;
  h[n + 1] = -INF;
  for (int i = int(1); i <= int(n); i++) scanf("%d", &h[i]);
  memset(dp, -1, sizeof dp);
  int K = (n + 1) / 2;
  for (int i = int(1); i <= int(K); i++) {
    printf("%d ", solve(1, i, 0));
  }
  return 0;
}
