func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     int n;     cin >> n;     vector<long long> sc(n);     for (typeof(n) i = (0); i < (n); i++) cin >> sc[i];     int m;     cin >> m;     for (typeof(m) i = (0); i < (m); i++) {       long long w, h;       cin >> w >> h;       long long b = max(sc[0], sc[w - 1]);       sc[0] = max(sc[0], b + h);       cout << b << endl;     }   }   