func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m;   long long a[100001];   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %I64d , &a[i]);     scanf( %d , &m);     int Left = 1;     for (; m--;) {       int x, y;       scanf( %d%d , &x, &y);       while (Left < x) {         a[Left + 1] = max(a[Left + 1], a[Left]);         ++Left;       }       printf( %I64d n , a[Left]);       a[Left] += y;     }   }   