#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 1;
int len;
struct line {
  long long k, b;
  int idn;
  line(){};
  line(long long _k, long long _b, int _idn) {
    k = _k;
    b = _b;
    idn = _idn;
  }
};
bool operator<(line a, line b) {
  return (a.k < b.k) || (a.k == b.k && a.b < b.b);
}
struct Convex_Hull {
  vector<pair<long double, line> > ch;
  vector<line> b;
  Convex_Hull(){};
};
vector<Convex_Hull> tree;
long double Intersetion(line a, line b) {
  return (b.b - a.b + 0.0) / (a.k - b.k);
}
void Build(vector<line> &a, vector<pair<long double, line> > &ch) {
  for (int i = 0; i < a.size(); i++) {
    while (!ch.empty() &&
           Intersetion(a[i], ch.back().second) <= ch.back().first)
      ch.pop_back();
    if (!ch.empty())
      ch.push_back(make_pair(Intersetion(a[i], ch.back().second), a[i]));
    else
      ch.push_back(make_pair(0, a[i]));
  }
}
pair<long long, long long> Find(int tl, int tr, int v, int l, int r,
                                long double t) {
  if (tl > tr) return make_pair(-1, -1);
  if (tl == l && tr == r) {
    int ind = distance(tree[v].ch.begin(),
                       upper_bound(tree[v].ch.begin(), tree[v].ch.end(),
                                   make_pair(t, line(INF, INF, 1))));
    ind--;
    return make_pair(tree[v].ch[ind].second.k * t + tree[v].ch[ind].second.b,
                     tree[v].ch[ind].second.idn);
  }
  int s = (l + r) / 2;
  return max(Find(tl, min(s, tr), 2 * v, l, s, t),
             Find(max(tl, s + 1), tr, 2 * v + 1, s + 1, r, t));
}
int main() {
  int n, q;
  cin >> n >> q;
  for (len = 1; len < n; len *= 2)
    ;
  tree.resize(2 * len);
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    tree[i + len].b.push_back(line(b, a, i + 1));
    Build(tree[i + len].b, tree[i + len].ch);
  }
  for (int i = len - 1; i > 0; i--) {
    vector<line> q;
    q.resize(tree[2 * i].b.size() + tree[2 * i + 1].b.size());
    merge(tree[2 * i].b.begin(), tree[2 * i].b.end(), tree[2 * i + 1].b.begin(),
          tree[2 * i + 1].b.end(), q.begin());
    for (int j = 0; j < q.size(); j++)
      if (j == q.size() - 1 || q[j].k != q[j + 1].k) tree[i].b.push_back(q[j]);
    Build(tree[i].b, tree[i].ch);
  }
  for (int i = 0; i < q; i++) {
    long long l, r, t;
    cin >> l >> r >> t;
    cout << Find(l + len - 1, r + len - 1, 1, len, len * 2 - 1, t).second
         << "\n";
  }
  return 0;
}
