#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1000 * 1000 + 10;
map<int, int> valueToIndex;
int newIndex[SIZE];
int x[SIZE], N, M;
int b_search_r(int l, int r, int i, int L) {
  if (r - l < 2) {
    if (x[r] - x[i] <= L) return r;
    return l;
  }
  int mid = (l + r) / 2;
  if (x[mid] - x[i] <= L) return b_search_r(mid, r, i, L);
  return b_search_r(l, mid - 1, i, L);
}
int b_search_l(int l, int r, int i, int L) {
  if (r - l < 2) {
    if (x[i] - x[l] <= L) return l;
    return r;
  }
  int mid = (l + r) / 2;
  if (x[i] - x[mid] <= L) return b_search_l(l, mid, i, L);
  return b_search_l(mid + 1, r, i, L);
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%d", &x[i]);
    valueToIndex[x[i]] = i + 1;
  }
  sort(x, x + N);
  for (int i = 0; i < N; i++) {
    newIndex[valueToIndex[x[i]]] = i;
  }
  for (int i = 0, a, l; i < M; i++) {
    scanf("%d%d", &a, &l);
    a = newIndex[a];
    int b = b_search_r(a, N - 1, a, l);
    l -= x[b] - x[a];
    for (int j = 0;;) {
      if (j % 2 == 0) {
        a = b_search_l(0, b, b, l);
      } else {
        b = b_search_r(a, N - 1, a, l);
      }
      int dl = abs(x[a] - x[b]);
      if (a == b) break;
      int k = l / dl;
      j += k % 2;
      l -= k * dl;
    }
    printf("%d\n", valueToIndex[x[a]]);
  }
  return 0;
}
