#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
const long long INF = ~0ULL >> 1;
const int maxn = 300000;
int N, M, x[maxn], _x[maxn], id[maxn], pos[maxn];
bool cmp(const int &a, const int &b) { return x[a] < x[b]; }
int findleft(int cur, int l) {
  for (int j = (18); j >= (0); --j) {
    if (cur - (1 << j) > 0 && x[cur] - x[cur - (1 << j)] <= l) {
      l -= x[cur] - x[cur - (1 << j)];
      cur -= (1 << j);
    }
  }
  return cur;
}
int findright(int cur, int l) {
  for (int j = (18); j >= (0); --j) {
    if (cur + (1 << j) <= N && x[cur + (1 << j)] - x[cur] <= l) {
      l -= x[cur + (1 << j)] - x[cur];
      cur += (1 << j);
    }
  }
  return cur;
}
int solve(int cur, int l, int dir, int cnt, int flag = 0) {
  if (cnt <= 2) {
    if (!dir) {
      int nxt = findright(cur, l);
      if (nxt == cur) {
        if (flag)
          return cur;
        else
          return solve(cur, l, 1, cnt, 1);
      }
      return solve(nxt, l - (x[nxt] - x[cur]), 1, cnt + 1);
    } else {
      int nxt = findleft(cur, l);
      if (nxt == cur) {
        if (flag)
          return cur;
        else
          return solve(cur, l, 0, cnt, 1);
      }
      return solve(nxt, l - (x[cur] - x[nxt]), 0, cnt + 1);
    }
  } else {
    if (!dir) {
      int nxt = findright(cur, l);
      if (nxt == cur) {
        if (flag)
          return cur;
        else
          return solve(cur, l, 1, cnt, 1);
      }
      if (x[nxt] - x[cur] >= l - (x[nxt] - x[cur]))
        return solve(nxt, l - (x[nxt] - x[cur]), 1, cnt + 1);
      else {
        int t = l / (2 * (x[nxt] - x[cur]));
        l -= t * 2 * (x[nxt] - x[cur]);
        return solve(cur, l, 0, cnt + 1);
      }
    } else {
      int nxt = findleft(cur, l);
      if (nxt == cur) {
        if (flag)
          return cur;
        else
          return solve(cur, l, 0, cnt, 1);
      }
      if (x[cur] - x[nxt] >= l - (x[cur] - x[nxt]))
        return solve(nxt, l - (x[cur] - x[nxt]), 0, cnt + 1);
      else {
        int t = l / (2 * (x[cur] - x[nxt]));
        l -= t * 2 * (x[cur] - x[nxt]);
        return solve(cur, l, 1, cnt + 1);
      }
    }
  }
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = (1); i <= (N); ++i) scanf("%d", &x[i]);
  for (int i = (1); i <= (N); ++i) id[i] = i;
  sort(id + 1, id + N + 1, cmp);
  for (int i = (1); i <= (N); ++i) pos[id[i]] = i;
  for (int i = (1); i <= (N); ++i) _x[i] = x[i];
  for (int i = (1); i <= (N); ++i) x[i] = _x[id[i]];
  for (int i = (1); i <= (M); ++i) {
    int a, l;
    scanf("%d%d", &a, &l);
    a = pos[a];
    printf("%d\n", id[solve(a, l, 0, 1)]);
  }
  return 0;
}
