#include <bits/stdc++.h>
using namespace std;
vector<long long int> pos;
int n;
int Right(int i, int l);
int Left(int i, int l) {
  if (pos[i] - l > pos[i - 1]) {
    if (pos[i] + l < pos[i + 1])
      return i;
    else
      return Right(i, l);
  }
  int j =
      lower_bound(pos.begin() + 0, pos.begin() + i, pos[i] - l) - pos.begin();
  return Right(j, l + pos[j] - pos[i]);
}
int Right(int i, int l) {
  if (pos[i] + l < pos[i + 1]) {
    if (pos[i] - l > pos[i - 1])
      return i;
    else
      return Left(i, l);
  }
  int j = upper_bound(pos.begin() + i, pos.begin() + n, l + pos[i]) -
          pos.begin() - 1;
  if (l >= 2 * (pos[j] - pos[i])) {
    int x =
        lower_bound(pos.begin() + 0, pos.begin() + i, 2 * pos[j] - l - pos[i]) -
        pos.begin();
    if (x == i)
      return Right(i, l % (2 * (pos[j] - pos[i])));
    else
      return Right(x, l + pos[i] + pos[x] - 2 * pos[j]);
  } else
    return Left(j, l + pos[i] - pos[j]);
}
int main() {
  int m, i, x, l;
  scanf("%d", &n), scanf("%d", &m);
  pos.resize(n + 2);
  vector<pair<long long int, int> > vp(n + 2);
  for (i = 1; i <= n; i++) scanf("%d", &x), vp[i].first = x, vp[i].second = i;
  vp[0].first = -1000000000000000000 - 2, vp[0].second = -1;
  vp[n + 1].first = 1000000000000000000 + 2, vp[n + 1].second = n + 1;
  sort(vp.begin(), vp.end());
  n += 2;
  vector<int> act(n), vir(n);
  for (i = 0; i < n; i++)
    pos[i] = vp[i].first, act[i] = vp[i].second, vir[vp[i].second] = i;
  while (m--) {
    scanf("%d", &x), scanf("%d", &l);
    printf("%d\n", act[Right(vir[x], l)]);
  }
}
