#include <bits/stdc++.h>
using namespace std;
int inf = 2000000000;
int n, k, h[5002], dp[5002][5002][2];
int solve(int i, int k, int flag) {
  if (i > n) return (k <= 0 ? 0 : inf);
  if (dp[i][k][flag] != -1) return dp[i][k][flag];
  int custo;
  if (flag == true) {
    custo = max(0LL, h[i + 1] - h[i] + 1LL);
    if (h[i] <= h[i - 2]) {
      int hj = min(h[i - 2] - 1, h[i - 1]);
      custo += max(0LL, hj - h[i] + 1LL);
    }
  } else {
    custo = max(0LL, h[i - 1] - h[i] + 1LL) + max(0LL, h[i + 1] - h[i] + 1LL);
  }
  int nop = solve(i + 1, k, false);
  int build = solve(i + 2, k - 1, true);
  if (h[i] > h[i - 1] and h[i] > h[i + 1]) return dp[i][k][flag] = build;
  return dp[i][k][flag] = min(nop, build + custo);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  h[0] = h[n + 1] = -inf;
  memset(dp, -1, sizeof dp);
  for (int k = 1; k <= (n + 1) / 2; k++) {
    int ans = solve(1, k, true);
    cout << ans << " \n";
  }
}
