#include <bits/stdc++.h>
using namespace std;
const int N = 5050, oo = 1e9;
int h[N], res[N], dp[N][N][2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
  }
  for (int k = 0; k <= n; k++) {
    res[k] = oo;
    for (int i = 0; i <= n; i++) {
      dp[i][k][0] = (k ? oo : 0);
      dp[i][k][1] = oo;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int k = 1; 2 * k - 1 <= i; k++) {
      dp[i][k][0] = min(dp[i - 1][k][0], dp[i - 1][k][1]);
      dp[i][k][1] = max(0, h[i - 1] - h[i] + 1);
      if (i > 1) {
        dp[i][k][1] += dp[i - 2][k - 1][0];
        int cur = dp[i - 2][k - 1][1] +
                  max(0, min(h[i - 1], h[i - 2] - 1) - h[i] + 1);
        dp[i][k][1] = min(dp[i][k][1], cur);
      }
      dp[i][k][1] += max(0, h[i + 1] - h[i] + 1);
      res[k] = min({res[k], dp[i][k][0], dp[i][k][1]});
    }
  }
  for (int k = 1; 2 * k - 1 <= n; k++) {
    cout << res[k] << (2 * k - 1 == n ? '\n' : ' ');
  }
}
