#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
struct P {
  int pos, id;
  P(int pos = 0, int id = 0) : pos(pos), id(id) {}
  bool operator<(const P& cmp) const { return pos < cmp.pos; }
} p[N];
int pos[N];
int main() {
  int i, j, k, m, n, a, len;
  while (scanf("%d%d", &n, &m) == 2) {
    for (i = 1; i <= n; i++)
      scanf("%d", &p[i].pos), p[i].id = i, pos[i] = p[i].pos;
    sort(p + 1, p + 1 + n);
    while (m--) {
      scanf("%d%d", &a, &len);
      while (true) {
        int id1 = lower_bound(p + 1, p + 1 + n, P(pos[a] + len + 1)) - p;
        id1--;
        int id2 = lower_bound(p + 1, p + 1 + n,
                              P(pos[a] - (len - 2 * (p[id1].pos - pos[a])))) -
                  p;
        if (p[id1].id == p[id2].id && p[id2].id == a) {
          printf("%d\n", a);
          break;
        } else if (p[id2].id == a)
          len %= (p[id1].pos - pos[a]) * 2;
        else {
          len = len - (p[id1].pos - pos[a]) - (p[id1].pos - p[id2].pos);
          a = p[id2].id;
        }
      }
    }
  }
  return 0;
}
