func_code_string: #include <bits/stdc++.h>   using namespace std;   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   int dx[] = {0, 0, 1, -1};   int dy[] = {1, -1, 0, 0};   int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};   int dy8[] = {1, -1, -1, 0, 1, -1, 0, 1};   int kx8[] = {1, 1, 2, 2, -1, -1, -2, -2};   int ky8[] = {2, -2, 1, -1, 2, -2, 1, -1};   const int M = 100005;   vector<int> Slope[M * 4], C[M * 4], idx[M * 4];   long long get(int n, long long id, long long x) {     return (Slope[n][id] * x + C[n][id]);   }   double cross(int n, int x, int y) {     return (double)(C[n][x] - C[n][y]) / (Slope[n][y] - Slope[n][x]);   }   void AddLine(int n, int id, long long p, long long q) {     if (Slope[n].size() > 0 && Slope[n].back() == p) {       if (C[n].back() < q) {         Slope[n].pop_back();         C[n].pop_back();         idx[n].pop_back();       } else         return;     }     Slope[n].push_back(p);     C[n].push_back(q);     idx[n].push_back(id);     int hsz = Slope[n].size();     while (hsz >= 3 && cross(n, hsz - 3, hsz - 2) > cross(n, hsz - 3, hsz - 1)) {       --hsz;       Slope[n][hsz - 1] = Slope[n][hsz];       C[n][hsz - 1] = C[n][hsz];       idx[n][hsz - 1] = idx[n][hsz];       Slope[n].pop_back();       C[n].pop_back();       idx[n].pop_back();     }   }   pair<long long, long long> query(int n, long long x) {     long long hsz = (int)Slope[n].size() - 1;     long long lw = 0, hi = hsz, mid, midd;     pair<long long, long long> ans = {-9e18, 0};     while (hi - lw > 3) {       mid = (lw + hi) / 2;       midd = min(hsz, mid + 1);       if (get(n, mid, x) >= get(n, midd, x)) {         hi = mid;       } else {         lw = midd;       }     }     for (long long i = lw; i <= hi; i++)       ans = max(ans, {get(n, i, x), idx[n][i]});     return ans;   }   void update(int l, int r, int k, int L, pair<long long, long long> p) {     if (l > L || r < L) return;     AddLine(k, L, p.first, p.second);     if (l == r) return;     int mid = (l + r) / 2;     update(l, mid, k * 2, L, p);     update(mid + 1, r, k * 2 + 1, L, p);   }   pair<long long, long long> query(int l, int r, int k, int L, int R,                                    long long val) {     if (l > R || r < L) return {-9e18, 0};     if (l >= L && r <= R) {       return query(k, val);     }     int mid = (l + r) / 2;     pair<long long, long long> ret = {-9e18, 0};     ret = max(ret, query(l, mid, k * 2, L, R, val));     ret = max(ret, query(mid + 1, r, k * 2 + 1, L, R, val));     return ret;   }   vector<pair<pair<long long, long long>, long long> > vec;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, m;     cin >> n >> m;     for (int i = 1; i <= n; i++) {       int x, y;       cin >> x >> y;       vec.push_back({{y, x}, i});     }     sort(vec.begin(), vec.end());     for (auto z : vec) {       int id = z.second;       update(1, n, 1, id, z.first);     }     for (int i = 1; i <= m; i++) {       int l, r, x;       cin >> l >> r >> x;       cout << query(1, n, 1, l, r, x).second <<   n ;     }     return 0;   }   