func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 5e3 + 5;   int a[N], n;   int dp[N][N / 2][2][2];   int solve(int idx, int lft, bool b4, bool b44) {     if (lft < 0) return 1e9;     if (idx == n) {       if (lft) return 1e9;       return 0;     }     int &ret = dp[idx][lft][b4][b44];     if (~ret) return ret;     ret = solve(idx + 1, lft, 0, b4);     if (!b4) {       int x;       int cost1 = 0, cost2 = 0;       if (b44) {         x = min(a[idx - 1], a[idx - 2] - 1);       } else         x = a[idx - 1];       if (idx) cost1 = max(0, x - (a[idx] - 1));       if (idx != n - 1) {         cost2 = max(0, a[idx + 1] - (a[idx] - 1));       }       ret = min(ret, solve(idx + 1, lft - 1, 1, 0) + cost1 + cost2);     }     return ret;   }   int main() {     memset(dp, -1, sizeof dp);     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %d , a + i);     for (int i = 1; i <= (n + 1) / 2; i++) {       printf( %d  , solve(0, i, 0, 0));     }     return 0;   }   