func_code_string: #include <bits/stdc++.h>   using namespace std;   struct node {     int x, h, id;   } a[100005];   int n, i, j, f[100005], ans[100005];   bool cmp(node x, node y) {     if (x.x != y.x)       return x.x < y.x;     else       return x.h < y.h;   }   int main() {     scanf( %d , &n);     for (i = 1; i <= n; i++) {       scanf( %d%d , &a[i].x, &a[i].h);       a[i].id = i;     }     sort(a + 1, a + n + 1, cmp);     for (i = n; i >= 1; i--) {       f[i] = 1;       for (j = i + 1; j <= n; j += f[j]) {         if (a[i].x + a[i].h - 1 >= a[j].x)           f[i] += f[j];         else           break;       }       ans[a[i].id] = f[i];     }     for (i = 1; i <= n; i++) printf( %d  , ans[i]);     printf(  n );     return 0;   }   