func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 100010;   int n, howMany[N];   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cin >> n;     vector<pair<int, int> > beacons;     for (int i = 0; i < n; i++) {       int x, p;       cin >> x >> p;       beacons.push_back({x, p});     }     sort(beacons.begin(), beacons.end());     howMany[0] = 0;     auto it = beacons.begin();     for (int i = 1; i < n; i++) {       int now = beacons[i].first, power = beacons[i].second;       auto it =           lower_bound(beacons.begin(), beacons.end(), make_pair(now - power, -1));       int idx = it - beacons.begin();       if (idx == 0) {         howMany[i] = i;       } else {         howMany[i] = howMany[idx - 1] + (i - idx);       }     }     int ans = n;     for (int i = 0; i < n; i++) {       ans = min(ans, howMany[i] + (n - i - 1));     }     cout << ans <<   n ;   }   