#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
const int inf = numeric_limits<int>::max() / 2;
const long double eps = 1e-9;
const long double pi = acos(-1);
const int MAXN = 5e3 + 10;
int n;
int a[MAXN];
int dp[MAXN][MAXN][2];
int price(int i, int x) { return max(a[i] - x, 0); }
inline void solve() {
  if (n == 1) {
    cout << 0 << "\n";
    return;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k <= 1; k++) {
        dp[i][j][k] = inf;
      }
    }
  }
  dp[0][0][0] = 0;
  dp[0][1][1] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= (n + 1) / 2; j++) {
      if (i + 1 < n) {
        (dp[i + 1][j + 1][1]) =
            min((dp[i + 1][j + 1][1]), (dp[i][j][0] + price(i, a[i + 1] - 1)));
        (dp[i + 1][j][0]) = min((dp[i + 1][j][0]), (dp[i][j][0]));
        (dp[i + 1][j][0]) =
            min((dp[i + 1][j][0]), (dp[i][j][1] + price(i + 1, a[i] - 1)));
      }
      if (i + 2 < n) {
        (dp[i + 2][j + 1][1]) =
            min((dp[i + 2][j + 1][1]),
                (dp[i][j][1] + price(i + 1, min(a[i], a[i + 2]) - 1)));
      }
    }
  }
  for (int j = 1; j <= (n + 1) / 2; j++) {
    cout << min(dp[n - 1][j][0], dp[n - 1][j][1]) << "\n";
  }
}
inline void read() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read();
  solve();
  return 0;
}
