func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int n;     cin >> n;     if (n == 1) {       cout << 0;       return 0;     }     int arr[n + 1];     for (int i = 0; i < n; i++) {       cin >> arr[i];     }     arr[n] = 0;     int cl = (n - 1) / 2 + 1;     int dp[n + 3][cl + 1], mn[n + 3][cl + 1];     for (int j = 0; j <= cl; j++)       for (int i = 0; i <= n; i++) dp[i][j] = mn[i][j] = 1000000007;     dp[0][0] = 0;     mn[0][0] = 0;     dp[1][1] = 0;     mn[1][1] = max(0, arr[1] + 1 - arr[0]);     dp[2][1] = max(0, arr[0] + 1 - arr[1]);     mn[2][1] = min(mn[1][1], dp[2][1] + max(0, arr[2] + 1 - arr[1]));     for (int i = 3; i <= n; i++) {       dp[i][1] = max(0, -arr[i - 1] + 1 + arr[i - 2]);       mn[i][1] = min(mn[i - 1][1], dp[i][1] + max(0, arr[i] + 1 - arr[i - 1]));     }     for (int i = 0; i <= n; i++) {       for (int j = 1; j <= (i - 1) / 2 + 1; j++) {         if (i > 2 && j > 1) {           dp[i][j] = dp[i - 2][j - 1] + arr[i - 2] -                      min(arr[i - 2], min(arr[i - 3], arr[i - 1]) - 1);           int curr = max(0, arr[i - 2] + 1 - arr[i - 1]);           dp[i][j] = min(dp[i][j], curr + mn[i - 3][j - 1]);           mn[i][j] =               min(mn[i - 1][j], dp[i][j] + max(0, arr[i] + 1 - arr[i - 1]));         }       }     }     for (int i = 1; i <= n; i++) {       for (int j = 0; j <= cl; j++) {         dp[i][j] = min(dp[i][j], mn[i - 1][j]);       }     }     for (int i = 1; i <= cl; i++) {       cout << dp[n][i] <<    ;     }     return 0;   }   