#include <bits/stdc++.h>
using namespace std;
long double inf = 1e20;
struct line {
  int i;
  double k, b, x;
  line(int i = 0, long double k = 0, long double b = 0, long double x = -inf) {
    this->i = i;
    this->k = k;
    this->b = b;
    this->x = x;
  }
};
int n, m, q, l, r, sz = 1;
vector<double> k, b;
long double t;
void add_line(int i_, long double k, long double b, vector<line> &v) {
  line l(i_, k, b);
  while (true) {
    if (v.size() == 0) {
      v.push_back(l);
      return;
    }
    line p = v.back();
    if (l.k == p.k) {
      if (l.b >= p.b) return;
      v.pop_back();
    } else {
      long double x = (l.b - p.b) / (p.k - l.k);
      if (x <= p.x)
        v.pop_back();
      else {
        l.x = x;
        v.push_back(l);
        return;
      }
    }
  }
}
int get_ind(long double x, vector<line> &v) {
  int l = 0;
  int r = v.size() - 1;
  if (v[r].x <= x) return v[r].i;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (v[mid].x <= x)
      l = mid;
    else
      r = mid;
  }
  return v[l].i;
}
vector<vector<line>> trl;
vector<vector<tuple<long long, long long, int>>> tr;
vector<long long> a;
vector<long long> d;
void bild() {
  while (n > sz) sz *= 2;
  tr.resize(sz * 2);
  trl.resize(sz * 2);
  for (int i = 0; i < n; i++) {
    tr[sz + i].push_back(make_tuple(-a[i], -d[i], i));
  }
  for (int i = sz - 1; i > 0; i--) {
    tr[i].resize(tr[i * 2].size() + tr[i * 2 + 1].size());
    merge((tr[i * 2]).begin(), (tr[i * 2]).end(), (tr[i * 2 + 1]).begin(),
          (tr[i * 2 + 1]).end(), tr[i].begin());
  }
  for (int i = 1; i < sz * 2; i++) {
    reverse((tr[i]).begin(), (tr[i]).end());
    for (int j = 0; j < tr[i].size(); j++) {
      add_line(get<2>(tr[i][j]), get<0>(tr[i][j]), get<1>(tr[i][j]), trl[i]);
    }
  }
}
pair<long long, int> getMax(int l, int r, long long x, int tl = 0,
                            int tr = sz - 1, int v = 1) {
  if (l > tr || r < tl) {
    return make_pair(0, 0);
  }
  if (tl >= l && tr <= r) {
    int id = get_ind(x, trl[v]);
    return make_pair(a[id] * x + d[id], id);
  } else {
    int mid = (tl + tr) / 2;
    return max(getMax(l, r, x, tl, mid, v * 2),
               getMax(l, r, x, mid + 1, tr, v * 2 + 1));
  }
}
int main() {
  int q, l, r, x;
  cin >> n >> q;
  a.resize(n);
  d.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> d[i] >> a[i];
  }
  bild();
  for (int i = 0; i < q; i++) {
    cin >> l >> r >> x;
    l--;
    r--;
    cout << getMax(l, r, x).second + 1 << endl;
  }
}
