#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6;
int x[MAXN], si[MAXN], is[MAXN], N, M;
pair<int, int> p[MAXN];
int nxt(int i, int l, int d) {
  return d == 1 ? upper_bound(x, x + N, x[i] + l) - x - 1
                : lower_bound(x, x + N, x[i] - l) - x;
}
int id(int i, int l, int d) {
  int j = nxt(i, l, d);
  if (j == i) return si[i];
  int dx = abs(x[i] - x[j]);
  return l % (2 * dx) == l ? id(j, l - dx, -d) : id(i, l % (2 * dx), d);
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%d", &p[i].first);
    p[i].second = i;
  }
  sort(p, p + N);
  for (int i = 0; i < N; i++) {
    x[i] = p[i].first;
    si[i] = p[i].second;
    is[p[i].second] = i;
  }
  for (int i, l; M--;) {
    scanf("%d%d", &i, &l);
    i = is[i - 1];
    int j = nxt(i, l, 1), d = -1;
    if (i == j) {
      j = nxt(i, l, -1);
      d = 1;
    }
    printf("%d\n", (i == j ? si[i] : id(j, l - abs(x[i] - x[j]), d)) + 1);
  }
}
