#include <bits/stdc++.h>
using namespace std;
template <typename T>
T in() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
template <typename T>
inline T POW(T B, T P) {
  if (P == 0) return 1;
  if (P & 1)
    return B * POW(B, P - 1);
  else
    return (POW(B, P / 2) * POW(B, P / 2));
}
template <typename T>
inline T Gcd(T a, T b) {
  if (a < 0) return Gcd(-a, b);
  if (b < 0) return Gcd(a, -b);
  return (b == 0) ? a : Gcd(b, a % b);
}
template <typename T>
inline T Lcm(T a, T b) {
  if (a < 0) return Lcm(-a, b);
  if (b < 0) return Lcm(a, -b);
  return a * (b / Gcd(a, b));
}
long long Bigmod(long long base, long long power, long long MOD) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
bool isVowel(char ch) {
  ch = toupper(ch);
  if (ch == 'A' || ch == 'U' || ch == 'I' || ch == 'O' || ch == 'E')
    return true;
  return false;
}
template <typename T>
long long int isLeft(T a, T b, T c) {
  return (a.x - b.x) * (b.y - c.y) - (b.x - c.x) * (a.y - b.y);
}
long long ModInverse(long long number, long long MOD) {
  return Bigmod(number, MOD - 2, MOD);
}
bool isConst(char ch) {
  if (isalpha(ch) && !isVowel(ch)) return true;
  return false;
}
int toInt(string s) {
  int sm;
  stringstream second(s);
  second >> sm;
  return sm;
}
struct line {
  long long a, b;
  double xleft;
  bool type;
  int id;
  line(long long _a, long long _b, int _id) {
    a = _a;
    b = _b;
    id = _id;
    type = 0;
  }
  bool operator<(const line &other) const {
    if (other.type) {
      return xleft < other.xleft;
    }
    return a > other.a;
  }
};
double meet(line x, line y) { return 1.0 * (y.b - x.b) / (x.a - y.a); }
struct cht {
  set<line> hull;
  cht() { hull.clear(); }
  bool hasleft(set<line>::iterator node) { return node != hull.begin(); }
  bool hasright(set<line>::iterator node) { return node != prev(hull.end()); }
  void updateborder(set<line>::iterator node) {
    if (hasright(node)) {
      line temp = *next(node);
      hull.erase(temp);
      temp.xleft = meet(*node, temp);
      hull.insert(temp);
    }
    if (hasleft(node)) {
      line temp = *node;
      temp.xleft = meet(*prev(node), temp);
      hull.erase(node);
      hull.insert(temp);
    } else {
      line temp = *node;
      hull.erase(node);
      temp.xleft = -2000000000000000000LL;
      hull.insert(temp);
    }
  }
  bool useless(line left, line middle, line right) {
    double x = meet(left, right);
    double y = x * middle.a + middle.b;
    double ly = left.a * x + left.b;
    return y > ly;
  }
  bool useless(set<line>::iterator node) {
    if (hasleft(node) && hasright(node)) {
      return useless(*prev(node), *node, *next(node));
    }
    return 0;
  }
  void addline(long long m, long long c, int id) {
    line temp = line(m, c, id);
    auto it = hull.lower_bound(temp);
    if (it != hull.end() && it->a == m) {
      if (it->b > c) {
        hull.erase(it);
      } else {
        return;
      }
    }
    hull.insert(temp);
    it = hull.find(temp);
    if (useless(it)) {
      hull.erase(it);
      return;
    }
    while (hasleft(it) && useless(prev(it))) {
      hull.erase(prev(it));
    }
    while (hasright(it) && useless(next(it))) {
      hull.erase(next(it));
    }
    updateborder(it);
  }
  pair<long long, int> getbest(long long x) {
    if (hull.empty()) {
      return make_pair(-2000000000000000000LL, -1);
    }
    line query(0, 0, -1);
    query.xleft = x;
    query.type = 1;
    auto it = hull.lower_bound(query);
    it = prev(it);
    return make_pair(-(it->a * x + it->b), it->id);
  }
};
cht Tree[200007 * 4];
long long int m, c;
int Id;
void Upd(int id, int l, int r, int p) {
  Tree[id].addline(-m, -c, Id);
  if (l == r) {
    return;
  }
  int mid = (l + r) / 2;
  int lft = 2 * id;
  int rgt = lft + 1;
  if (p <= mid)
    Upd(lft, l, mid, p);
  else
    Upd(rgt, mid + 1, r, p);
}
long long int P;
pair<long long int, int> Qry(int id, int l, int r, int st, int ed) {
  if (st <= l && ed >= r) {
    return Tree[id].getbest(P);
  }
  int mid = (l + r) / 2;
  int lft = 2 * id;
  int rgt = lft + 1;
  if (ed <= mid)
    return Qry(lft, l, mid, st, ed);
  else if (st > mid)
    return Qry(rgt, mid + 1, r, st, ed);
  else {
    pair<long long int, int> lf = Qry(lft, l, mid, st, ed);
    pair<long long int, int> rg = Qry(rgt, mid + 1, r, st, ed);
    lf = max(lf, rg);
    return lf;
  }
}
int main() {
  int n, q;
  n = in<int>(), q = in<int>();
  for (int i = 1; i < n + 1; i++) {
    c = in<long long int>(), m = in<long long int>();
    Id = i;
    Upd(1, 1, n, i);
  }
  while (q--) {
    int l, r;
    l = in<int>(), r = in<int>();
    P = in<long long int>();
    printf("%d\n", Qry(1, 1, n, l, r).second);
  }
  return 0;
}
