#include <bits/stdc++.h>
const int N = 2e5 + 10;
int n, m;
int x[N];
std::map<int, int> posToId;
int px[N];
inline int getp(int i) { return std::lower_bound(x + 1, x + 1 + n, px[i]) - x; }
int main() {
  int i, p, p2, len;
  bool isright, flag;
  int cnt;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= int(n); i++) {
    scanf("%d", &px[i]);
    x[i] = px[i];
    posToId[x[i]] = i;
  }
  std::sort(x + 1, x + 1 + n);
  for (i = 1; i <= int(m); i++) {
    scanf("%d %d", &p, &len);
    p = getp(p);
    p2 = -1;
    isright = true;
    flag = false;
    cnt = 0;
    while (true) {
      if (isright) {
        p2 = std::upper_bound(x + p, x + n + 1, x[p] + len) - x - 1;
        if (p == p2) {
          if (!cnt)
            cnt++;
          else
            break;
          isright = false;
          continue;
        }
        cnt = 0;
        if (flag) len %= 2 * (x[p2] - x[p]);
        if (len >= x[p2] - x[p]) {
          len -= x[p2] - x[p];
          p = p2;
          isright = false;
        }
      } else {
        p2 = std::lower_bound(x + 1, x + p, x[p] - len) - x;
        if (p == p2) {
          if (!cnt)
            cnt++;
          else
            break;
          isright = true;
          continue;
        }
        cnt = 0;
        if (flag) len %= 2 * (x[p] - x[p2]);
        if (len >= x[p] - x[p2]) {
          len -= x[p] - x[p2];
          p = p2;
          isright = true;
        }
      }
      flag = true;
    }
    printf("%d\n", posToId[x[p]]);
  }
  return 0;
}
