#include <bits/stdc++.h>
using namespace std;
int B[1000000], C[1000000], D[1000000];
int n, q;
struct nk {
  int a;
  int d;
} A[1000000];
bool Less(const nk& s1, const nk& s2) { return s1.a < s2.a; }
int main() {
  while (~scanf("%d%d", &n, &q)) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &A[i].a);
      A[i].d = i;
    }
    sort(A, A + n, Less);
    for (int i = 0; i < n; i++) {
      C[A[i].d] = i;
      B[i] = A[i].a;
    }
    int k, len, k1, dis, dir, thel;
    while (q--) {
      scanf("%d%d", &k, &len);
      if (n == 1) {
        printf("%d\n", 1);
        continue;
      }
      k = C[k - 1];
      dis = B[k] + len;
      dir = -1;
      k1 = upper_bound(B, B + n, dis) - B - 1;
      len -= B[k1] - B[k];
      k = k1;
      while (true) {
        dis = B[k] + len * dir;
        if (dir > 0) {
          k1 = upper_bound(B, B + n, dis) - B - 1;
        } else {
          k1 = lower_bound(B, B + n, dis) - B;
        }
        if (k == k1) break;
        thel = abs(B[k1] - B[k]);
        if ((len / thel) % 2 == 0) {
          len = (len % thel);
          continue;
        } else {
          len = len % thel;
          dir *= -1;
          k = k1;
        }
      }
      printf("%d\n", A[k].d + 1);
    }
  }
  return 0;
}
