#include <bits/stdc++.h>
using namespace std;
template <class F>
int search(int l, int r, F test) {
  while (l < r) {
    int m = l + r >> 1;
    if (test(m))
      r = m;
    else
      l = m + 1;
  }
  return test(l) ? l : l + 1;
}
struct PT {
  long long x, y;
  PT(long long x = 0, long long y = 0) : x(x), y(y) {}
  PT operator-(const PT& o) const { return PT(x - o.x, y - o.y); }
  PT operator+(const PT& o) const { return PT(x + o.x, y + o.y); }
  PT operator*(long long k) const { return PT(k * x, k * y); }
  long long operator*(const PT& o) const { return x * o.x + y * o.y; }
  long long operator%(const PT& o) const { return x * o.y - y * o.x; }
  bool operator<(const PT& o) const { return x == o.x ? y < o.y : x < o.x; }
  bool operator==(const PT& o) const { return x == o.x && y == o.y; }
};
long long orient(PT a, PT b, PT c) { return (b - a) % (c - a); }
PT perp(PT v) { return {-v.y, v.x}; }
long long norm(PT v) { return v * v; }
struct Node {
  vector<pair<PT, int>> h;
  Node() {}
  Node(int i, long long m, long long b) : h({{PT(m, b), i}}) {}
  Node(const Node& l, const Node& r) {
    vector<pair<PT, int>> in(l.h.size() + r.h.size());
    merge(l.h.begin(), l.h.end(), r.h.begin(), r.h.end(), in.begin());
    int n = 0;
    for (auto& it : in) {
      while (n > 1 && orient(h[n - 2].first, h[n - 1].first, it.first) >= 0) {
        h.resize(--n);
      }
      h.resize(++n, it);
    }
  }
  pair<long long, int> max(long long x) {
    PT q(x, 1);
    int i;
    if (h.size() == 1) {
      i = 0;
    } else {
      i = search(0, h.size() - 2,
                 [&](int i) { return q * (h[i].first - h[i + 1].first) >= 0; });
    }
    return {h[i].first * q, h[i].second};
  }
};
struct CHT {
  vector<Node> tree;
  CHT(int n) : tree(n << 2) {}
  void build(int p, int l, int r, vector<long long>& a, vector<long long>& b) {
    if (l == r) {
      tree[p] = {l, a[l], b[l]};
    } else {
      int m = l + r >> 1, lc = p << 1, rc = lc + 1;
      build(lc, l, m, a, b);
      build(rc, m + 1, r, a, b);
      tree[p] = {tree[lc], tree[rc]};
    }
  }
  pair<long long, int> query(int p, int l, int r, int ql, int qr, long long x) {
    if (ql <= l && r <= qr) {
      return tree[p].max(x);
    } else {
      int m = l + r >> 1, lc = p << 1, rc = lc + 1;
      if (qr <= m) {
        return query(lc, l, m, ql, qr, x);
      } else if (ql > m) {
        return query(rc, m + 1, r, ql, qr, x);
      } else {
        return max(query(lc, l, m, ql, qr, x), query(rc, m + 1, r, ql, qr, x));
      }
    }
  }
};
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int n, q;
  cin >> n >> q;
  vector<long long> m(n + 1), b(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> b[i] >> m[i];
  }
  CHT seg(n);
  seg.build(1, 1, n, m, b);
  while (q--) {
    int l, r, t;
    cin >> l >> r >> t;
    cout << seg.query(1, 1, n, l, r, t).second << '\n';
  }
}
