#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int X[maxn];
struct Node {
  int x, id;
  Node(int _x = 0, int _id = 0) : x(_x), id(_id) {}
  bool operator<(const Node &rh) const { return x < rh.x; }
};
set<Node> S;
set<Node>::iterator it;
int n, m;
int Query(int a, int l) {
  int f = -1, d;
  int next;
  it = --S.upper_bound(a + l);
  next = it->x;
  l -= next - a;
  a = next;
  for (;;) {
    if (f == 1)
      it = --S.upper_bound(a + l);
    else
      it = S.lower_bound(a - l);
    next = it->x;
    if (next == a) return it->id;
    d = f * (next - a);
    if ((l / d) & 1) {
      f = -f;
      a = next;
    }
    l = l % d;
  }
  return 0;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d", X + i);
    S.insert(Node(X[i], i));
  }
  for (int i = 1; i <= m; i++) {
    int a, l;
    scanf("%d%d", &a, &l);
    printf("%d\n", Query(X[a], l));
  }
  return 0;
}
