func_code_string: #include <bits/stdc++.h>   using namespace std;   const int limit = 320;   int v[100000];   int dp[limit][100000];   int n;   static int bruteforce(int p, int k) {     int cnt = 0;     while (p < n) {       cnt++;       p = p + v[p] + k;     }     return cnt;   }   int main() {     cin >> n;     for (int i = 0; i < n; i++) cin >> v[i];     for (int j = 1; j < limit; j++) {       for (int i = n - 1; i >= 0; i--) {         if (i + j + v[i] >= n)           dp[j][i] = 1;         else           dp[j][i] = 1 + dp[j][i + j + v[i]];       }     }     int q;     cin >> q;     for (int i = 0, p, k; i < q; ++i) {       cin >> p >> k;       --p;       if (k < limit)         cout << dp[k][p] <<   n ;       else         cout << bruteforce(p, k) <<   n ;     }   }   