#include <bits/stdc++.h>
using namespace std;
long long p[200005];
map<long long, long long> rpeg;
set<long long> pegs, npegs;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    p[i] = x;
    rpeg[x] = i;
    pegs.insert(x);
    npegs.insert(-x);
  }
  while (m--) {
    long long a, l, s;
    cin >> a >> l;
    a = p[a];
    s = 0;
    while (true) {
      {
        auto it = pegs.upper_bound(a + l);
        assert(it != pegs.begin());
        it--;
        auto it2 = npegs.upper_bound(-(a - l));
        assert(it2 != npegs.begin());
        it2--;
        if (*it == -1 * (*it2)) break;
      }
      if (s == 0) {
        auto it = pegs.upper_bound(a + l);
        assert(it != pegs.begin());
        it--;
        long long pos = *it;
        if (2 * (pos - a) >= l) {
          l -= (pos - a);
          a = pos;
          s = 1;
        } else {
          auto it2 = npegs.upper_bound(-(pos - (l - (pos - a))));
          assert(it2 != npegs.begin());
          it2--;
          long long pos2 = -1 * (*it2);
          if (a == pos2)
            l %= 2 * (pos - a);
          else {
            l -= (pos - a);
            l -= (pos - pos2);
            a = pos2;
          }
        }
      } else {
        auto it = npegs.upper_bound(-(a - l));
        it--;
        long long pos = -1 * (*it);
        if (2 * (a - pos) >= l) {
          l -= (a - pos);
          a = pos;
          s = 0;
        } else {
          auto it2 = pegs.upper_bound(pos + (l - (a - pos)));
          it2--;
          long long pos2 = *it2;
          if (a == pos2)
            l %= 2 * (a - pos);
          else {
            l -= (a - pos);
            l -= (pos2 - pos);
            a = pos2;
          }
        }
      }
    }
    a = rpeg[a];
    cout << a << "\n";
  }
}
