func_code_string: #include <bits/stdc++.h>   using namespace std;   void solve() {     long long n, x;     cin >> n;     long long a[n + 1];     for (long long i = 0; i < n; i++) {       cin >> a[i + 1];     }     long long dp[n + 2];     dp[0] = 0;     dp[n + 1] = 0;     for (long long i = 1; i <= n; i++) dp[i] = min(dp[i - 1] + 1, a[i]);     for (long long i = n; i >= 1; i--) dp[i] = min(dp[i + 1] + 1, dp[i]);     long long mx = dp[1];     for (long long i = 2; i <= n; i++) mx = max(mx, dp[i]);     cout << mx;     return;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     ;     long long t;     t = 1;     while (t--) solve();     return 0;   }   