func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAX_N = 1e5 + 23;   const int INF = 1e9 + 23;   const int MOD = 1e9 + 7;   struct Mada {     long long x, h, p;   };   Mada mada[MAX_N];   stack<Mada> Dane;   int dp[MAX_N];   int n;   bool cmp(Mada a, Mada b) { return a.x < b.x; }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> mada[i].x >> mada[i].h;       mada[i].p = i;     }     sort(mada + 1, mada + 1 + n, cmp);     dp[mada[n].p] = 1;     Dane.push(mada[n]);     for (int i = n - 1; i >= 1; i--) {       long long res = 0;       while (!Dane.empty()) {         if (Dane.top().x > mada[i].h + mada[i].x - 1) {           break;         }         res += dp[Dane.top().p];         Dane.pop();       }       dp[mada[i].p] = res + 1;       Dane.push(mada[i]);     }     for (int i = 1; i <= n; i++) {       cout << dp[i] <<    ;     }     cout <<   n ;     return 0;   }   