func_code_string: #include <bits/stdc++.h>   using namespace std;   int const N = 3e5 + 5;   int const NN = 20;   int const MAX = 1e9 + 1;   int n, a[N];   struct ITMAX {     pair<int, int> tree[4 * N];     pair<int, int> get_interval(pair<int, int> p, pair<int, int> q) {       return make_pair(min(p.first, q.first), max(p.second, q.second));     }     void build(int node, int l, int r, pair<int, int> val[]) {       if (l == r) {         tree[node] = val[l];         return;       }       int mid = (l + r) / 2;       build(node * 2, l, mid, val);       build(node * 2 + 1, mid + 1, r, val);       tree[node] = get_interval(tree[node * 2], tree[node * 2 + 1]);     }     pair<int, int> get_max(int node, int l, int r, int d, int c) {       if (l > c || r < d) {         return make_pair(MAX, -MAX);       }       if (d <= l && r <= c) {         return tree[node];       }       int mid = (l + r) / 2;       return get_interval(get_max(node * 2, l, mid, d, c),                           get_max(node * 2 + 1, mid + 1, r, d, c));     }   };   ITMAX tree[NN];   pair<int, int> dp[NN][N];   void solve_nxt() {     for (int i = 1; i <= n; i++) {       dp[0][i] = make_pair(max(i - a[i], 1), min(i + a[i], n));     }     tree[0].build(1, 1, n, dp[0]);     for (int j = 1; j < NN; j++) {       for (int i = 1; i <= n; i++) {         dp[j][i] =             tree[j - 1].get_max(1, 1, n, dp[j - 1][i].first, dp[j - 1][i].second);       }       tree[j].build(1, 1, n, dp[j]);     }   }   int main() {     ios_base::sync_with_stdio(0);     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i];       a[i + n] = a[i];       a[i + n + n] = a[i];     }     if (n == 1) {       cout << 0 << endl;       return 0;     }     n *= 3;     solve_nxt();     int sq = n / 3;     for (int i = sq + 1; i <= sq + sq; i++) {       int l = i;       int r = i;       int ans = 0;       for (int j = NN - 1; j >= 0; j--) {         pair<int, int> interval = tree[j].get_max(1, 1, n, l, r);         int newL = interval.first;         int newR = interval.second;         if (newR - newL + 1 < sq) {           l = newL;           r = newR;           ans += (1 << j);         }       }       cout << ans + 1 <<    ;     }     cout << endl;   }   